allensdk.internal.pipeline_modules.run_ophys_time_sync module

class allensdk.internal.pipeline_modules.run_ophys_time_sync.TimeSyncOutputs[source]

Bases: tuple

Schema for synchronization outputs

behavior_alignment

Alias for field number 12

behavior_delta

Alias for field number 5

behavior_times

Alias for field number 9

experiment_id

Alias for field number 0

eye_alignment

Alias for field number 11

eye_delta

Alias for field number 4

eye_times

Alias for field number 8

ophys_delta

Alias for field number 2

ophys_times

Alias for field number 6

stimulus_alignment

Alias for field number 10

stimulus_delay

Alias for field number 1

stimulus_delta

Alias for field number 3

stimulus_times

Alias for field number 7

class allensdk.internal.pipeline_modules.run_ophys_time_sync.TimeSyncWriter(output_h5_path: str, output_json_path: Optional[str] = None)[source]

Bases: object

validate_paths(self)[source]

Determines whether we can actually write to the specified paths, allowing for creation of intermediate directories. It is a good idea to run this beore doing any heavy calculations!

write(self, outputs: allensdk.internal.pipeline_modules.run_ophys_time_sync.TimeSyncOutputs)[source]

Convenience for writing both an output h5 and (if applicable) an output json.

Parameters:
outputs : the data to be written
write_output_h5(self, outputs)[source]

Write (mainly) heaviweight data to an h5 file.

Parameters:
outputs : the data to be written
write_output_json(self, outputs)[source]

Write lightweight data to a json

Parameters:
outputs : the data to be written
allensdk.internal.pipeline_modules.run_ophys_time_sync.check_stimulus_delay(obt_delay: float, min_delay: float, max_delay: float)[source]

Raise an exception if the monitor delay is not within specified bounds

Parameters:
obt_delay : obtained monitor delay (s)
min_delay : lower threshold (s)
max_delay : upper threshold (s)
allensdk.internal.pipeline_modules.run_ophys_time_sync.main()[source]
allensdk.internal.pipeline_modules.run_ophys_time_sync.run_ophys_time_sync(aligner: allensdk.internal.brain_observatory.time_sync.OphysTimeAligner, experiment_id: int, min_stimulus_delay: float, max_stimulus_delay: float) → allensdk.internal.pipeline_modules.run_ophys_time_sync.TimeSyncOutputs[source]

Carry out synchronization of timestamps across the data streams of an ophys experiment.

Parameters:
aligner : drives alignment. See OphysTimeAligner for details of the

attributes and properties that must be implemented.

experiment_id : unique identifier for the experiment being aligned
min_stimulus_delay : reject alignment run (raise a ValueError) if the

calculated monitor delay is below this value (s).

max_stimulus_delay : reject alignment run (raise a ValueError) if the

calculated monitor delay is above this value (s).

Returns:
A TimeSyncOutputs (see definintion for more information) of output

parameters and arrays of aligned timestamps.