stimpyp.camlog.LabCamlog#

final class stimpyp.camlog.LabCamlog#

Bases: AbstractCamlog

Labcam log

__init__(root, frame_id, timestamp, comment_info, time_info=None)#
Parameters:
  • root (Path)

  • frame_id (ndarray)

  • timestamp (ndarray)

  • comment_info (dict[str, Any])

  • time_info (list[str] | None)

Methods

__init__(root, frame_id, timestamp, comment_info)

get_camera_time(log[, cam_name, interpolate])

Interpolate camera log frames to those recorded by pyvstim.

load(root[, suffix])

load/parse the camera log file

to_polars()

convert frame_id and timestamp to polars DataFrame

Attributes

nframes

number of frames

root

tif root path

frame_id

frame index

timestamp

time stamp of each frame

comment_info

# information

time_info

i.e., # [21-03-02 15:23:08].

__init__(root, frame_id, timestamp, comment_info, time_info=None)#
Parameters:
  • root (Path)

  • frame_id (ndarray)

  • timestamp (ndarray)

  • comment_info (dict[str, Any])

  • time_info (list[str] | None)

property nframes: int#

number of frames

to_polars()#

convert frame_id and timestamp to polars DataFrame

Return type:

DataFrame

root: Path#

tif root path

frame_id: ndarray#

frame index

timestamp: ndarray#

time stamp of each frame

comment_info: dict[str, Any]#

# information

time_info: list[str]#

i.e., # [21-03-02 15:23:08]. Note that time could be duplicated

classmethod load(root, suffix='.camlog')#

load/parse the camera log file

Parameters:
  • root (Path | str) – directory with camera log file

  • suffix (str) – file suffix

Returns:

AbstractCamlog

Return type:

Self

get_camera_time(log, cam_name='1P_cam', interpolate=True)#

Interpolate camera log frames to those recorded by pyvstim.

Parameters:
  • log (AbstractLog) – AbstractLog

  • cam_name (Literal['facecam', 'eyecam', '1P_cam']) – camera name

  • interpolate (bool) – Whether do the interpolation according to the number of log event

Returns:

1D camera time array in sec

Return type:

ndarray