ibllib.io.extractors.ephys_fpga

ibllib.io.extractors.ephys_fpga.align_with_bpod(session_path)

Reads in trials.intervals ALF dataset from bpod and fpga. Asserts consistency between datasets and compute the median time difference

Parameters:session_path
Returns:dt: median time difference of trial start times (fpga - bpod)
ibllib.io.extractors.ephys_fpga.extract_all(session_path, save=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:

None

ibllib.io.extractors.ephys_fpga.extract_behaviour_sync(sync, output_path=None, save=False, chmap=None)

Extract wheel positions and times from sync fronts dictionary

Parameters:
  • sync – dictionary ‘times’, ‘polarities’ of fronts detected on sync trace for all 16 chans
  • output_path – where to save the data
  • save – True/False
  • chmap – dictionary containing channel index. Default to constant. chmap = {‘bpod’: 7, ‘frame2ttl’: 12, ‘audio’: 15}
Returns:

trials dictionary

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

Extract camera timestamps from the sync matrix

Parameters:
  • sync – dictionary ‘times’, ‘polarities’ of fronts detected on sync trace
  • output_path – where to save the data
  • save – True/False
  • chmap – dictionary containing channel indices. Default to constant.
Returns:

dictionary containing camera timestamps

ibllib.io.extractors.ephys_fpga.extract_sync(session_path, save=False, force=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’
  • save – Bool, defaults to False
  • force – Bool on re-extraction, forces overwrite instead of loading existing sync files
Returns:

list of sync dictionaries

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

Extract wheel positions and times from sync fronts dictionary for all 16 chans

Parameters:
  • sync – dictionary ‘times’, ‘polarities’ of fronts detected on sync trace
  • output_path – where to save the data
  • save – True/False
  • chmap – dictionary containing channel indices. Default to constant. chmap = {‘rotary_encoder_0’: 13, ‘rotary_encoder_1’: 14}
Returns:

dictionary containing wheel data, ‘wheel_ts’, ‘re_ts’

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