allensdk.brain_observatory.ecephys.align_timestamps.probe_synchronizer module

class allensdk.brain_observatory.ecephys.align_timestamps.probe_synchronizer.ProbeSynchronizer(global_probe_sampling_rate, local_probe_sampling_rate, total_time_shift, min_time, max_time)[source]

Bases: object

classmethod compute(master_barcode_times, master_barcodes, probe_barcode_times, probe_barcodes, min_time, max_time, probe_start_index, local_probe_sampling_rate)[source]

Compute a transform from probe samples to master times by aligning barcodes.

Parameters:
master_barcode_timesnp.ndarray

start times of barcodes (according to the master clock) on the master line. One per barcode.

master_barcodesnp.ndarray

barcode values on the master line. One per barcode

probe_barcode_timesnp.ndarray

start times (according to the probe clock) of barcodes on the probe line. One per barcode

probe_barcodesnp.ndarray

barcode values on the probe_line. One per barcode

min_timeFloat

time (in seconds) of first barcode to align

max_timeFloat

time (in seconds) of last barcode to align

probe_start_indexint

sample index of probe acquisition start time

local_probe_sampling_ratefloat

the probe’s apparent sampling rate

Returns:
ProbeSynchronizer

When called, applies the transform computed here to samples on the probe clock.

property sampling_rate_scale

The ratio of the probe’s sampling rate assessed on the global clock to the probe’s locally assessed sampling rate.