from nbdev.showdoc import *
%load_ext autoreload
%autoreload 2
To align timeseries of an experiment, we need to read logs and import data produced by 3rd party softwares used during the experiment. It includes:
- QDSpy logging
- Numpy arrays of the stimuli
- SpykingCircus spike sorting refined with Phy
- Eye tracking results from MaskRCNN
To read QDSpy logs of your experiment, simply provide the folder containing the log you want to read to get_QDSpy_logs
It returns a list fo the QDSpy logs. Stimuli are contained in a list inside each log:
The stimuli objects contains informations on how their display went:
# print(stim.name, stim.start_time, stim.frame_delay, stim.md5)
Some stimuli are generated shortly before every display. [`get_synced_file`](/theonerig/synchro.nested_stims.html#get_synced_file)
matches the compiled stimuli from a directory of your choice to the stimulus (stim_id
) you are looking at, based on timestamps.
To unpack the stimulus values, provide the folder of the numpy arrays and the hash of the stimulus:
Unpacked is a tuple, where the first element is the intensity of shape (n_frames, n_colors, y, x)
The second element of the tuple repesents the marker values for the timing. QDSpy defaults are zero and ones, but I used custom red squares taking intensities [50,100,150,200,250] to time with five different signals
Each stimulus is also starting with a barcode, of the form:
0 0 0 0 0 0 4 0 4*[1-4] 0 4*[1-4] 0 4*[1-4] 0 4*[1-4] 0 4 0 0 0 0 0 0
and ends with 0 0 0 0 0 0