Morelia.Parameters package

Submodules

Morelia.Parameters.Params8206HR module

class Morelia.Parameters.Params8206HR.Params8206HR(port: str, sampleRate: int, preamplifierGain: int, lowPass: tuple[int], checkForValidParams: bool = True)

Bases: Params

Container class that stores parameters for an 8206-HR POD device.

port

Name of the COM port.

Type:

str

sampleRate

Sample rate in 100-2000 Hz range.

Type:

int

preamplifierGain

Preamplifier gain. Should be 10x or 100x.

Type:

int

lowPass

Low-pass for EEG/EMG in 11-500 Hz range.

Type:

tuple[int]

EEG1() int

Gets the filter value of EEG1 in Hz from the low-pass.

Returns:

EEG1 low-pass filter in Hz.

Return type:

int

EEG2() int

Gets the filter value of EEG2 in Hz from the low-pass.

Returns:

EEG2 low-pass filter in Hz.

Return type:

int

EEG3_EMG() int

Gets the filter value of EEG3/EMG in Hz from the low-pass.

Returns:

EEG3/EMG low-pass filter in Hz.

Return type:

int

GetInit() str

Builds a string that represents the Params_8206HR constructor with the arguments set to the values of this class instance.

Returns:

String that represents the Params_8206HR constructor.

Return type:

str

_CheckParams() None

Throws an exception if Params_8206HR instance variable is an invalid value.

Raises:
  • Exception – Sample rate must be between 100-2000 Hz.

  • Exception – Preamplidier gain must be 10x or 100x.

  • Exception – Low-pass EEG/EMG must be between 11-500 Hz.

lowPassLabels: tuple[str] = ('EEG1', 'EEG2', 'EEG3/EMG')

Tuple describing the items in the lowPass.

Morelia.Parameters.Params8229 module

class Morelia.Parameters.Params8229.Params8229(port: str, systemID: int, motorDirection: bool, motorSpeed: int, randomReverse: bool, mode: int, reverseBaseTime: int | None = None, reverseVarTime: int | None = None, schedule: dict[str, tuple[bool]] | None = None, checkForValidParams: bool = True)

Bases: Params

Container class that stores parameters for an 8229 POD device.

port

Name of the COM port.

Type:

str

systemID

ID of this 8229 POD system. Must be a positive integer.

Type:

int

motorDirection

False for clockwise and true for counterclockwise.

Type:

bool

motorSpeed

Motor speed as a percentage 0-100%.

Type:

int

randomReverse

True to enable random reverse, False otherwise. The random reverse time will be reverseBaseTime + random value in reverseVarTime range.

Type:

bool

reverseBaseTime

Base time for a random reverse in seconds. Must be a positive integer.

Type:

int

reverseVarTime

Variable time for a random reverse in seconds. Must be a positive integer.

Type:

int

mode

System mode; 0 = Manual, 1 = PC Control, and 2 = Internal Schedule.

Type:

int

schedule

Schedule for a week. The keys are the weekdays (Sunday-Saturday). The values are a tuple of 24 bools that are either 1 for motor on or 0 for motor off

Type:

dict[str, tuple[int]]

static BuildEmptySchedule() dict[str, tuple[bool]]

Creates a schedule where the motor is off for all hours of every day.

Returns:

Dictionary of the empty schedule. The keys are the days of the week. The values are tuples of 24 zeros.

Return type:

dict[str, tuple[bool]]

GetInit() str

Builds a string that represents the Params_8229 constructor with the arguments set to the values of this class instance.

Returns:

String that represents the Params_Interface constructor.

Return type:

str

_CheckParams() None

Throws an exception if Params_8229 instance variable is an invalid value.

Raises:
  • Exception – The system ID must be a positive integer.

  • Exception – The motor speed must be between 0-100%.

  • Exception – The reverse base time (sec) must be a positive integer.

  • Exception – The reverse variable time (sec) must be a positive integer.

  • Exception – The mode must be 0, 1, or 2.

  • Exception – The schedule must have exactly (‘Sunday’,’Monday’,’Tuesday’, ‘Wednesday’,’Thursday’,’Friday’,’Saturday’) as keys.

  • Exception – There must be 24 items in the schedule for each day.

hoursPerDay: int = 24

Integer storing the number of hours in a day.

week: tuple[str] = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')

Tuple containing strings of the 7 days of the week.

Morelia.Parameters.Params8274D module

class Morelia.Parameters.Params8274D.Params8274D(port: str, localScan: int, sampleRate: int, period: int, checkForValidParams: bool = True)

Bases: Params

GetInit() str

Builds a string that represents the Params_8274D constructor with the arguments set to the values of this class instance.

Returns:

String that represents the Params_8274D constructor.

Return type:

str

_CheckParams() None

Throws an exception if Params_8206HR instance variable is an invalid value.

Raises:
  • Exception – Sample rate must be between 100-2000 Hz.

  • Exception – Preamplidier gain must be 10x or 100x.

  • Exception – Low-pass EEG/EMG must be between 11-500 Hz.

Morelia.Parameters.Params8401HR module

