allensdk.brain_observatory.sync_utilities package¶
Module contents¶
-
allensdk.brain_observatory.sync_utilities.
get_synchronized_frame_times
(session_sync_file: pathlib.Path, sync_line_label_keys: Tuple[str, ...], drop_frames: Union[List[int], NoneType] = None, trim_after_spike: bool = True) → pandas.core.series.Series[source]¶ Get experimental frame times from an experiment session sync file.
- Get rising edges from the sync dataset
- 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.
- Remove dropped frames
Parameters: - session_sync_file : Path
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_keys : Tuple[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_frames : List
frame indices to be removed from frame times
- trim_after_spike : bool = 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: numpy.ndarray, threshold=100) → numpy.ndarray[source]¶ If the time sequence is discontigous, detect the first instance occurance and trim off the tail of the sequence
Parameters: - times : frame times
Returns: - trimmed frame times