cuewire.huepfburg

Rocking-platform rig extension of ArduinoSerial.

Functions

parse_exp_parameters(line)

Parse a ``>>a,b,c,...<< `` parameter frame into ExpParameters.

Classes

ExpParameters(pre_exp_duration_s, ...)

Structured snapshot of the firmware's experiment parameters.

HuepfburgRig(port[, baud, timeout, ...])

ArduinoSerial subclass speaking the Hüpfburg vocabulary.

class cuewire.huepfburg.ExpParameters(pre_exp_duration_s: float, exp_duration_s: float, led_pattern: LedPattern, led_mode: LedMode, led_free_period_s: float, led_sin_period_s: float, led_hall_factor: str)[source]

Bases: object

Structured snapshot of the firmware’s experiment parameters.

exp_duration_s: float
led_free_period_s: float
led_hall_factor: str
led_mode: LedMode
property led_mode_label: str
led_pattern: LedPattern
property led_pattern_label: str
led_sin_period_s: float
pre_exp_duration_s: float
class cuewire.huepfburg.HuepfburgRig(port: str | _SerialLike, baud: int = 9600, timeout: float = 0.1, comm_test_on_open: bool = True)[source]

Bases: ArduinoSerial

ArduinoSerial subclass speaking the Hüpfburg vocabulary.

abort_experiment(settle_s: float = 0.0) None[source]

Cancel an in-progress experiment.

bottom_strip(on: bool, settle_s: float = 0.0) None[source]

Switch the bottom LED strip on or off (kept on during “dark” trials).

get_exp_parameters() ExpParameters[source]

Ask the firmware for its current parameters and parse the frame.

set_exp_duration(seconds: float, settle_s: float = 0.0) None[source]

Set the total experiment duration, in seconds.

set_led_mode(mode: LedMode, settle_s: float = 0.0) None[source]

Set the LED motion mode.

set_led_pattern(pattern: LedPattern, settle_s: float = 0.0) None[source]

Set the LED illumination pattern.

set_led_period(period_s: float, settle_s: float = 0.0) None[source]

Set the free-running LED period, in seconds.

set_led_sin_factor(factor: int, settle_s: float = 0.0) None[source]

Set the integer LED sine factor.

set_led_sin_period(period_s: float, settle_s: float = 0.0) None[source]

Set the LED sine period, in seconds.

set_pre_exp_duration(seconds: float, settle_s: float = 0.0) None[source]

Set the pre-experiment acclimatisation duration, in seconds.

start_cameras(settle_s: float = 0.0) None[source]

Trigger camera recording.

start_experiment(settle_s: float = 0.0) None[source]

Tell the Arduino to begin the experiment timer.

stop_cameras(settle_s: float = 0.0) None[source]

Stop camera recording.

cuewire.huepfburg.parse_exp_parameters(line: str) ExpParameters[source]

Parse a ``>>a,b,c,…<< `` parameter frame into ExpParameters.

Frame contents, in order:

pre_exp, exp, led_pattern, led_mode, led_free_period, led_sin_period, led_hall_factor.