class Morelia.Parameters.Params8401HR.Params8401HR(port: str, preampDevice: str, sampleRate: int, muxMode: bool, preampGain: tuple[int], ssGain: tuple[int], highPass: tuple[float], lowPass: tuple[int], bias: tuple[float], dcMode: tuple[str], checkForValidParams: bool = True)

Bases: Params

Container class that stores parameters for an 8401-HR POD device.

port

Name of the COM port.

Type:

str

preampDevice

Name of the mouse/rat preamplifier device.

Type:

str

sampleRate

Sample rate (2000-20000 Hz).

Type:

int

muxMode

Using mux mode when True, false otherwise.

Type:

bool

preampGain

Preamplifier gain (1, 10, or 100) for all channels.

Type:

tuple[int]

ssGain

Second stage gain (1 or 5) for all channels.

Type:

tuple[int]

highPass

High-pass filter (0, 0.5, 1, or 10 Hz) for all channels.

Type:

tuple[float]

lowPass

Low-pass filter (21-15000 Hz) for all channels.

Type:

tuple[int]

bias

Bias voltage (+/- 2.048 V) for all channels.

Type:

tuple[float]

dcMode

DC mode (VBIAS or AGND) for all channels.

Type:

tuple[str]

GetInit() str

Builds a string that represents the Params_8401HR constructor with the arguments set to the values of this class instance.

Returns:

String that represents the Params_8401HR constructor.

Return type:

str

_CheckParams() None

Throws an exception if Params_8401HR instance variable is an invalid value.

Raises:
  • Exception – Mouse/rat preamplifier does not exist.

  • Exception – Sample rate must be between 2000-20000 Hz.

  • Exception – EEG/EMG preamplifier gain must be 10x or 100x. For biosensors, the preampGain is None.

  • Exception – The second stage gain must be 1x or 5x; set gain to None if no-connect.

  • Exception – The high-pass filter must be 0.5, 1, or 10 Hz. If the channel is DC, input 0.

  • Exception – The low-pass filter must be between 21-15000 Hz.

  • Exception – The bias voltage must be +/- 2.048 V.

  • Exception – The DC mode must be VBIAS or AGND.

channelLabels: tuple[str] = ('A', 'B', 'C', 'D')

Tuple listing the four channel characters in order.

Morelia.Parameters.Params8480SC module

class Morelia.Parameters.Params8480SC.Params8480SC(port: str, stimulus=tuple[int], preamp=<class 'int'>, ledCurrent=tuple[int], ttlPullups=<class 'int'>, estimCurrent=tuple[int], syncConfig=<class 'int'>, ttlSetup=tuple[int], checkForValidParams: bool = True)

Bases: Params

Container class that stores parameters for an 8401-HR POD device.

port

Name of the COM port.

Type:

str

stimulus

Stimulus configuration on selected channel.

Type:

tuple[int]

preamp

Preamp value (0-1023).

Type:

int

ledCurrent

Led-Current (0-600 mA) for both channels.

Type:

tuple[int]

ttlPUllups

TTL Pullups disabled for value 0, pullups enabled for values that are non-zero.

Type:

int

estimCurrent

Estim-Current (0-100 %) for both channels.

Type:

tuple[int]

syncConfig

Sets Sync-Config byte.

Type:

int

ttlSetup

TTL-Setup for selected channel.

Type:

tuple[int]

GetInit() str

Builds a string that represents the Params_8480SC constructor with the arguments set to the values of this class instance.

Returns:

String that represents the Params_8480SC constructor.

Return type:

str

_CheckParams() None

Throws an exception if Params_8206HR member variable is an invalid value.

Raises:
  • Exception – The preamp must be between 0-1023.

  • Exception – Led-Curent must be between 0-600.

  • Exception – Estim-Current must be between 0-100.

estimCurrent_CH0() int

Gets the estimCurrent value for Channel 0.

Returns:

Channel 0 estimCurrent in percentage.

Return type:

int

estimCurrent_CH1() int

Gets the estimCurrent value for Channel 1.

Returns:

Channel 1 estimCurrent in percentage.

Return type:

int

ledCurrent_CH0() int

Gets the ledCurrent value for Channel 0.

Returns:

Channel 0 ledCurrent in mA.

Return type:

int

ledCurrent_CH1() int

Gets the ledCurrent value for Channel 1.

Returns:

Channel 1 ledCurrent in mA.

Return type:

int

Morelia.Parameters.ParamsBasic module

class Morelia.Parameters.ParamsBasic.Params(port: str, checkForValidParams: bool = True)

Bases: object

Interface for a container class that stores parameters for a POD device.

port

Name of the COM port.

Type:

str

GetInit() str

Builds a string that represents the Params constructor with the arguments set to the values of this class instance.

Returns:

String that represents the Params constructor.

Return type:

str

_CheckParams() None

Throws an exception if Params instance variable is an invalid value.

Raises:

Exception – The port name must begin with COM.

static _FixTypeInTuple(arr: tuple, itemType: type) tuple['type']

Retypes each item of the arr arguemnt to itemType.

Parameters:
  • arr (tuple) – Tuple of items to be re-typed.

  • itemType (type) – Type to be casted to each tuple item.

Returns:

Tuple with values of all itemType types.

Return type:

tuple[type]

Module contents