ibllib.io.extractors.ephys_fpga

class ibllib.io.extractors.ephys_fpga.CameraTimestamps(session_path=None)
class ibllib.io.extractors.ephys_fpga.FpgaTrials(session_path=None)
class ibllib.io.extractors.ephys_fpga.ProbaContrasts(session_path=None)

Bpod pre-generated values for probabilityLeft, contrastLR, phase, quiescence

ibllib.io.extractors.ephys_fpga.bpod_fpga_sync(bpod_intervals=None, ephys_intervals=None, iti_duration=None)

Computes synchronization function from bpod to fpga :param bpod_intervals :param ephys_intervals :return: interpolation function

ibllib.io.extractors.ephys_fpga.extract_all(session_path, save=True, bin_exists=False)
For the IBL ephys task, reads ephys binary file and extract:
  • sync
  • wheel
  • behaviour
  • video time stamps
Parameters:
  • session_path – ‘/path/to/subject/yyyy-mm-dd/001’
  • save – Bool, defaults to False
  • version – bpod version, defaults to None
Returns:

outputs, files

ibllib.io.extractors.ephys_fpga.extract_behaviour_sync(sync, chmap=None, display=False, tmax=inf)

Extract wheel positions and times from sync fronts dictionary

Parameters:
  • sync – dictionary ‘times’, ‘polarities’ of fronts detected on sync trace for all 16 chans
  • chmap – dictionary containing channel index. Default to constant. chmap = {‘bpod’: 7, ‘frame2ttl’: 12, ‘audio’: 15}
  • display – bool or matplotlib axes: show the full session sync pulses display

defaults to False :return: trials dictionary

ibllib.io.extractors.ephys_fpga.extract_camera_sync(sync, chmap=None)

Extract camera timestamps from the sync matrix

Parameters:
  • sync – dictionary ‘times’, ‘polarities’ of fronts detected on sync trace
  • chmap – dictionary containing channel indices. Default to constant.
Returns:

dictionary containing camera timestamps

ibllib.io.extractors.ephys_fpga.extract_sync(session_path, overwrite=False, ephys_files=None)

Reads ephys binary file (s) and extract sync within the binary file folder Assumes ephys data is within a raw_ephys_data folder

Parameters:
  • session_path – ‘/path/to/subject/yyyy-mm-dd/001’
  • overwrite – Bool on re-extraction, forces overwrite instead of loading existing files
Returns:

list of sync dictionaries

ibllib.io.extractors.ephys_fpga.extract_wheel_sync(sync, chmap=None)

Extract wheel positions and times from sync fronts dictionary for all 16 chans Output position is in radians, mathematical convention :param sync: dictionary ‘times’, ‘polarities’ of fronts detected on sync trace :param chmap: dictionary containing channel indices. Default to constant.

chmap = {‘rotary_encoder_0’: 13, ‘rotary_encoder_1’: 14}
Returns:timestamps (np.array)
Returns:positions (np.array)
ibllib.io.extractors.ephys_fpga.get_ibl_sync_map(ef, version)

Gets default channel map for the version/binary file type combination :param ef: ibllib.io.spikeglx.glob_ephys_file dictionary with field ‘ap’ or ‘nidq’ :return: channel map dictionary