[Neuropixels] Add time shift to processed behavior data timestamp columns #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To align with Bpod, this PR implements the shifting of timestamp columns in the processed behavior data.
The columns that need to be shifted:
See #31
This PR also includes the changes how we are storing "Lled", "Rled","l_opt" and "r_opt" columns.
Before we added the 4 timestamp for each trial in the same column, just as:
The 4 timestamp for each trial is from:
e.g. Lled = [left reward side light on, left reward side light off, left reward side light flash on, left reward side light flash off]
l_opt = [left side light turns on, left side light turns off, right port turns off, side light turns off]
I think it is better not to store them as arrays in the trials table but break them into separate columns, e.g.
rewarded_port_onset_time -> corresponds to the first timestamp of "Lled" if the rewarded side for that trials was the left port
rewarded_port_offset_time -> corresponds to the second timestamp of "Lled" if the rewarded side for that trials was the left port
rewarded_port_flash_onset_time -> corresponds to the third timestamp of "Lled" if the rewarded side for that trials was the left port
rewarded_port_flash_offset_time -> corresponds to the fourth timestamp of "Lled" if the rewarded side for that trials was the left port
We populate rewarded_port_onset_time, rewarded_port_offset_time, rewarded_port_flash_onset_time, rewarded_port_flash_offset_time etc. for each trial depending on which side was the rewarded side.