You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rewarded nose pokes in split TDT sessions are shifted twice #57
Part of #43. While tracing the benchmark discrepancies in the three photometry sessions recorded across two TDT blocks, I found that some of their rewarded nose pokes are shifted twice.
For a split session, Seiler2024NWBConverter.temporally_align_data_interfaces takes each TTL's onsets from the second block and shifts them by the time of the first block's last sample:
For a reward TTL, get_ttl_timestamps returns tdt_photometry2.epocs[ttl_name].onset itself, so += shifts the block's own onsets in place. The reward TTL (RNRW or LNRW) is handled before the nose-poke TTL of the same side, and get_ttl_timestamps reads the reward onsets again when it handles the nose pokes. By then they are already shifted, and the merged result is shifted by t_end a second time.
139.298 (2019-09-12): the second block's RNnR already contains its 6 rewarded pokes. The containment check compares them with the shifted rewards, fails, and merges the rewards in at twice the offset, so the published file has 6 extra right nose pokes (488 instead of 482).
92.246 (2019-02-27): the second block's LNnR has none of its 16 rewarded pokes, so merging them in is correct, but they land at twice the offset, past the end of the photometry recording.
332.393 (2020-07-28) goes through a special case that never reads its reward TTL and is not affected.
Shifting with ttl_timestamps2 + t_end makes a new array and leaves the block's onsets unchanged.
changed the title [-]Sessions recorded in two TDT blocks lose the time between blocks[/-][+]Rewarded nose pokes in split TDT sessions are shifted twice[/+]on Oct 20, 2026
Activity
[-]Sessions recorded in two TDT blocks lose the time between blocks[/-][+]Rewarded nose pokes in split TDT sessions are shifted twice[/+]