ibllib.ephys.sync_probes

Functions

apply_sync

sync

Wrapper for sync_probes.version3A and sync_probes.version3B that automatically determines the version

sync_probe_front_times

From 2 timestamps vectors of equivalent length, output timestamps array to be used for linear interpolation

version3A

From a session path with _spikeglx_sync arrays extracted, locate ephys files for 3A and

version3B

From a session path with _spikeglx_sync arrays extraccted, locate ephys files for 3A and

apply_sync(sync_file, times, forward=True)[source]
Parameters:
  • sync_file – probe sync file (usually of the form _iblrig_ephysData.raw.imec1.sync.npy)

  • times – times in seconds to interpolate

  • forward – if True goes from probe time to session time, from session time to probe time

otherwise :return: interpolated times

sync(ses_path, **kwargs)[source]

Wrapper for sync_probes.version3A and sync_probes.version3B that automatically determines the version

Parameters:

ses_path

Returns:

bool True on a a successful sync

version3A(ses_path, display=True, type='smooth', tol=2.1)[source]
From a session path with _spikeglx_sync arrays extracted, locate ephys files for 3A and

outputs one sync.timestamps.probeN.npy file per acquired probe. By convention the reference probe is the one with the most synchronisation pulses. Assumes the _spikeglx_sync datasets are already extracted from binary data

Parameters:
  • ses_path

  • type – linear, exact or smooth

Returns:

bool True on a a successful sync

version3B(ses_path, display=True, type=None, tol=2.5, probe_names=None)[source]
From a session path with _spikeglx_sync arrays extraccted, locate ephys files for 3A and

outputs one sync.timestamps.probeN.npy file per acquired probe. By convention the reference probe is the one with the most synchronisation pulses. Assumes the _spikeglx_sync datasets are already extracted from binary data

Parameters:
  • ses_path

  • type – linear, exact or smooth

  • probe_names – by default will rglob all probes in the directory. If specified, this will filter the probes on which to perform the synchronisation, defaults to None, optional

Returns:

None

sync_probe_front_times(t, tref, sr, display=False, type='smooth', tol=2.0)[source]

From 2 timestamps vectors of equivalent length, output timestamps array to be used for linear interpolation

Parameters:
  • t – time-serie to be synchronized

  • tref – time-serie of the reference

  • sr – sampling rate of the slave probe

Returns:

a 2 columns by n-sync points array where each row corresponds

to a sync point: sample_index (0 based), tref :return: quality Bool. False if tolerance is exceeded