ibllib.ephys.sync_probes

Functions

apply_sync

param sync_file

probe sync file (usually of the form _iblrig_ephysData.raw.imec1.sync.npy)

sync

Wrapper for sync_probes.version3A and sync_probes.version3B that automatically determines the version :param ses_path: :return: bool True on a a successful sync

sync_probe_front_times

From 2 timestamps vectors of equivalent length, output timestamps array to be used for linear interpolation :param t: time-serie to be synchronized :param tref: time-serie of the reference :param sr: sampling rate of the slave probe :return: a 2 columns by n-sync points array where each row corresponds to a sync point: sample_index (0 based), tref :return: quality Bool.

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 :param ses_path: :return: 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)[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

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 :param t: time-serie to be synchronized :param tref: time-serie of the reference :param sr: sampling rate of the slave probe :return: 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