free_water

Classes:

Free_Water([stage_block, current_trial, ...])

Randomly light up one of the ports, then dispense water when the subject pokes there

class Free_Water(stage_block=None, current_trial=0, reward=50, allow_repeat=False, **kwargs)[source]

Bases: autopilot.tasks.task.Task

Randomly light up one of the ports, then dispense water when the subject pokes there

Two stages:

  • waiting for response, and

  • reporting the response afterwards

Variables
  • target ('L', 'C', 'R') – The correct port

  • trial_counter (itertools.count) – Counts trials starting from current_trial specified as argument

  • triggers (dict) – Dictionary mapping triggered pins to callable methods.

  • num_stages (int) – number of stages in task (2)

  • stages (itertools.cycle) – iterator to cycle indefinitely through task stages.

Parameters
  • stage_block (threading.Event) – used to signal to the carrying Pilot that the current trial stage is over

  • current_trial (int) – If not zero, initial number of trial_counter

  • reward (int) – ms to open solenoids

  • allow_repeat (bool) – Whether the correct port is allowed to repeat between trials

  • **kwargs

Attributes:

STAGE_NAMES

PARAMS

DATA

HARDWARE

PLOT

Classes:

TrialData()

Methods:

water(*args, **kwargs)

First stage of task - open a port if it's poked.

response()

Just have to alert the Terminal that the current trial has ended and turn off any lights.

end()

When shutting down, release all hardware objects and turn LEDs off.

STAGE_NAMES = ['water', 'response']
PARAMS = OrderedDict([   ('reward', {'tag': 'Reward Duration (ms)', 'type': 'int'}),                 (   'allow_repeat',                     {'tag': 'Allow Repeated Ports?', 'type': 'bool'})])
DATA = {   'target': {'plot': 'target', 'type': 'S1'},     'timestamp': {'type': 'S26'},     'trial_num': {'type': 'i32'}}
class TrialData

Bases: tables.description.IsDescription

Attributes:

columns

columns = {   'target': StringCol(itemsize=1, shape=(), dflt=b'', pos=None),     'timestamp': StringCol(itemsize=26, shape=(), dflt=b'', pos=None),     'trial_num': Int32Col(shape=(), dflt=0, pos=None)}
HARDWARE = {   'LEDS': {   'C': <class 'autopilot.hardware.gpio.LED_RGB'>,                 'L': <class 'autopilot.hardware.gpio.LED_RGB'>,                 'R': <class 'autopilot.hardware.gpio.LED_RGB'>},     'POKES': {   'C': <class 'autopilot.hardware.gpio.Digital_In'>,                  'L': <class 'autopilot.hardware.gpio.Digital_In'>,                  'R': <class 'autopilot.hardware.gpio.Digital_In'>},     'PORTS': {   'C': <class 'autopilot.hardware.gpio.Solenoid'>,                  'L': <class 'autopilot.hardware.gpio.Solenoid'>,                  'R': <class 'autopilot.hardware.gpio.Solenoid'>}}
PLOT = {'data': {'target': 'point'}}
water(*args, **kwargs)[source]

First stage of task - open a port if it’s poked.

Returns

Data dictionary containing:

'target': ('L', 'C', 'R') - correct response
'timestamp': isoformatted timestamp
'trial_num': number of current trial

Return type

dict

response()[source]

Just have to alert the Terminal that the current trial has ended and turn off any lights.

end()[source]

When shutting down, release all hardware objects and turn LEDs off.