ibllib.io.extractors.training_wheel

Training wheel extractor from Pybpod output.

ibllib.io.extractors.training_wheel.check_alf_folder(session_path)

Check if alf folder exists, creates it if it doesn’t.

Parameters:session_path (str) – absolute path of session folder
ibllib.io.extractors.training_wheel.get_velocity(session_path, save=False, data_wheel=None)

Compute velocity from non-uniformly acquired positions and timestamps. Optional: save _ibl_trials.velocity.npy

Uses signed_contrast to create left and right contrast vectors.

Parameters:
  • session_path (str) – absolute path of session folder
  • save (bool, optional) – wether to save the corresponding alf file to the alf folder, defaults to False
Returns:

numpy.ndarray

Return type:

dtype(‘float64’)

ibllib.io.extractors.training_wheel.get_wheel_data(session_path, bp_data=None, save=False, display=False)
Get wheel data from raw files and converts positions into radians mathematical convention
(anti-clockwise = +) and timestamps into seconds relative to Bpod clock.

Optional: saves _ibl_wheel.times.npy and _ibl_wheel.position.npy

Times: Gets Rotary Encoder timestamps (us) for each position and converts to times. Synchronize with Bpod and outputs

Positions: Radians mathematical convention

Parameters:
  • session_path (str) – absolute path of session folder
  • data (dict, optional) – dictionary containing the contents pybppod jsonable file read with raw.load_data
  • save (bool, optional) – wether to save the corresponding alf file to the alf folder, defaults to False
Returns:

Numpy structured array.

Return type:

numpy.ndarray