ethoscope.interactors package¶
Module contents¶
ethoscope.stimulators.stimulators module¶
-
class
ethoscope.stimulators.stimulators.
BaseStimulator
(hardware_connection, date_range='')[source]¶ Bases:
ethoscope.utils.description.DescribedObject
Template class to interact with the tracked animal in a real-time feedback loop. Derived classes must have an attribute
_hardwareInterfaceClass
defining the class of theBaseInterface
object (not on object) that instances will share with one another. In addition, they must implement a_decide()
method.Parameters: - hardware_connection (
BaseInterface
) – The hardware interface to use. - date_range (str) – the start and stop date/time for the stimulator. Format described here
-
apply
()[source]¶ Apply this stimulator. This method will:
- check
_tracker
exists - decide (
_decide
) whether to interact - if 2. pass the interaction arguments to the hardware interface
Returns: whether a stimulator has worked, and a result dictionary - check
-
bind_tracker
(tracker)[source]¶ Link a tracker to this interactor
Parameters: tracker ( BaseTracker
) – a tracker object.
- hardware_connection (
-
class
ethoscope.stimulators.stimulators.
DefaultStimulator
(hardware_connection, date_range='')[source]¶ Bases:
ethoscope.stimulators.stimulators.BaseStimulator
Default interactor. Simply never interacts
Template class to interact with the tracked animal in a real-time feedback loop. Derived classes must have an attribute
_hardwareInterfaceClass
defining the class of theBaseInterface
object (not on object) that instances will share with one another. In addition, they must implement a_decide()
method.Parameters: - hardware_connection (
BaseInterface
) – The hardware interface to use. - date_range (str) –
the start and stop date/time for the stimulator. Format described here
- hardware_connection (
-
class
ethoscope.stimulators.stimulators.
HasInteractedVariable
[source]¶ Bases:
ethoscope.core.variables.BaseIntVariable
- Custom variable to save whether the stimulator has sent instruction to its hardware interface. 0 means
- no interaction. Any positive integer describes a different interaction.
-
functional_type
= 'interaction'¶
-
header_name
= 'has_interacted'¶
ethoscope.stimulators.sleep_depriver_stimulators module¶
any new class added here need to be added to web_utils/control_thread.py too
-
class
ethoscope.stimulators.sleep_depriver_stimulators.
ExperimentalSleepDepStimulator
(hardware_connection, velocity_threshold=0.006, date_range='')[source]¶ Bases:
ethoscope.stimulators.sleep_depriver_stimulators.SleepDepStimulator
A stimulator to control a sleep depriver module. This is an experimental version where each channel has a different inactivity_time_threshold.
Parameters: - hardware_connection (
SleepDepriverInterface
) – the sleep depriver module hardware interface - velocity_threshold (float) –
Returns: - hardware_connection (
-
class
ethoscope.stimulators.sleep_depriver_stimulators.
IsMovingStimulator
(hardware_connection=None, velocity_threshold=0.006, date_range='', **kwargs)[source]¶ Bases:
ethoscope.stimulators.stimulators.BaseStimulator
class implementing an stimulator that decides whether an animal has moved though does nothing accordingly. :param hardware_connection: a default hardware interface object :param velocity_threshold: Up to which velocity an animal is considered to be immobile :type velocity_threshold: float
-
class
ethoscope.stimulators.sleep_depriver_stimulators.
MiddleCrossingStimulator
(hardware_connection, p=1.0, date_range='')[source]¶ Bases:
ethoscope.stimulators.stimulators.BaseStimulator
Parameters: - hardware_connection (
SleepDepriverInterface
) – the sleep depriver module hardware interface - p (float) – the probability of disturbing the animal when a beam cross happens
Returns: - hardware_connection (
-
class
ethoscope.stimulators.sleep_depriver_stimulators.
OptomotorSleepDepriver
(hardware_connection, velocity_threshold=0.006, min_inactive_time=120, pulse_duration=1000, stimulus_type=2, date_range='')[source]¶ Bases:
ethoscope.stimulators.sleep_depriver_stimulators.SleepDepStimulator
-
class
ethoscope.stimulators.sleep_depriver_stimulators.
SleepDepStimulator
(hardware_connection, velocity_threshold=0.006, min_inactive_time=120, date_range='')[source]¶ Bases:
ethoscope.stimulators.sleep_depriver_stimulators.IsMovingStimulator
A stimulator to control a sleep depriver module.
Parameters: - hardware_connection (
SleepDepriverInterface
) – the sleep depriver module hardware interface - velocity_threshold (float) –
- min_inactive_time (float) – the minimal time without motion after which an animal should be disturbed (in seconds)
Returns: - hardware_connection (
-
class
ethoscope.stimulators.sleep_depriver_stimulators.
SleepDepStimulatorCR
(hardware_connection, velocity_threshold=0.006, min_inactive_time=120, date_range='')[source]¶ Bases:
ethoscope.stimulators.sleep_depriver_stimulators.SleepDepStimulator
A stimulator to control a sleep depriver module.
Parameters: - hardware_connection (
SleepDepriverInterface
) – the sleep depriver module hardware interface - velocity_threshold (float) –
- min_inactive_time (float) – the minimal time without motion after which an animal should be disturbed (in seconds)
Returns: - hardware_connection (
ethoscope.stimulators.odour_stimulators module¶
-
class
ethoscope.stimulators.odour_stimulators.
DynamicOdourDeliverer
(hardware_connection, date_range='')[source]¶ Bases:
ethoscope.stimulators.odour_stimulators.HasChangedSideStimulator
A stimulator to control a sleep depriver module
Parameters: hardware_connection ( ) – the sleep depriver module hardware interface
Returns:
-
class
ethoscope.stimulators.odour_stimulators.
DynamicOdourSleepDepriver
(hardware_connection, velocity_threshold=0.003, min_inactive_time=120, stimulus_duration=5, date_range='')[source]¶ Bases:
ethoscope.stimulators.sleep_depriver_stimulators.SleepDepStimulator
A stimulator to control an odour sleep depriver module.
Parameters: - hardware_connection (
SleepDepriverInterface
) – the sleep depriver module hardware interface - velocity_threshold (float) – The minimal velocity that counts as movement.
- stimulus_duration (float) – how long the odour delivery takes place for
- min_inactive_time (float) – the minimal time without motion after which an animal should be disturbed (in seconds)
Returns: - hardware_connection (
-
class
ethoscope.stimulators.odour_stimulators.
HasChangedSideStimulator
(hardware_connection=None, middle_line=0.5)[source]¶ Bases:
ethoscope.stimulators.stimulators.BaseStimulator
class implementing a stimulator that decides whether an animal has change side in its ROI. :param hardware_connection: a default hardware interface object :param middle_line: the x position defining the line to be crossed (from 0 to 1, relative to ROI) :type middle_line: float
-
class
ethoscope.stimulators.odour_stimulators.
MiddleCrossingOdourStimulator
(hardware_connection, p=1.0, refractory_period=300, stimulus_duration=5, date_range='')[source]¶ Bases:
ethoscope.stimulators.sleep_depriver_stimulators.MiddleCrossingStimulator