stimpyp.stimpy_core.RiglogData#

final class stimpyp.stimpy_core.RiglogData#

Bases: AbstractLog

class for handle the riglog file for stimpy bitbucket/github version (mainly tested in the commits derived from master branch)

__init__(*args, **kwargs)#
Parameters:
  • root_path – log file path or log directory

  • log_suffix – log file suffix

  • diode_offset – whether do the diode offset

  • reset_mapping – Customized mapping

Methods

__init__(*args, **kwargs)

get_encoder_factor([count, length])

Get a factor for mapping encoder to actual length in cm

get_preferences()

get preferences file

get_protocol()

get protocol (TypeVar P)

get_pygame_stimlog(**kwargs)

get_stimlog([csv_output])

Initialize the stimlog instance

get_stimulus_type()

get stimulus type name based on protocol

get_worldmap()

unwarp_circular_position([neg_threshold])

unwarp circular position to cumulative displacement

with_sessions(session)

Truncate the instance dat with the given session(s)

Attributes

act_event

todo

camera_event

camera event.

exp_end_time

experimental end time (in sec)

exp_start_time

experimental start time (in sec)

imaging_event

imaging rig event.

lap_event

lap rig event.

lick_event

lick rig event.

opto_event

todo

position_event

position rig event.

pref_file

preferences file path

prot_file

protocol file path

reward_event

reward rig event.

screen_event

screen rig event.

stimlog_file

total_duration

experimental duration (in sec)

worldmap_file

log_config

config dict for the log file

__init__(*args, **kwargs)#
Parameters:
  • root_path – log file path or log directory

  • log_suffix – log file suffix

  • diode_offset – whether do the diode offset

  • reset_mapping – Customized mapping

with_sessions(session)#

Truncate the instance dat with the given session(s)

Parameters:

session (str | tuple[str, ...]) – session name(s)

Returns:

Return type:

Self

property stimlog_file: Path#
property worldmap_file: Path#
get_stimlog(csv_output=True)#

Initialize the stimlog instance

Parameters:

csv_output (bool) – if stimlog is exported to separated csv file

Return type:

AbstractStimlog

get_pygame_stimlog(**kwargs)#
Return type:

PyGameLinearStimlog

get_worldmap()#
Return type:

WorldMapInfo

get_protocol()#

get protocol (TypeVar P)

Returns:

AbstractStimProtocol()

Return type:

StimpyProtocol

class CameraEvent#

Bases: object

camera event

__init__(rig)#

:param rig:Baselog

Parameters:

rig (R)

camera: dict[Literal['facecam', 'eyecam', '1P_cam'], int]#
property act_event: RigEvent#

todo

property camera_event: CameraEvent#

camera event. including {‘facecam’, ‘eyecam’, ‘1P_cam’} implemented by __getitem__()

property exp_end_time: float#

experimental end time (in sec)

property exp_start_time: float#

experimental start time (in sec)

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]

get_preferences()#

get preferences file

Return type:

PreferenceDict

get_stimulus_type()#

get stimulus type name based on protocol

Return type:

str

property imaging_event: RigEvent#

imaging rig event. i.e., 2photon pulse

property lap_event: RigEvent#

lap rig event. i.e., optic sensing for the reflective taps

property lick_event: RigEvent#

lick rig event. i.e., lick meter pulse

property opto_event: RigEvent#

todo

property position_event: RigEvent#

position rig event. i.e., encoder pulse

property pref_file: Path#

preferences file path

property prot_file: Path#

protocol file path

property reward_event: RigEvent#

reward rig event. i.e., reward given pulse from lick meter

property screen_event: RigEvent#

screen rig event. i.e., diode pulse

property total_duration: float#

experimental duration (in sec)

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

log_config: RigConfig#

config dict for the log file