BouchardLab / nsds_lab_to_nwb

Python package to convert NSDS Lab data to NWB files.
https://nsds-lab-to-nwb.readthedocs.io/en/latest/
0 stars 4 forks source link

Confirm/generalize stimulus file paths #6

Closed jihyunbak closed 3 years ago

jihyunbak commented 3 years ago

Should confirm/generalize/standardize the stimulus paths in WavManager.get_stim_file().

Current code:

class WavManager():
[…]
    @staticmethod
    def get_stim_file(stim_name, stim_path):
        if stim_name == 'tone150':
            return os.path.join(stim_path,
                'Tone150/freq_resp_area_stimulus_signal_flo500Hz_fhi32000Hz_nfreq30_natten1_nreps150_fs96000.wav')
        if stim_name == 'timit':
            return os.path.join(stim_path,
                'TIMIT/timit998s.wav')
        if stim_name == 'tone':
            return os.path.join(stim_path,
                'Tone/stimulus_signal_03202013.wav')
        if stim_name == 'wn2':
            return os.path.join(stim_path,
                'WN/tb_noise_burst_stim_fs96kHz_signal.wav')
        if stim_name == 'dmr':
            return os.path.join(stim_path,
                'DMR/dmr-500flo-40000fhi-4SM-40TM-40db-96khz-48DF-15min.wav')
        raise ValueError('unknown stimulus')

Can we go on like this, or do we need a new way - perhaps providing the full file path to the stimulus as user input?