stimpyp.base.AbstractLog#
- class stimpyp.base.AbstractLog#
Bases:
Generic[S,P]ABC class for different stimpy/pyvstim log files. i.e., .log, .riglog
- __init__(root_path, log_suffix, diode_offset=True, reset_mapping=None)#
- Parameters:
root_path (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader) – log file path or log directory
log_suffix (Literal['.log', '.riglog']) – log file suffix
diode_offset (bool) – whether do the diode offset
reset_mapping (dict[int, list[str]] | None) – Customized mapping
Methods
__init__(root_path, log_suffix[, ...])get_encoder_factor([count, length])Get a factor for mapping encoder to actual length in cm
get preferences file
get protocol (TypeVar
P)get_stimlog(*args)get stimlog (TypeVar
S)get stimulus type name based on protocol
unwarp_circular_position([neg_threshold])unwarp circular position to cumulative displacement
Attributes
todo
camera event.
experimental end time (in sec)
experimental start time (in sec)
imaging rig event.
lap rig event.
lick rig event.
todo
position rig event.
preferences file path
protocol file path
reward rig event.
screen rig event.
experimental duration (in sec)
config dict for the log file
- __init__(root_path, log_suffix, diode_offset=True, reset_mapping=None)#
- Parameters:
root_path (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader) – log file path or log directory
log_suffix (Literal['.log', '.riglog']) – log file suffix
diode_offset (bool) – whether do the diode offset
reset_mapping (dict[int, list[str]] | None) – Customized mapping
- property exp_start_time: float#
experimental start time (in sec)
- property exp_end_time: float#
experimental end time (in sec)
- property total_duration: float#
experimental duration (in sec)
- class CameraEvent#
Bases:
objectcamera event
- __init__(rig)#
:param rig:
Baselog- Parameters:
rig (R)
- camera: dict[Literal['facecam', 'eyecam', '1P_cam'], int]#
- property camera_event: CameraEvent#
camera event. including {‘facecam’, ‘eyecam’, ‘1P_cam’} implemented by __getitem__()
- property prot_file: Path#
protocol file path
- abstract get_protocol()#
get protocol (TypeVar
P)- Returns:
- Return type:
P
- get_stimulus_type()#
get stimulus type name based on protocol
- Return type:
str
- property pref_file: Path#
preferences file path
- get_preferences()#
get preferences file
- Return type:
- abstract get_stimlog(*args)#
get stimlog (TypeVar
S)- Returns:
- Return type:
S
- get_encoder_factor(count=1, length=150)#
Get a factor for mapping encoder to actual length in cm
- Parameters:
count (int) – number of photosensing for each trial
length (float) – length in cm for each trial
- Returns:
- Return type:
tuple[float, ndarray]
- unwarp_circular_position(neg_threshold=200)#
unwarp circular position to cumulative displacement
- Parameters:
neg_threshold (float) – a negative jump larger in magnitude than this is considered a wrap-around
- Return type:
ndarray