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

trial start/stop times error for TIMIT block #125

Closed jihyunbak closed 2 years ago

jihyunbak commented 2 years ago

Trial times error in TIMIT blocks.

Same issues in two NWB files in /clusterfs/NSDS_data/jlivezey/_test/:

Trials table for R73_B6

start_time stop_time sb sample_filename
0.000000 16.407268 b fmah0_si1289.Pshft.wav \n
15.407268 14.407268 s fmah0_si1289.Pshft.wav \n
17.463132 16.463132 s mrds0_si1167.Pshft.wav \n
19.506299 18.506299 s fceg0_si1878.Pshft.wav \n
20.986266 19.986266 s msjs1_si639.Pshft.wav \n
... ... ... ...
2250.486415 2249.486415 s fsdc0_si2234.Pshft.wav \n
2252.132762 2251.132762 s mrab0_si1224.Pshft.wav \n
2254.777467 2253.777467 s mgaf0_si652.Pshft.wav \n
2257.082860 2256.082860 s frjb0_si1794.Pshft.wav \n
2260.082860 2281.533604 b frjb0_si1794.Pshft.wav \n

1000 rows × 4 columns

Trials table for RVG06_B08

start_time stop_time sb sample_filename
0.000000 11.187981 b fmah0_si1289.Pshft.wav \n
10.187981 9.187981 s fmah0_si1289.Pshft.wav \n
12.243845 11.243845 s mrds0_si1167.Pshft.wav \n
14.287012 13.287012 s fceg0_si1878.Pshft.wav \n
15.766979 14.766979 s msjs1_si639.Pshft.wav \n
... ... ... ...
2245.270487 2244.270487 s fsdc0_si2234.Pshft.wav \n
2246.916751 2245.916751 s mrab0_si1224.Pshft.wav \n
2249.561457 2248.561457 s mgaf0_si652.Pshft.wav \n
2251.866931 2250.866931 s frjb0_si1794.Pshft.wav \n
2254.866931 2259.639337 b frjb0_si1794.Pshft.wav \n

1000 rows × 4 columns

jihyunbak commented 2 years ago

Looks like this error is coming from the current duration=-1 setting for TIMIT.

Current stim_configs for TIMIT stimulus looks like

stimulus:
  name: timit
  type: discrete
  mark_offset: 0
  mark_threshold: 0.3
  mark_sampling_rate: 12207.03125
  duration: -1
  nsamples: 998
  first_mark: 5.0
  baseline_start: 3.0
  baseline_end: 3.0

The "duration" value is then used in

https://github.com/BouchardLab/nsds_lab_to_nwb/blob/0f9bc145ed716acf30038d7fbdc5bce59663ee72/nsds_lab_to_nwb/components/stimulus/tokenizers/timit_tokenizer.py#L31-L34