BruntonUWBio / ajile12-nwb-data

MIT License
8 stars 3 forks source link

Coarse labels sbj 1 session 7 do not match #2

Open Giezzy opened 1 year ago

Giezzy commented 1 year ago

Following the Example_AJILE12_exploration jupyter notebook I was opening other subjects and sessions, when running sbj=1 and session=7 (all other parameters the same) the coarse labels contain timestamps which exceed the dimension of the ElectricalSeries.

For example

start_time      62612.333333
stop_time       62733.033333
labels        Computer/phone
diff                   120.7

After correcting for the sampling rate stop_time becomes 31.366.516, while the corresponding dataframe is only 27.858.793 long

stepeter commented 1 year ago

Thank you for pointing out the discrepancy between coarse label and ECoG datastreams for this participant day. What is happening there is that the coarse labels are derived from video data that was recorded separately from the ECoG and the raw data were saved in separate files. For sbj 1, one of the ECoG data files was lost before we put together this dataset which is why there is no day 6 for sbj 1. Based on the session_start_time, the first ~8.5 hours of data are missing from the ECoG data. This also matches the number of missing hours of ECoG data if you look at the data size based on the 500 Hz sampling rate (shown below). The labeled video data was available for the entirety of day 7, so we included it all.

total_sec_per_day = 3600*24
ecog_day7_sec = len(nwb.acquisition['ElectricalSeries'].data)/500
hrs_missing = (total_sec_per_day - ecog_day7_sec)/3600

If you are looking to have the coarse labels aligned to the ECoG data, you can pad the ECoG data with NaNs during the first 8.5 hours (15341207 NaN columns to get the total to 43200000). Otherwise, you can just ignore the coarse labels during the first 8.5 hours because there is no corresponding ECoG data.