allensdk.internal.brain_observatory.time_sync module

class allensdk.internal.brain_observatory.time_sync.OphysTimeAligner(sync_file, scanner=None, dff_file=None, stimulus_pkl=None, eye_video=None, behavior_video=None, long_stim_threshold=0.2)[source]

Bases: object

behavior_video_timestamps
corrected_behavior_video_timestamps
corrected_eye_video_timestamps
corrected_ophys_timestamps
corrected_stim_timestamps
dataset
eye_video_timestamps
ophys_timestamps

Get the timestamps for the ophys data.

stim_timestamps
allensdk.internal.brain_observatory.time_sync.corrected_video_timestamps(video_name, timestamps, data_length)[source]
allensdk.internal.brain_observatory.time_sync.get_alignment_array(ref, other, int_method=<ufunc 'floor'>)[source]

Generate an alignment array

allensdk.internal.brain_observatory.time_sync.get_keys(sync_dset)[source]

Get the correct lookup for line labels.

This method is fragile, but not all old data contains the full list of keys.

allensdk.internal.brain_observatory.time_sync.get_ophys_data_length(filename)[source]
allensdk.internal.brain_observatory.time_sync.get_photodiode_events(sync_dset, photodiode_key)[source]

Returns the photodiode events with the start/stop indicators and the window init flash stripped off.

allensdk.internal.brain_observatory.time_sync.get_real_photodiode_events(sync_dset, photodiode_key, anomaly_threshold=0.5)[source]

Gets the photodiode events with the anomalies removed.

allensdk.internal.brain_observatory.time_sync.get_stim_data_length(filename: str) → int[source]

Get stimulus data length from .pkl file.

Parameters:
filename : str

Path of stimulus data .pkl file.

Returns:
int

Stimulus data length.

allensdk.internal.brain_observatory.time_sync.get_video_length(filename)[source]
allensdk.internal.brain_observatory.time_sync.monitor_delay(sync_dset, stim_times, photodiode_key, transition_frame_interval=60, max_monitor_delay=0.07, assumed_delay=0.0351)[source]

Calculate monitor delay.