allensdk.brain_observatory.sync_utilities package

Module contents

allensdk.brain_observatory.sync_utilities.get_synchronized_frame_times(session_sync_file: Path, sync_line_label_keys: Tuple[str, ...], drop_frames: List[int] | None = None, trim_after_spike: bool = True) Series[source]

Get experimental frame times from an experiment session sync file.

  1. Get rising edges from the sync dataset

  2. Occasionally an extra set of frame times are acquired after the rest of

    the signals. These are manifested by a discontiguous time sequence. We detect and remove these.

  3. Remove dropped frames

Parameters:
session_sync_filePath

Path to an ephys session sync file. The sync file contains rising/falling edges from a daq system which indicates when certain events occur (so they can be related to each other).

sync_line_label_keysTuple[str, …]

Line label keys to get times for. See class attributes of allensdk.brain_observatory.sync_dataset.Dataset for a listing of possible keys.

drop_framesList

frame indices to be removed from frame times

trim_after_spikebool = True

If True, will call trim_discontiguous_times on the frame times before returning them, which will detect any spikes in the data and remove all elements for the list which come after the spike.

Returns:
pd.Series

An array of times when eye tracking frames were acquired.

allensdk.brain_observatory.sync_utilities.trim_discontiguous_times(times: ndarray, threshold=100) ndarray[source]

If the time sequence is discontigous, detect the first instance occurance and trim off the tail of the sequence

Parameters:
timesframe times
Returns:
trimmed frame times