stimpyp.base.AbstractStimlog#
- class stimpyp.base.AbstractStimlog#
Bases:
Generic[R]ABC for stimulation logging. i.e., .log or .stimlog
Dimension parameters:
N = number of visual stimulation (on-off pairs) = (T * S)
T = number of trials
S = number of Stim Type
P = number of acquisition sample pulse
- __init__(riglog, file_path, reset_mapping=None)#
- Parameters:
riglog (R) –
Baselogfile_path (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader | None) – filepath of stimlog. could be None if shared log (pyvstim case)
reset_mapping (dict[int, list[str]] | None) – Customized mapping for
reset()- key: corresponding tolog_header- value: list of field, should be the same name as class annotations
Methods
__init__(riglog, file_path[, reset_mapping])Log dict dataframe.
Photo Indicator dataframe.
State Machine dataframe
get_stim_pattern(**kwargs)get pattern foreach stimulation
get_visual_stim_dataframe(**kwargs)Visual presentation dataframe
get the session:SessionInfo dictionary (experimental and user-specific)
stim_square_pulse_event([sampling_rate])Get the stimulation on-off square pulse 0,1 consecutive event
Attributes
config for non-header information
experimental end time (in sec, synced to riglog time with diode offset)
experimental start time (in sec, synced to riglog time with diode offset)
code:log header dictionary
code:log name dictionary
Number of cycle for each trial
Dataframe with columns:
the last stimulation end time (in sec, synced to riglog time with diode offset)
the first stimulation start time (in sec, synced to riglog time with diode offset)
stimulation time segment (on-off) in sec (N, 2)
time (in sec) to sync stimlog time to riglog
acquisition time in sec.
stimulation index.
trial index.
stimulus contrast.
stimulation frame index, recount every N.
direction in deg.
spatial frequency in cyc/deg.
temporal frequency in hz.
stimulus phase for each N.
object center position X.
object center position Y.
object size width.
object size height.
TODO.
whether do the interpolate, Array[bool, P]
TODO.
object pattern.
- config = {}#
config for non-header information
- log_info = {}#
code:log name dictionary
- log_header = {}#
code:log header dictionary
- time: ndarray#
acquisition time in sec. Array[float, P]
- stim_index: ndarray#
stimulation index. Array[int, P]
- trial_index: ndarray#
trial index. Array[int, P]
- contrast: ndarray#
stimulus contrast. Array[int, P]. value domain in (0,1)
- frame_index: ndarray#
stimulation frame index, recount every N. Array[int, P]
- ori: ndarray#
direction in deg. Array[float, P]
- sf: ndarray#
spatial frequency in cyc/deg. Array[float, P]
- tf: ndarray#
temporal frequency in hz. Array[float, P]
- phase: ndarray#
stimulus phase for each N. Array[float, P]
- pos_x: ndarray#
object center position X. Array[float, P]
- pos_y: ndarray#
object center position Y. Array[float, P]
- size_x: ndarray#
object size width. Array[int, P]
- size_y: ndarray#
object size height. Array[int, P]
- flick: ndarray#
TODO. Array[int, P]
- interpolate: ndarray#
whether do the interpolate, Array[bool, P]
- mask: ndarray#
TODO. Array[bool|None, P]
- pattern: ndarray#
object pattern. Array[str, P]
- __init__(riglog, file_path, reset_mapping=None)#
- Parameters:
riglog (R) –
Baselogfile_path (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader | None) – filepath of stimlog. could be None if shared log (pyvstim case)
reset_mapping (dict[int, list[str]] | None) – Customized mapping for
reset()- key: corresponding tolog_header- value: list of field, should be the same name as class annotations
- abstract get_visual_stim_dataframe(**kwargs)#
Visual presentation dataframe
- Return type:
DataFrame
- abstract get_state_machine_dataframe()#
State Machine dataframe
- Return type:
DataFrame
- get_photo_indicator_dataframe()#
Photo Indicator dataframe. Github version only
- Return type:
DataFrame
- get_log_dict_dataframe()#
Log dict dataframe. Github version only
- Return type:
DataFrame
- abstract property exp_start_time: float#
experimental start time (in sec, synced to riglog time with diode offset)
- abstract property exp_end_time: float#
experimental end time (in sec, synced to riglog time with diode offset)
- property stim_start_time: float#
the first stimulation start time (in sec, synced to riglog time with diode offset)
- property stim_end_time: float#
the last stimulation end time (in sec, synced to riglog time with diode offset)
- abstract property stimulus_segment: ndarray#
stimulation time segment (on-off) in sec (N, 2)
- stim_square_pulse_event(sampling_rate=30.0)#
Get the stimulation on-off square pulse 0,1 consecutive event
- Parameters:
sampling_rate (float) – sampling rate for the time domain interpolation
- Returns:
Stimulus rig event
- Return type:
- abstract session_trials()#
get the session:SessionInfo dictionary (experimental and user-specific)
- Return type:
dict[str, SessionInfo]
- abstract property time_offset: float | ndarray#
time (in sec) to sync stimlog time to riglog
- property n_cycles: list[int]#
Number of cycle for each trial
- abstract property profile_dataframe: DataFrame#
Dataframe with columns:
stim type index:
i_stimstrial index:
i_trials
- abstract get_stim_pattern(**kwargs)#
get pattern foreach stimulation
- Return type: