Alignment API
Behaviour alignment submodule.
align_cmd(path, session_start, behaviour_json, behaviour_id, max_offset)
Write behaviour-aligned frame timestamps to a preprocessed or registered HDF5 recording.
Source code in src/mesoscopy/align/__init__.py
align_recording(h5_path, session_start, behaviour_session, max_offset_s=DEFAULT_MAX_OFFSET_S)
Write /timestamps_aligned to an HDF5 recording, as seconds from the behaviour session start.
Parameters:
-
h5_path(str) –Path to the HDF5 recording holding an ISO 8601
/timestampsdataset. -
session_start(str | datetime) –Behaviour session start time, ISO 8601.
-
behaviour_session(str) –Behaviour session identifier.
-
max_offset_s(float, default:DEFAULT_MAX_OFFSET_S) –Largest allowed absolute offset of the first frame from the session start, in seconds. Defaults to 600.
Returns:
-
tuple[float, int]–tuple[float, int]: Offset of the first frame from the session start in seconds, and number of frames.
Raises:
-
ValueError–If the offset exceeds
max_offset_s. Nothing is written in that case.
Source code in src/mesoscopy/align/__init__.py
read_session_start(behaviour_json_path)
Read the session start time from a visiomode behaviour session JSON file.
Parameters:
-
behaviour_json_path(str) –Path to the behaviour session JSON file.
Returns:
-
str(str) –The file's
timestampvalue, ISO 8601.