stimpyp.pyvstim.StimlogPyVStim#

final class stimpyp.pyvstim.StimlogPyVStim#

Bases: AbstractStimlog

class for handle the log file (stim event specific) for pyvstim version (vb lab legacy)

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)#
Parameters:
  • riglog (PyVlog) – Baselog

  • file_path – filepath of stimlog. could be None if shared log (pyvstim case)

  • reset_mapping – Customized mapping for reset() - key: corresponding to log_header - value: list of field, should be the same name as class annotations

Methods

__init__(riglog)

exp_end_time()

experimental end time (in sec, synced to riglog time with diode offset)

get_log_dict_dataframe()

Log dict dataframe.

get_photo_indicator_dataframe()

Photo Indicator dataframe.

get_state_machine_dataframe()

State Machine dataframe

get_stim_pattern()

get pattern foreach stimulation

get_visual_stim_dataframe(**kwargs)

Visual presentation dataframe

plot_stim_animation()

session_trials()

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

avg_refresh_rate

in Hz

config

config for non-header information

exp_start_time

experimental start time (in sec, synced to riglog time with diode offset)

log_header

code:log header dictionary

log_info

code:log name dictionary

n_cycles

Number of cycle for each trial

profile_dataframe

Dataframe with columns:

stim_end_time

the last stimulation end time (in sec, synced to riglog time with diode offset)

stim_loc

stim_start_time

the first stimulation start time (in sec, synced to riglog time with diode offset)

stimulus_segment

stimulation time segment (on-off) in sec (N, 2)

time_offset

directly used interpolation using diode signal already

frame

TBD.

blank

If it is background only.

disp_x

TBD.

disp_y

TBD.

photo_state

photo diode on-off.

v_duino_time

extrapolate duinotime from screen indicator.

time

acquisition time in sec.

stim_index

stimulation index.

trial_index

trial index.

contrast

stimulus contrast.

frame_index

stimulation frame index, recount every N.

ori

direction in deg.

sf

spatial frequency in cyc/deg.

tf

temporal frequency in hz.

phase

stimulus phase for each N.

pos_x

object center position X.

pos_y

object center position Y.

size_x

object size width.

size_y

object size height.

flick

TODO.

interpolate

whether do the interpolate, Array[bool, P]

mask

TODO.

pattern

object pattern.

frame: ndarray#

TBD. value domain (-2, -1, 0, 1) ? Array[int, P]

blank: ndarray#

If it is background only. 0: stim display, 1: no stim. Array[int, P]

disp_x: ndarray#

TBD. display pos x ? Array[int, P]

disp_y: ndarray#

TBD. display pos y ? Array[int, P]

photo_state: ndarray#

photo diode on-off. Array[int, P]. value domain in (0,1)

v_duino_time: ndarray#

extrapolate duinotime from screen indicator. sync arduino time in sec. Array[float, P]

__init__(riglog)#
Parameters:
  • riglog (PyVlog) – Baselog

  • file_path – filepath of stimlog. could be None if shared log (pyvstim case)

  • reset_mapping – Customized mapping for reset() - key: corresponding to log_header - value: list of field, should be the same name as class annotations

config: Final[dict[str, Any]] = {}#

config for non-header information

log_info: Final[dict[int, str]] = {}#

code:log name dictionary

log_header: Final[dict[int, list[str]]] = {}#

code:log header dictionary

get_visual_stim_dataframe(**kwargs)#

Visual presentation dataframe

Return type:

DataFrame

get_state_machine_dataframe()#

State Machine dataframe

property exp_start_time: float#

experimental start time (in sec, synced to riglog time with diode offset)

property stimulus_segment: ndarray#

stimulation time segment (on-off) in sec (N, 2)

session_trials()#

get the session:SessionInfo dictionary (experimental and user-specific)

Return type:

dict[str, SessionInfo]

property time_offset: float#

directly used interpolation using diode signal already

get_stim_pattern()#

get pattern foreach stimulation

Return type:

GratingPattern

exp_end_time()#

experimental end time (in sec, synced to riglog time with diode offset)

Return type:

float

property stim_loc: ndarray#
property avg_refresh_rate: float#

in Hz

plot_stim_animation()#
property profile_dataframe: DataFrame#

Dataframe with columns:

  • stim type index: i_stims

  • trial index: i_trials

property n_cycles: list[int]#

Number of cycle for each trial

get_log_dict_dataframe()#

Log dict dataframe. Github version only

Return type:

DataFrame

get_photo_indicator_dataframe()#

Photo Indicator dataframe. Github version only

Return type:

DataFrame

property stim_end_time: float#

the last stimulation end time (in sec, synced to riglog time with diode offset)

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:

RigEvent

property stim_start_time: float#

the first stimulation start time (in sec, synced to riglog time with diode offset)

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]