AllenSDK icon indicating copy to clipboard operation
AllenSDK copied to clipboard

Epoch Separation Exception

Open saskiad opened this issue 3 years ago • 0 comments

Describe the bug the get_stimulus_epoch() function doesn't work for all experiments. We've known about this bug for years and we really need to fix it!

To Reproduce

EpochSeparationException Traceback (most recent call last) in 1 session_id = 659495103 2 dataset = boc.get_ophys_experiment_data(session_id) ----> 3 stim_epoch = dataset.get_stimulus_epoch_table()

/Applications/anaconda2/envs/py3/lib/python3.7/site-packages/allensdk/core/brain_observatory_nwb_data_set.py in get_stimulus_epoch_table(self) 192 interval_stimulus_dict = {} 193 for stimulus in self.list_stimuli(): --> 194 stimulus_interval_list = get_epoch_mask_list(stimulus_table_dict[stimulus], threshold=threshold_dict.get(self.get_session_type(), None)) 195 for stimulus_interval in stimulus_interval_list: 196 interval_stimulus_dict[stimulus_interval] = stimulus

/Applications/anaconda2/envs/py3/lib/python3.7/site-packages/allensdk/core/brain_observatory_nwb_data_set.py in get_epoch_mask_list(st, threshold, max_cuts) 84 # See: https://gist.github.com/nicain/bce66cd073e422f07cf337b476c63be7 85 # https://github.com/AllenInstitute/AllenSDK/issues/66 ---> 86 raise EpochSeparationException('more than 2 epochs cut', delta=delta) 87 88 for ii in range(len(cut_inds)+1):

EpochSeparationException: more than 2 epochs cut

Expected behavior I expect to get a dataframe of the stimulus epochs

Actual Behavior see above

saskiad avatar Jul 03 '21 00:07 saskiad