Skip to content

Commit c6e18d9

Browse files
committed
make shuffle optional (for calibration)
1 parent 799f1ef commit c6e18d9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

iblrig_custom_tasks/samuel_tonotopicMapping/task.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,11 @@ def softcode_handler(softcode: int) -> None:
113113
logger.info(f'- {state_index + 1:03d}/{n_states}: {frequency:5d} Hz')
114114

115115
def get_state_machine(self, sma_idx: int) -> StateMachine:
116-
# generate shuffled sequence, seeded with state machine number
116+
# generate sequence, optionally shuffled (seeded with state machine number)
117117
Session.sequence = np.repeat(np.arange(len(self.frequencies)), self.repetitions[sma_idx])
118-
np.random.seed(sma_idx)
119-
np.random.shuffle(Session.sequence)
118+
if self.task_params['shuffle']:
119+
np.random.seed(sma_idx)
120+
np.random.shuffle(Session.sequence)
120121

121122
# build state machine
122123
sma = StateMachine(self.bpod)

iblrig_custom_tasks/samuel_tonotopicMapping/task_parameters.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
'd_ramp': 0.01 # duration of Hanning ramp (s)
88
'amplitude': 0.05 # initial amplitude of all stimuli prior to dB attenuation
99
'fs': 192000 # sampling rate (Hz) - Harp supports 96000 Hz and 192000 Hz
10+
'shuffle': true # whether to shuffle the order of frequencies or not

0 commit comments

Comments
 (0)