aind_behavior_services.rig package¶
Submodules¶
aind_behavior_services.rig.aind_manipulator module¶
- pydantic model aind_behavior_services.rig.aind_manipulator.AindManipulator[source]¶
Bases:
HarpStepperDriverAindManipulator device definition
Show JSON schema
{ "title": "AindManipulator", "description": "AindManipulator device definition", "type": "object", "properties": { "device_type": { "const": "StepperDriver", "default": "StepperDriver", "title": "Device Type", "type": "string" }, "calibration": { "$ref": "#/$defs/AindManipulatorCalibration", "default": { "description": "AindManipulator calibration and settings", "full_step_to_mm": { "x": 0.01, "y1": 0.01, "y2": 0.01, "z": 0.01 }, "axis_configuration": [ { "axis": 2, "max_limit": 25.0, "maximum_step_interval": 2000, "microstep_resolution": 0, "min_limit": -0.01, "motor_operation_mode": 0, "step_acceleration_interval": 100, "step_interval": 100 }, { "axis": 3, "max_limit": 25.0, "maximum_step_interval": 2000, "microstep_resolution": 0, "min_limit": -0.01, "motor_operation_mode": 0, "step_acceleration_interval": 100, "step_interval": 100 }, { "axis": 1, "max_limit": 25.0, "maximum_step_interval": 2000, "microstep_resolution": 0, "min_limit": -0.01, "motor_operation_mode": 0, "step_acceleration_interval": 100, "step_interval": 100 }, { "axis": 4, "max_limit": 25.0, "maximum_step_interval": 2000, "microstep_resolution": 0, "min_limit": -0.01, "motor_operation_mode": 0, "step_acceleration_interval": 100, "step_interval": 100 } ], "homing_order": [ 2, 3, 1, 4 ], "initial_position": { "x": 0.0, "y1": 0.0, "y2": 0.0, "z": 0.0 } }, "description": "Calibration for the device." }, "who_am_i": { "const": 1130, "default": 1130, "title": "Who Am I", "type": "integer" }, "serial_number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device serial number", "title": "Serial Number" }, "port_name": { "description": "Device port name", "title": "Port Name", "type": "string" } }, "$defs": { "AindManipulatorCalibration": { "description": "AindManipulator calibration class", "properties": { "description": { "const": "AindManipulator calibration and settings", "default": "AindManipulator calibration and settings", "title": "Description", "type": "string" }, "full_step_to_mm": { "$ref": "#/$defs/ManipulatorPosition", "default": { "x": 0.01, "y1": 0.01, "y2": 0.01, "z": 0.01 }, "title": "Full step to mm. Used to convert steps to SI Units" }, "axis_configuration": { "default": [ { "axis": 2, "step_acceleration_interval": 100, "step_interval": 100, "microstep_resolution": 0, "maximum_step_interval": 2000, "motor_operation_mode": 0, "max_limit": 25.0, "min_limit": -0.01 }, { "axis": 3, "step_acceleration_interval": 100, "step_interval": 100, "microstep_resolution": 0, "maximum_step_interval": 2000, "motor_operation_mode": 0, "max_limit": 25.0, "min_limit": -0.01 }, { "axis": 1, "step_acceleration_interval": 100, "step_interval": 100, "microstep_resolution": 0, "maximum_step_interval": 2000, "motor_operation_mode": 0, "max_limit": 25.0, "min_limit": -0.01 }, { "axis": 4, "step_acceleration_interval": 100, "step_interval": 100, "microstep_resolution": 0, "maximum_step_interval": 2000, "motor_operation_mode": 0, "max_limit": 25.0, "min_limit": -0.01 } ], "items": { "$ref": "#/$defs/AxisConfiguration" }, "title": "Axes configuration. Only the axes that are configured will be enabled.", "type": "array" }, "homing_order": { "default": [ 2, 3, 1, 4 ], "items": { "$ref": "#/$defs/Axis" }, "title": "Homing order", "type": "array" }, "initial_position": { "$ref": "#/$defs/ManipulatorPosition", "default": { "x": 0.0, "y1": 0.0, "y2": 0.0, "z": 0.0 } } }, "title": "AindManipulatorCalibration", "type": "object" }, "Axis": { "description": "Motor axis available", "enum": [ 0, 1, 2, 3, 4 ], "title": "Axis", "type": "integer" }, "AxisConfiguration": { "description": "Axis configuration", "properties": { "axis": { "$ref": "#/$defs/Axis", "title": "Axis to be configured" }, "step_acceleration_interval": { "default": 100, "description": "Acceleration of the step interval in microseconds", "maximum": 2000, "minimum": 2, "title": "Acceleration", "type": "integer" }, "step_interval": { "default": 100, "description": "Step interval in microseconds.", "maximum": 20000, "minimum": 100, "title": "Step interval", "type": "integer" }, "microstep_resolution": { "$ref": "#/$defs/MicrostepResolution", "default": 0, "title": "Microstep resolution" }, "maximum_step_interval": { "default": 2000, "maximum": 20000, "minimum": 100, "title": "Configures the time between step motor pulses (us) used when starting or stopping a movement", "type": "integer" }, "motor_operation_mode": { "$ref": "#/$defs/MotorOperationMode", "default": 0, "title": "Motor operation mode" }, "max_limit": { "default": 25, "title": "Maximum limit in SI units. A value of 0 disables this limit.", "type": "number" }, "min_limit": { "default": -0.01, "title": "Minimum limit in SI units. A value of 0 disables this limit.", "type": "number" } }, "required": [ "axis" ], "title": "AxisConfiguration", "type": "object" }, "ManipulatorPosition": { "description": "Represents a position in the manipulator coordinate system", "properties": { "x": { "title": "X coordinate", "type": "number" }, "y1": { "title": "Y1 coordinate", "type": "number" }, "y2": { "title": "Y2 coordinate", "type": "number" }, "z": { "title": "Z coordinate", "type": "number" } }, "required": [ "x", "y1", "y2", "z" ], "title": "ManipulatorPosition", "type": "object" }, "MicrostepResolution": { "description": "Microstep resolution available", "enum": [ 0, 1, 2, 3 ], "title": "MicrostepResolution", "type": "integer" }, "MotorOperationMode": { "description": "Motor operation mode", "enum": [ 0, 1 ], "title": "MotorOperationMode", "type": "integer" } }, "required": [ "port_name" ] }
- field calibration: AindManipulatorCalibration = AindManipulatorCalibration(description='AindManipulator calibration and settings', full_step_to_mm=ManipulatorPosition(x=0.01, y1=0.01, y2=0.01, z=0.01), axis_configuration=[AxisConfiguration(axis=<Axis.Y1: 2>, step_acceleration_interval=100, step_interval=100, microstep_resolution=<MicrostepResolution.MICROSTEP8: 0>, maximum_step_interval=2000, motor_operation_mode=<MotorOperationMode.QUIET: 0>, max_limit=25, min_limit=-0.01), AxisConfiguration(axis=<Axis.Y2: 3>, step_acceleration_interval=100, step_interval=100, microstep_resolution=<MicrostepResolution.MICROSTEP8: 0>, maximum_step_interval=2000, motor_operation_mode=<MotorOperationMode.QUIET: 0>, max_limit=25, min_limit=-0.01), AxisConfiguration(axis=<Axis.X: 1>, step_acceleration_interval=100, step_interval=100, microstep_resolution=<MicrostepResolution.MICROSTEP8: 0>, maximum_step_interval=2000, motor_operation_mode=<MotorOperationMode.QUIET: 0>, max_limit=25, min_limit=-0.01), AxisConfiguration(axis=<Axis.Z: 4>, step_acceleration_interval=100, step_interval=100, microstep_resolution=<MicrostepResolution.MICROSTEP8: 0>, maximum_step_interval=2000, motor_operation_mode=<MotorOperationMode.QUIET: 0>, max_limit=25, min_limit=-0.01)], homing_order=[<Axis.Y1: 2>, <Axis.Y2: 3>, <Axis.X: 1>, <Axis.Z: 4>], initial_position=ManipulatorPosition(x=0.0, y1=0.0, y2=0.0, z=0.0))[source]¶
Calibration for the device.
- pydantic model aind_behavior_services.rig.aind_manipulator.AindManipulatorCalibration[source]¶
Bases:
BaseModelAindManipulator calibration class
Show JSON schema
{ "title": "AindManipulatorCalibration", "description": "AindManipulator calibration class", "type": "object", "properties": { "description": { "const": "AindManipulator calibration and settings", "default": "AindManipulator calibration and settings", "title": "Description", "type": "string" }, "full_step_to_mm": { "$ref": "#/$defs/ManipulatorPosition", "default": { "x": 0.01, "y1": 0.01, "y2": 0.01, "z": 0.01 }, "title": "Full step to mm. Used to convert steps to SI Units" }, "axis_configuration": { "default": [ { "axis": 2, "step_acceleration_interval": 100, "step_interval": 100, "microstep_resolution": 0, "maximum_step_interval": 2000, "motor_operation_mode": 0, "max_limit": 25.0, "min_limit": -0.01 }, { "axis": 3, "step_acceleration_interval": 100, "step_interval": 100, "microstep_resolution": 0, "maximum_step_interval": 2000, "motor_operation_mode": 0, "max_limit": 25.0, "min_limit": -0.01 }, { "axis": 1, "step_acceleration_interval": 100, "step_interval": 100, "microstep_resolution": 0, "maximum_step_interval": 2000, "motor_operation_mode": 0, "max_limit": 25.0, "min_limit": -0.01 }, { "axis": 4, "step_acceleration_interval": 100, "step_interval": 100, "microstep_resolution": 0, "maximum_step_interval": 2000, "motor_operation_mode": 0, "max_limit": 25.0, "min_limit": -0.01 } ], "items": { "$ref": "#/$defs/AxisConfiguration" }, "title": "Axes configuration. Only the axes that are configured will be enabled.", "type": "array" }, "homing_order": { "default": [ 2, 3, 1, 4 ], "items": { "$ref": "#/$defs/Axis" }, "title": "Homing order", "type": "array" }, "initial_position": { "$ref": "#/$defs/ManipulatorPosition", "default": { "x": 0.0, "y1": 0.0, "y2": 0.0, "z": 0.0 } } }, "$defs": { "Axis": { "description": "Motor axis available", "enum": [ 0, 1, 2, 3, 4 ], "title": "Axis", "type": "integer" }, "AxisConfiguration": { "description": "Axis configuration", "properties": { "axis": { "$ref": "#/$defs/Axis", "title": "Axis to be configured" }, "step_acceleration_interval": { "default": 100, "description": "Acceleration of the step interval in microseconds", "maximum": 2000, "minimum": 2, "title": "Acceleration", "type": "integer" }, "step_interval": { "default": 100, "description": "Step interval in microseconds.", "maximum": 20000, "minimum": 100, "title": "Step interval", "type": "integer" }, "microstep_resolution": { "$ref": "#/$defs/MicrostepResolution", "default": 0, "title": "Microstep resolution" }, "maximum_step_interval": { "default": 2000, "maximum": 20000, "minimum": 100, "title": "Configures the time between step motor pulses (us) used when starting or stopping a movement", "type": "integer" }, "motor_operation_mode": { "$ref": "#/$defs/MotorOperationMode", "default": 0, "title": "Motor operation mode" }, "max_limit": { "default": 25, "title": "Maximum limit in SI units. A value of 0 disables this limit.", "type": "number" }, "min_limit": { "default": -0.01, "title": "Minimum limit in SI units. A value of 0 disables this limit.", "type": "number" } }, "required": [ "axis" ], "title": "AxisConfiguration", "type": "object" }, "ManipulatorPosition": { "description": "Represents a position in the manipulator coordinate system", "properties": { "x": { "title": "X coordinate", "type": "number" }, "y1": { "title": "Y1 coordinate", "type": "number" }, "y2": { "title": "Y2 coordinate", "type": "number" }, "z": { "title": "Z coordinate", "type": "number" } }, "required": [ "x", "y1", "y2", "z" ], "title": "ManipulatorPosition", "type": "object" }, "MicrostepResolution": { "description": "Microstep resolution available", "enum": [ 0, 1, 2, 3 ], "title": "MicrostepResolution", "type": "integer" }, "MotorOperationMode": { "description": "Motor operation mode", "enum": [ 0, 1 ], "title": "MotorOperationMode", "type": "integer" } } }
- Fields:
axis_configuration (List[aind_behavior_services.rig.aind_manipulator.AxisConfiguration])description (Literal['AindManipulator calibration and settings'])full_step_to_mm (aind_behavior_services.rig.aind_manipulator.ManipulatorPosition)homing_order (List[aind_behavior_services.rig.aind_manipulator.Axis])initial_position (aind_behavior_services.rig.aind_manipulator.ManipulatorPosition)
- field axis_configuration: List[AxisConfiguration] = [AxisConfiguration(axis=<Axis.Y1: 2>, step_acceleration_interval=100, step_interval=100, microstep_resolution=<MicrostepResolution.MICROSTEP8: 0>, maximum_step_interval=2000, motor_operation_mode=<MotorOperationMode.QUIET: 0>, max_limit=25, min_limit=-0.01), AxisConfiguration(axis=<Axis.Y2: 3>, step_acceleration_interval=100, step_interval=100, microstep_resolution=<MicrostepResolution.MICROSTEP8: 0>, maximum_step_interval=2000, motor_operation_mode=<MotorOperationMode.QUIET: 0>, max_limit=25, min_limit=-0.01), AxisConfiguration(axis=<Axis.X: 1>, step_acceleration_interval=100, step_interval=100, microstep_resolution=<MicrostepResolution.MICROSTEP8: 0>, maximum_step_interval=2000, motor_operation_mode=<MotorOperationMode.QUIET: 0>, max_limit=25, min_limit=-0.01), AxisConfiguration(axis=<Axis.Z: 4>, step_acceleration_interval=100, step_interval=100, microstep_resolution=<MicrostepResolution.MICROSTEP8: 0>, maximum_step_interval=2000, motor_operation_mode=<MotorOperationMode.QUIET: 0>, max_limit=25, min_limit=-0.01)][source]¶
- field description: Literal['AindManipulator calibration and settings'] = 'AindManipulator calibration and settings'[source]¶
- field full_step_to_mm: ManipulatorPosition = ManipulatorPosition(x=0.01, y1=0.01, y2=0.01, z=0.01)[source]¶
- field initial_position: ManipulatorPosition = ManipulatorPosition(x=0.0, y1=0.0, y2=0.0, z=0.0)[source]¶
- class aind_behavior_services.rig.aind_manipulator.Axis(*values)[source]¶
Bases:
IntEnumMotor axis available
- pydantic model aind_behavior_services.rig.aind_manipulator.AxisConfiguration[source]¶
Bases:
BaseModelAxis configuration
Show JSON schema
{ "title": "AxisConfiguration", "description": "Axis configuration", "type": "object", "properties": { "axis": { "$ref": "#/$defs/Axis", "title": "Axis to be configured" }, "step_acceleration_interval": { "default": 100, "description": "Acceleration of the step interval in microseconds", "maximum": 2000, "minimum": 2, "title": "Acceleration", "type": "integer" }, "step_interval": { "default": 100, "description": "Step interval in microseconds.", "maximum": 20000, "minimum": 100, "title": "Step interval", "type": "integer" }, "microstep_resolution": { "$ref": "#/$defs/MicrostepResolution", "default": 0, "title": "Microstep resolution" }, "maximum_step_interval": { "default": 2000, "maximum": 20000, "minimum": 100, "title": "Configures the time between step motor pulses (us) used when starting or stopping a movement", "type": "integer" }, "motor_operation_mode": { "$ref": "#/$defs/MotorOperationMode", "default": 0, "title": "Motor operation mode" }, "max_limit": { "default": 25, "title": "Maximum limit in SI units. A value of 0 disables this limit.", "type": "number" }, "min_limit": { "default": -0.01, "title": "Minimum limit in SI units. A value of 0 disables this limit.", "type": "number" } }, "$defs": { "Axis": { "description": "Motor axis available", "enum": [ 0, 1, 2, 3, 4 ], "title": "Axis", "type": "integer" }, "MicrostepResolution": { "description": "Microstep resolution available", "enum": [ 0, 1, 2, 3 ], "title": "MicrostepResolution", "type": "integer" }, "MotorOperationMode": { "description": "Motor operation mode", "enum": [ 0, 1 ], "title": "MotorOperationMode", "type": "integer" } }, "required": [ "axis" ] }
- Fields:
- field microstep_resolution: MicrostepResolution = MicrostepResolution.MICROSTEP8[source]¶
- field motor_operation_mode: MotorOperationMode = MotorOperationMode.QUIET[source]¶
- pydantic model aind_behavior_services.rig.aind_manipulator.ManipulatorPosition[source]¶
Bases:
BaseModelRepresents a position in the manipulator coordinate system
Show JSON schema
{ "title": "ManipulatorPosition", "description": "Represents a position in the manipulator coordinate system", "type": "object", "properties": { "x": { "title": "X coordinate", "type": "number" }, "y1": { "title": "Y1 coordinate", "type": "number" }, "y2": { "title": "Y2 coordinate", "type": "number" }, "z": { "title": "Z coordinate", "type": "number" } }, "required": [ "x", "y1", "y2", "z" ] }
- Fields:
aind_behavior_services.rig.cameras module¶
- pydantic model aind_behavior_services.rig.cameras.CameraController[source]¶
Bases:
Device,Generic[TCamera]Camera controller device configuration. Manages multiple cameras of the same type.
Show JSON schema
{ "title": "CameraController", "description": "Camera controller device configuration.\nManages multiple cameras of the same type.", "type": "object", "properties": { "device_type": { "const": "CameraController", "default": "CameraController", "title": "Device Type", "type": "string" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration for the device." }, "cameras": { "additionalProperties": { "anyOf": [ { "$ref": "#/$defs/WebCamera" }, { "$ref": "#/$defs/SpinnakerCamera" } ] }, "description": "Cameras to be instantiated", "title": "Cameras", "type": "object" }, "frame_rate": { "anyOf": [ { "minimum": 0, "type": "integer" }, { "type": "null" } ], "default": 30, "description": "Frame rate of the trigger to all cameras", "title": "Frame Rate" } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" }, "Rect": { "description": "Represents a rectangle defined by its top-left corner, width, and height.", "properties": { "x": { "default": 0, "description": "X coordinate of the top-left corner", "minimum": 0, "title": "X", "type": "integer" }, "y": { "default": 0, "description": "Y coordinate of the top-left corner", "minimum": 0, "title": "Y", "type": "integer" }, "width": { "default": 0, "description": "Width of the rectangle", "minimum": 0, "title": "Width", "type": "integer" }, "height": { "default": 0, "description": "Height of the rectangle", "minimum": 0, "title": "Height", "type": "integer" } }, "title": "Rect", "type": "object" }, "SpinnakerCamera": { "description": "Spinnaker camera device configuration.", "properties": { "device_type": { "const": "SpinnakerCamera", "default": "SpinnakerCamera", "title": "Device Type", "type": "string" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration for the device." }, "serial_number": { "description": "Camera serial number", "title": "Serial Number", "type": "string" }, "binning": { "default": 1, "description": "Binning", "minimum": 1, "title": "Binning", "type": "integer" }, "color_processing": { "default": "Default", "description": "Color processing", "enum": [ "Default", "NoColorProcessing" ], "title": "Color Processing", "type": "string" }, "exposure": { "default": 1000, "description": "Exposure time", "minimum": 100, "title": "Exposure", "type": "integer" }, "gain": { "default": 0, "description": "Gain", "minimum": 0, "title": "Gain", "type": "number" }, "gamma": { "anyOf": [ { "minimum": 0, "type": "number" }, { "type": "null" } ], "default": null, "description": "Gamma. If None, will disable gamma correction.", "title": "Gamma" }, "adc_bit_depth": { "anyOf": [ { "$ref": "#/$defs/SpinnakerCameraAdcBitDepth" }, { "type": "null" } ], "default": 0, "description": "ADC bit depth. If None will be left as default." }, "pixel_format": { "anyOf": [ { "$ref": "#/$defs/SpinnakerCameraPixelFormat" }, { "type": "null" } ], "default": 0, "description": "Pixel format. If None will be left as default." }, "region_of_interest": { "$ref": "#/$defs/Rect", "default": { "x": 0, "y": 0, "width": 0, "height": 0 }, "description": "Region of interest" }, "video_writer": { "anyOf": [ { "$ref": "#/$defs/VideoWriter" }, { "type": "null" } ], "default": null, "description": "Video writer. If not provided, no video will be saved." } }, "required": [ "serial_number" ], "title": "SpinnakerCamera", "type": "object" }, "SpinnakerCameraAdcBitDepth": { "description": "ADC bit depth options for Spinnaker cameras.", "enum": [ 0, 1, 2 ], "title": "SpinnakerCameraAdcBitDepth", "type": "integer" }, "SpinnakerCameraPixelFormat": { "description": "Pixel format options for Spinnaker cameras.", "enum": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 ], "title": "SpinnakerCameraPixelFormat", "type": "integer" }, "VideoWriter": { "discriminator": { "mapping": { "FFMPEG": "#/$defs/VideoWriterFfmpeg", "OPENCV": "#/$defs/VideoWriterOpenCv" }, "propertyName": "video_writer_type" }, "oneOf": [ { "$ref": "#/$defs/VideoWriterFfmpeg" }, { "$ref": "#/$defs/VideoWriterOpenCv" } ] }, "VideoWriterFfmpeg": { "description": "FFMPEG video writer configuration.", "properties": { "video_writer_type": { "const": "FFMPEG", "default": "FFMPEG", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "mp4", "description": "Container extension", "title": "Container Extension", "type": "string" }, "output_arguments": { "default": "-vf \"scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M", "description": "Output arguments", "title": "Output Arguments", "type": "string" }, "input_arguments": { "default": "-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear", "description": "Input arguments", "title": "Input Arguments", "type": "string" } }, "title": "VideoWriterFfmpeg", "type": "object" }, "VideoWriterOpenCv": { "description": "OpenCV video writer configuration.", "properties": { "video_writer_type": { "const": "OPENCV", "default": "OPENCV", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "avi", "description": "Container extension", "title": "Container Extension", "type": "string" }, "four_cc": { "default": "FMP4", "description": "Four character code", "title": "Four Cc", "type": "string" } }, "title": "VideoWriterOpenCv", "type": "object" }, "WebCamera": { "description": "Web camera device configuration.", "properties": { "device_type": { "const": "WebCamera", "default": "WebCamera", "title": "Device Type", "type": "string" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration for the device." }, "index": { "default": 0, "description": "Camera index", "minimum": 0, "title": "Index", "type": "integer" }, "video_writer": { "anyOf": [ { "$ref": "#/$defs/VideoWriter" }, { "type": "null" } ], "default": null, "description": "Video writer. If not provided, no video will be saved." } }, "title": "WebCamera", "type": "object" } }, "required": [ "cameras" ] }
- Fields:
- aind_behavior_services.rig.cameras.FFMPEG_INPUT = '-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear'[source]¶
Default input arguments
- aind_behavior_services.rig.cameras.FFMPEG_OUTPUT_16BIT = '-vf "scale=out_color_matrix=bt709:out_range=full,format=rgb48le,scale=out_range=full" -c:v hevc_nvenc -pix_fmt p010le -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author="Allen Institute for Neural Dynamics" -maxrate 700M -bufsize 350M'[source]¶
Default output arguments for 16-bit video encoding
- aind_behavior_services.rig.cameras.FFMPEG_OUTPUT_8BIT = '-vf "scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author="Allen Institute for Neural Dynamics" -maxrate 700M -bufsize 350M'[source]¶
Default output arguments for 8-bit video encoding
- pydantic model aind_behavior_services.rig.cameras.SpinnakerCamera[source]¶
Bases:
DeviceSpinnaker camera device configuration.
Show JSON schema
{ "title": "SpinnakerCamera", "description": "Spinnaker camera device configuration.", "type": "object", "properties": { "device_type": { "const": "SpinnakerCamera", "default": "SpinnakerCamera", "title": "Device Type", "type": "string" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration for the device." }, "serial_number": { "description": "Camera serial number", "title": "Serial Number", "type": "string" }, "binning": { "default": 1, "description": "Binning", "minimum": 1, "title": "Binning", "type": "integer" }, "color_processing": { "default": "Default", "description": "Color processing", "enum": [ "Default", "NoColorProcessing" ], "title": "Color Processing", "type": "string" }, "exposure": { "default": 1000, "description": "Exposure time", "minimum": 100, "title": "Exposure", "type": "integer" }, "gain": { "default": 0, "description": "Gain", "minimum": 0, "title": "Gain", "type": "number" }, "gamma": { "anyOf": [ { "minimum": 0, "type": "number" }, { "type": "null" } ], "default": null, "description": "Gamma. If None, will disable gamma correction.", "title": "Gamma" }, "adc_bit_depth": { "anyOf": [ { "$ref": "#/$defs/SpinnakerCameraAdcBitDepth" }, { "type": "null" } ], "default": 0, "description": "ADC bit depth. If None will be left as default." }, "pixel_format": { "anyOf": [ { "$ref": "#/$defs/SpinnakerCameraPixelFormat" }, { "type": "null" } ], "default": 0, "description": "Pixel format. If None will be left as default." }, "region_of_interest": { "$ref": "#/$defs/Rect", "default": { "x": 0, "y": 0, "width": 0, "height": 0 }, "description": "Region of interest" }, "video_writer": { "anyOf": [ { "$ref": "#/$defs/VideoWriter" }, { "type": "null" } ], "default": null, "description": "Video writer. If not provided, no video will be saved." } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" }, "Rect": { "description": "Represents a rectangle defined by its top-left corner, width, and height.", "properties": { "x": { "default": 0, "description": "X coordinate of the top-left corner", "minimum": 0, "title": "X", "type": "integer" }, "y": { "default": 0, "description": "Y coordinate of the top-left corner", "minimum": 0, "title": "Y", "type": "integer" }, "width": { "default": 0, "description": "Width of the rectangle", "minimum": 0, "title": "Width", "type": "integer" }, "height": { "default": 0, "description": "Height of the rectangle", "minimum": 0, "title": "Height", "type": "integer" } }, "title": "Rect", "type": "object" }, "SpinnakerCameraAdcBitDepth": { "description": "ADC bit depth options for Spinnaker cameras.", "enum": [ 0, 1, 2 ], "title": "SpinnakerCameraAdcBitDepth", "type": "integer" }, "SpinnakerCameraPixelFormat": { "description": "Pixel format options for Spinnaker cameras.", "enum": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 ], "title": "SpinnakerCameraPixelFormat", "type": "integer" }, "VideoWriter": { "discriminator": { "mapping": { "FFMPEG": "#/$defs/VideoWriterFfmpeg", "OPENCV": "#/$defs/VideoWriterOpenCv" }, "propertyName": "video_writer_type" }, "oneOf": [ { "$ref": "#/$defs/VideoWriterFfmpeg" }, { "$ref": "#/$defs/VideoWriterOpenCv" } ] }, "VideoWriterFfmpeg": { "description": "FFMPEG video writer configuration.", "properties": { "video_writer_type": { "const": "FFMPEG", "default": "FFMPEG", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "mp4", "description": "Container extension", "title": "Container Extension", "type": "string" }, "output_arguments": { "default": "-vf \"scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M", "description": "Output arguments", "title": "Output Arguments", "type": "string" }, "input_arguments": { "default": "-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear", "description": "Input arguments", "title": "Input Arguments", "type": "string" } }, "title": "VideoWriterFfmpeg", "type": "object" }, "VideoWriterOpenCv": { "description": "OpenCV video writer configuration.", "properties": { "video_writer_type": { "const": "OPENCV", "default": "OPENCV", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "avi", "description": "Container extension", "title": "Container Extension", "type": "string" }, "four_cc": { "default": "FMP4", "description": "Four character code", "title": "Four Cc", "type": "string" } }, "title": "VideoWriterOpenCv", "type": "object" } }, "required": [ "serial_number" ] }
- Fields:
- Validators:
- field adc_bit_depth: SpinnakerCameraAdcBitDepth | None = SpinnakerCameraAdcBitDepth.ADC8BIT[source]¶
ADC bit depth. If None will be left as default.
- field color_processing: Literal['Default', 'NoColorProcessing'] = 'Default'[source]¶
Color processing
- field gamma: float | None = None[source]¶
Gamma. If None, will disable gamma correction.
- Constraints:
ge = 0
- field pixel_format: SpinnakerCameraPixelFormat | None = SpinnakerCameraPixelFormat.MONO8[source]¶
Pixel format. If None will be left as default.
- field region_of_interest: Rect = Rect(x=0, y=0, width=0, height=0)[source]¶
Region of interest
- Validated by:
- field video_writer: VideoWriter | None = None[source]¶
Video writer. If not provided, no video will be saved.
- validator validate_roi » region_of_interest[source]¶
- class aind_behavior_services.rig.cameras.SpinnakerCameraAdcBitDepth(*values)[source]¶
Bases:
IntEnumADC bit depth options for Spinnaker cameras.
- class aind_behavior_services.rig.cameras.SpinnakerCameraPixelFormat(*values)[source]¶
Bases:
IntEnumPixel format options for Spinnaker cameras.
- pydantic model aind_behavior_services.rig.cameras.VideoWriterFfmpeg[source]¶
Bases:
BaseModelFFMPEG video writer configuration.
Show JSON schema
{ "title": "VideoWriterFfmpeg", "description": "FFMPEG video writer configuration.", "type": "object", "properties": { "video_writer_type": { "const": "FFMPEG", "default": "FFMPEG", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "mp4", "description": "Container extension", "title": "Container Extension", "type": "string" }, "output_arguments": { "default": "-vf \"scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M", "description": "Output arguments", "title": "Output Arguments", "type": "string" }, "input_arguments": { "default": "-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear", "description": "Input arguments", "title": "Input Arguments", "type": "string" } } }
- Fields:
- field input_arguments: str = '-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear'[source]¶
Input arguments
- field output_arguments: str = '-vf "scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author="Allen Institute for Neural Dynamics" -maxrate 700M -bufsize 350M'[source]¶
Output arguments
- pydantic model aind_behavior_services.rig.cameras.VideoWriterOpenCv[source]¶
Bases:
BaseModelOpenCV video writer configuration.
Show JSON schema
{ "title": "VideoWriterOpenCv", "description": "OpenCV video writer configuration.", "type": "object", "properties": { "video_writer_type": { "const": "OPENCV", "default": "OPENCV", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "avi", "description": "Container extension", "title": "Container Extension", "type": "string" }, "four_cc": { "default": "FMP4", "description": "Four character code", "title": "Four Cc", "type": "string" } } }
- Fields:
- pydantic model aind_behavior_services.rig.cameras.WebCamera[source]¶
Bases:
DeviceWeb camera device configuration.
Show JSON schema
{ "title": "WebCamera", "description": "Web camera device configuration.", "type": "object", "properties": { "device_type": { "const": "WebCamera", "default": "WebCamera", "title": "Device Type", "type": "string" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration for the device." }, "index": { "default": 0, "description": "Camera index", "minimum": 0, "title": "Index", "type": "integer" }, "video_writer": { "anyOf": [ { "$ref": "#/$defs/VideoWriter" }, { "type": "null" } ], "default": null, "description": "Video writer. If not provided, no video will be saved." } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" }, "VideoWriter": { "discriminator": { "mapping": { "FFMPEG": "#/$defs/VideoWriterFfmpeg", "OPENCV": "#/$defs/VideoWriterOpenCv" }, "propertyName": "video_writer_type" }, "oneOf": [ { "$ref": "#/$defs/VideoWriterFfmpeg" }, { "$ref": "#/$defs/VideoWriterOpenCv" } ] }, "VideoWriterFfmpeg": { "description": "FFMPEG video writer configuration.", "properties": { "video_writer_type": { "const": "FFMPEG", "default": "FFMPEG", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "mp4", "description": "Container extension", "title": "Container Extension", "type": "string" }, "output_arguments": { "default": "-vf \"scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M", "description": "Output arguments", "title": "Output Arguments", "type": "string" }, "input_arguments": { "default": "-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear", "description": "Input arguments", "title": "Input Arguments", "type": "string" } }, "title": "VideoWriterFfmpeg", "type": "object" }, "VideoWriterOpenCv": { "description": "OpenCV video writer configuration.", "properties": { "video_writer_type": { "const": "OPENCV", "default": "OPENCV", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "avi", "description": "Container extension", "title": "Container Extension", "type": "string" }, "four_cc": { "default": "FMP4", "description": "Four character code", "title": "Four Cc", "type": "string" } }, "title": "VideoWriterOpenCv", "type": "object" } } }
aind_behavior_services.rig.harp module¶
aind_behavior_services.rig.load_cells module¶
- pydantic model aind_behavior_services.rig.load_cells.LoadCellChannelCalibration[source]¶
Bases:
BaseModelLoad cell channel calibration Calibration will be applied as:
weight (g) = slope * (adc_units_corrected_by_offset_resistor - adc_units_baseline)
Show JSON schema
{ "title": "LoadCellChannelCalibration", "description": "Load cell channel calibration\nCalibration will be applied as:\n weight (g) = slope * (adc_units_corrected_by_offset_resistor - adc_units_baseline)", "type": "object", "properties": { "channel": { "description": "Load cell channel number available", "maximum": 7, "minimum": 0, "title": "Load cell channel number", "type": "integer" }, "offset": { "default": 0, "description": "Load cell offset value [-255, 255]", "maximum": 255, "minimum": -255, "title": "Load cell offset applied to the wheatstone bridge circuit", "type": "integer" }, "baseline": { "default": 0.0, "title": "Load cell baseline that will be DSP subtracted to the raw adc output.", "type": "number" }, "slope": { "default": 1.0, "title": "Load cell slope that will be used to convert tared (- baseline) adc units to weight (g).", "type": "number" } }, "required": [ "channel" ] }
- field channel: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Load cell channel number available', metadata=[Ge(ge=0), Le(le=7)])] [Required][source]¶
Load cell channel number available
- Constraints:
ge = 0
le = 7
- pydantic model aind_behavior_services.rig.load_cells.LoadCells[source]¶
Bases:
HarpLoadCellsLoad cells device
Show JSON schema
{ "title": "LoadCells", "description": "Load cells device", "type": "object", "properties": { "device_type": { "const": "LoadCells", "default": "LoadCells", "title": "Device Type", "type": "string" }, "calibration": { "$ref": "#/$defs/LoadCellsCalibration", "default": { "date": "2026-01-29T17:14:07.506650Z", "channels": [] }, "description": "Calibration for the device." }, "who_am_i": { "const": 1232, "default": 1232, "title": "Who Am I", "type": "integer" }, "serial_number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device serial number", "title": "Serial Number" }, "port_name": { "description": "Device port name", "title": "Port Name", "type": "string" } }, "$defs": { "LoadCellChannelCalibration": { "description": "Load cell channel calibration\nCalibration will be applied as:\n weight (g) = slope * (adc_units_corrected_by_offset_resistor - adc_units_baseline)", "properties": { "channel": { "description": "Load cell channel number available", "maximum": 7, "minimum": 0, "title": "Load cell channel number", "type": "integer" }, "offset": { "default": 0, "description": "Load cell offset value [-255, 255]", "maximum": 255, "minimum": -255, "title": "Load cell offset applied to the wheatstone bridge circuit", "type": "integer" }, "baseline": { "default": 0.0, "title": "Load cell baseline that will be DSP subtracted to the raw adc output.", "type": "number" }, "slope": { "default": 1.0, "title": "Load cell slope that will be used to convert tared (- baseline) adc units to weight (g).", "type": "number" } }, "required": [ "channel" ], "title": "LoadCellChannelCalibration", "type": "object" }, "LoadCellsCalibration": { "description": "Load cells calibration", "properties": { "date": { "description": "Date of the calibration", "format": "date-time", "title": "Date", "type": "string" }, "channels": { "default": [], "items": { "$ref": "#/$defs/LoadCellChannelCalibration" }, "title": "Load cells calibration", "type": "array" } }, "title": "LoadCellsCalibration", "type": "object" } }, "required": [ "port_name" ] }
- field calibration: LoadCellsCalibration = LoadCellsCalibration(date=datetime.datetime(2026, 1, 29, 17, 14, 7, 506650, tzinfo=datetime.timezone.utc), channels=[])[source]¶
Calibration for the device.
- pydantic model aind_behavior_services.rig.load_cells.LoadCellsCalibration[source]¶
Bases:
DatedCalibrationLoad cells calibration
Show JSON schema
{ "title": "LoadCellsCalibration", "description": "Load cells calibration", "type": "object", "properties": { "date": { "description": "Date of the calibration", "format": "date-time", "title": "Date", "type": "string" }, "channels": { "default": [], "items": { "$ref": "#/$defs/LoadCellChannelCalibration" }, "title": "Load cells calibration", "type": "array" } }, "$defs": { "LoadCellChannelCalibration": { "description": "Load cell channel calibration\nCalibration will be applied as:\n weight (g) = slope * (adc_units_corrected_by_offset_resistor - adc_units_baseline)", "properties": { "channel": { "description": "Load cell channel number available", "maximum": 7, "minimum": 0, "title": "Load cell channel number", "type": "integer" }, "offset": { "default": 0, "description": "Load cell offset value [-255, 255]", "maximum": 255, "minimum": -255, "title": "Load cell offset applied to the wheatstone bridge circuit", "type": "integer" }, "baseline": { "default": 0.0, "title": "Load cell baseline that will be DSP subtracted to the raw adc output.", "type": "number" }, "slope": { "default": 1.0, "title": "Load cell slope that will be used to convert tared (- baseline) adc units to weight (g).", "type": "number" } }, "required": [ "channel" ], "title": "LoadCellChannelCalibration", "type": "object" } } }
- Fields:
- Validators:
- field channels: List[LoadCellChannelCalibration] = [][source]¶
- Validated by:
- validator ensure_unique_channels » channels[source]¶
- Parameters:
values (List[LoadCellChannelCalibration])
- Return type:
aind_behavior_services.rig.olfactometer module¶
- pydantic model aind_behavior_services.rig.olfactometer.Olfactometer[source]¶
Bases:
HarpOlfactometerA calibrated olfactometer device
Show JSON schema
{ "title": "Olfactometer", "description": "A calibrated olfactometer device", "type": "object", "properties": { "device_type": { "const": "Olfactometer", "default": "Olfactometer", "title": "Device Type", "type": "string" }, "calibration": { "$ref": "#/$defs/OlfactometerCalibration", "default": { "date": "2026-01-29T17:14:07.509711Z", "channel_config": {} }, "title": "Calibration of the olfactometer" }, "who_am_i": { "const": 1140, "default": 1140, "title": "Who Am I", "type": "integer" }, "serial_number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device serial number", "title": "Serial Number" }, "port_name": { "description": "Device port name", "title": "Port Name", "type": "string" } }, "$defs": { "OlfactometerCalibration": { "description": "Olfactometer device configuration model", "properties": { "date": { "description": "Date of the calibration", "format": "date-time", "title": "Date", "type": "string" }, "channel_config": { "additionalProperties": { "$ref": "#/$defs/OlfactometerChannelConfig" }, "default": {}, "description": "Configuration of olfactometer channels", "propertyNames": { "$ref": "#/$defs/OlfactometerChannel" }, "title": "Channel Config", "type": "object" } }, "title": "OlfactometerCalibration", "type": "object" }, "OlfactometerChannel": { "description": "Harp Olfactometer available channel", "enum": [ 0, 1, 2, 3 ], "title": "OlfactometerChannel", "type": "integer" }, "OlfactometerChannelConfig": { "description": "Configuration for a single olfactometer channel", "properties": { "channel_index": { "title": "Odor channel index", "type": "integer" }, "channel_type": { "$ref": "#/$defs/OlfactometerChannelType", "default": "Odor", "title": "Olfactometer channel type" }, "flow_rate_capacity": { "default": 100, "enum": [ 100, 1000 ], "title": "Flow capacity. mL/min", "type": "integer" }, "flow_rate": { "default": 100, "maximum": 100, "title": "Target flow rate. mL/min. If channel_type == CARRIER, this value is ignored.", "type": "number" }, "odorant": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Odorant name" }, "odorant_dilution": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Odorant dilution (%v/v)" } }, "required": [ "channel_index" ], "title": "OlfactometerChannelConfig", "type": "object" }, "OlfactometerChannelType": { "description": "Olfactometer channel type", "enum": [ "Odor", "Carrier" ], "title": "OlfactometerChannelType", "type": "string" } }, "required": [ "port_name" ] }
- field calibration: OlfactometerCalibration = OlfactometerCalibration(date=datetime.datetime(2026, 1, 29, 17, 14, 7, 509711, tzinfo=datetime.timezone.utc), channel_config={})[source]¶
- pydantic model aind_behavior_services.rig.olfactometer.OlfactometerCalibration[source]¶
Bases:
DatedCalibrationOlfactometer device configuration model
Show JSON schema
{ "title": "OlfactometerCalibration", "description": "Olfactometer device configuration model", "type": "object", "properties": { "date": { "description": "Date of the calibration", "format": "date-time", "title": "Date", "type": "string" }, "channel_config": { "additionalProperties": { "$ref": "#/$defs/OlfactometerChannelConfig" }, "default": {}, "description": "Configuration of olfactometer channels", "propertyNames": { "$ref": "#/$defs/OlfactometerChannel" }, "title": "Channel Config", "type": "object" } }, "$defs": { "OlfactometerChannel": { "description": "Harp Olfactometer available channel", "enum": [ 0, 1, 2, 3 ], "title": "OlfactometerChannel", "type": "integer" }, "OlfactometerChannelConfig": { "description": "Configuration for a single olfactometer channel", "properties": { "channel_index": { "title": "Odor channel index", "type": "integer" }, "channel_type": { "$ref": "#/$defs/OlfactometerChannelType", "default": "Odor", "title": "Olfactometer channel type" }, "flow_rate_capacity": { "default": 100, "enum": [ 100, 1000 ], "title": "Flow capacity. mL/min", "type": "integer" }, "flow_rate": { "default": 100, "maximum": 100, "title": "Target flow rate. mL/min. If channel_type == CARRIER, this value is ignored.", "type": "number" }, "odorant": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Odorant name" }, "odorant_dilution": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Odorant dilution (%v/v)" } }, "required": [ "channel_index" ], "title": "OlfactometerChannelConfig", "type": "object" }, "OlfactometerChannelType": { "description": "Olfactometer channel type", "enum": [ "Odor", "Carrier" ], "title": "OlfactometerChannelType", "type": "string" } } }
- field channel_config: Dict[OlfactometerChannel, OlfactometerChannelConfig] = {}[source]¶
Configuration of olfactometer channels
- class aind_behavior_services.rig.olfactometer.OlfactometerChannel(*values)[source]¶
Bases:
IntEnumHarp Olfactometer available channel
- pydantic model aind_behavior_services.rig.olfactometer.OlfactometerChannelConfig[source]¶
Bases:
BaseModelConfiguration for a single olfactometer channel
Show JSON schema
{ "title": "OlfactometerChannelConfig", "description": "Configuration for a single olfactometer channel", "type": "object", "properties": { "channel_index": { "title": "Odor channel index", "type": "integer" }, "channel_type": { "$ref": "#/$defs/OlfactometerChannelType", "default": "Odor", "title": "Olfactometer channel type" }, "flow_rate_capacity": { "default": 100, "enum": [ 100, 1000 ], "title": "Flow capacity. mL/min", "type": "integer" }, "flow_rate": { "default": 100, "maximum": 100, "title": "Target flow rate. mL/min. If channel_type == CARRIER, this value is ignored.", "type": "number" }, "odorant": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Odorant name" }, "odorant_dilution": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Odorant dilution (%v/v)" } }, "$defs": { "OlfactometerChannelType": { "description": "Olfactometer channel type", "enum": [ "Odor", "Carrier" ], "title": "OlfactometerChannelType", "type": "string" } }, "required": [ "channel_index" ] }
- Fields:
- field channel_type: OlfactometerChannelType = OlfactometerChannelType.ODOR[source]¶
aind_behavior_services.rig.treadmill module¶
- pydantic model aind_behavior_services.rig.treadmill.Treadmill[source]¶
Bases:
HarpTreadmillA calibrated treadmill device
Show JSON schema
{ "title": "Treadmill", "description": "A calibrated treadmill device", "type": "object", "properties": { "device_type": { "const": "Treadmill", "default": "Treadmill", "title": "Device Type", "type": "string" }, "calibration": { "$ref": "#/$defs/TreadmillCalibration", "default": { "date": "2026-01-29T17:14:07.512081Z", "wheel_diameter": 15.0, "pulses_per_revolution": 28800, "invert_direction": false, "brake_lookup_calibration": [ [ 0.0, 0.0 ], [ 1.0, 65535.0 ] ] }, "title": "Calibration of the treadmill" }, "who_am_i": { "const": 1402, "default": 1402, "title": "Who Am I", "type": "integer" }, "serial_number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device serial number", "title": "Serial Number" }, "port_name": { "description": "Device port name", "title": "Port Name", "type": "string" } }, "$defs": { "TreadmillCalibration": { "description": "Treadmill calibration class", "properties": { "date": { "description": "Date of the calibration", "format": "date-time", "title": "Date", "type": "string" }, "wheel_diameter": { "default": 15, "description": "Wheel diameter", "minimum": 0, "title": "Wheel Diameter", "type": "number" }, "pulses_per_revolution": { "default": 28800, "description": "Pulses per revolution", "minimum": 1, "title": "Pulses Per Revolution", "type": "integer" }, "invert_direction": { "default": false, "description": "Invert direction", "title": "Invert Direction", "type": "boolean" }, "brake_lookup_calibration": { "default": [ [ 0, 0 ], [ 1, 65535 ] ], "description": "Brake lookup calibration. Each pair of values define (input [torque], output [brake set-point U16])", "items": { "items": { "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "minItems": 2, "title": "Brake Lookup Calibration", "type": "array" } }, "title": "TreadmillCalibration", "type": "object" } }, "required": [ "port_name" ] }
- field calibration: TreadmillCalibration = TreadmillCalibration(date=datetime.datetime(2026, 1, 29, 17, 14, 7, 512081, tzinfo=datetime.timezone.utc), wheel_diameter=15, pulses_per_revolution=28800, invert_direction=False, brake_lookup_calibration=[[0.0, 0.0], [1.0, 65535.0]])[source]¶
- pydantic model aind_behavior_services.rig.treadmill.TreadmillCalibration[source]¶
Bases:
DatedCalibrationTreadmill calibration class
Show JSON schema
{ "title": "TreadmillCalibration", "description": "Treadmill calibration class", "type": "object", "properties": { "date": { "description": "Date of the calibration", "format": "date-time", "title": "Date", "type": "string" }, "wheel_diameter": { "default": 15, "description": "Wheel diameter", "minimum": 0, "title": "Wheel Diameter", "type": "number" }, "pulses_per_revolution": { "default": 28800, "description": "Pulses per revolution", "minimum": 1, "title": "Pulses Per Revolution", "type": "integer" }, "invert_direction": { "default": false, "description": "Invert direction", "title": "Invert Direction", "type": "boolean" }, "brake_lookup_calibration": { "default": [ [ 0, 0 ], [ 1, 65535 ] ], "description": "Brake lookup calibration. Each pair of values define (input [torque], output [brake set-point U16])", "items": { "items": { "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "minItems": 2, "title": "Brake Lookup Calibration", "type": "array" } } }
- Fields:
- Validators:
- field brake_lookup_calibration: List[Annotated[List[float], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=2), MaxLen(max_length=2)])]] = [[0, 0], [1, 65535]][source]¶
Brake lookup calibration. Each pair of values define (input [torque], output [brake set-point U16])
- Constraints:
min_length = 2
- Validated by:
- validator validate_brake_lookup_calibration » brake_lookup_calibration[source]¶
- Parameters:
value (List[Annotated[List[float], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=2), MaxLen(max_length=2)])]])
- Return type:
List[Annotated[List[float], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=2), MaxLen(max_length=2)])]]
aind_behavior_services.rig.utils module¶
- class aind_behavior_services.rig.utils.LinearRegression(fit_intercept=True, positive=False)[source]¶
Bases:
objectSimple linear regression implementation maintaining some of sklearn’s interface.
Fits a linear model with coefficients to minimize the residual sum of squares between the observed targets in the dataset, and the targets predicted by the linear approximation.
- Parameters:
fit_intercept (bool)
positive (bool)
aind_behavior_services.rig.visual_stimulation module¶
- pydantic model aind_behavior_services.rig.visual_stimulation.DisplayCalibration[source]¶
Bases:
BaseModelRepresents the calibration parameters of a display.
Show JSON schema
{ "title": "DisplayCalibration", "description": "Represents the calibration parameters of a display.", "type": "object", "properties": { "intrinsics": { "$ref": "#/$defs/DisplayIntrinsics", "default": { "frame_width": 1920, "frame_height": 1080, "display_width": 20.0, "display_height": 15.0 }, "description": "Intrinsics" }, "extrinsics": { "$ref": "#/$defs/DisplayExtrinsics", "default": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } }, "description": "Extrinsics" } }, "$defs": { "DisplayExtrinsics": { "description": "Represents the extrinsic parameters of a display.", "properties": { "rotation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 0.0, "z": 0.0 }, "description": "Rotation vector (radians)" }, "translation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 1.309016, "z": -13.27 }, "description": "Translation (in cm)" } }, "title": "DisplayExtrinsics", "type": "object" }, "DisplayIntrinsics": { "description": "Represents the intrinsic parameters of a display.", "properties": { "frame_width": { "default": 1920, "description": "Frame width (px)", "minimum": 0, "title": "Frame Width", "type": "integer" }, "frame_height": { "default": 1080, "description": "Frame height (px)", "minimum": 0, "title": "Frame Height", "type": "integer" }, "display_width": { "default": 20, "description": "Display width (cm)", "minimum": 0, "title": "Display Width", "type": "number" }, "display_height": { "default": 15, "description": "Display width (cm)", "minimum": 0, "title": "Display Height", "type": "number" } }, "title": "DisplayIntrinsics", "type": "object" }, "Vector3": { "description": "Represents a 3D vector with float coordinates.", "properties": { "x": { "default": 0, "description": "X coordinate of the vector", "title": "X", "type": "number" }, "y": { "default": 0, "description": "Y coordinate of the vector", "title": "Y", "type": "number" }, "z": { "default": 0, "description": "Z coordinate of the vector", "title": "Z", "type": "number" } }, "title": "Vector3", "type": "object" } } }
- Fields:
- field extrinsics: DisplayExtrinsics = DisplayExtrinsics(rotation=Vector3(x=0.0, y=0.0, z=0.0), translation=Vector3(x=0.0, y=1.309016, z=-13.27))[source]¶
Extrinsics
- field intrinsics: DisplayIntrinsics = DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15)[source]¶
Intrinsics
- pydantic model aind_behavior_services.rig.visual_stimulation.DisplayExtrinsics[source]¶
Bases:
BaseModelRepresents the extrinsic parameters of a display.
Show JSON schema
{ "title": "DisplayExtrinsics", "description": "Represents the extrinsic parameters of a display.", "type": "object", "properties": { "rotation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 0.0, "z": 0.0 }, "description": "Rotation vector (radians)" }, "translation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 1.309016, "z": -13.27 }, "description": "Translation (in cm)" } }, "$defs": { "Vector3": { "description": "Represents a 3D vector with float coordinates.", "properties": { "x": { "default": 0, "description": "X coordinate of the vector", "title": "X", "type": "number" }, "y": { "default": 0, "description": "Y coordinate of the vector", "title": "Y", "type": "number" }, "z": { "default": 0, "description": "Z coordinate of the vector", "title": "Z", "type": "number" } }, "title": "Vector3", "type": "object" } } }
- Fields:
- pydantic model aind_behavior_services.rig.visual_stimulation.DisplayIntrinsics[source]¶
Bases:
BaseModelRepresents the intrinsic parameters of a display.
Show JSON schema
{ "title": "DisplayIntrinsics", "description": "Represents the intrinsic parameters of a display.", "type": "object", "properties": { "frame_width": { "default": 1920, "description": "Frame width (px)", "minimum": 0, "title": "Frame Width", "type": "integer" }, "frame_height": { "default": 1080, "description": "Frame height (px)", "minimum": 0, "title": "Frame Height", "type": "integer" }, "display_width": { "default": 20, "description": "Display width (cm)", "minimum": 0, "title": "Display Width", "type": "number" }, "display_height": { "default": 15, "description": "Display width (cm)", "minimum": 0, "title": "Display Height", "type": "number" } } }
- pydantic model aind_behavior_services.rig.visual_stimulation.ScreenAssembly[source]¶
Bases:
DeviceRepresents a screen assembly (left, center and right screens) and respective configuration.
Show JSON schema
{ "title": "ScreenAssembly", "description": "Represents a screen assembly (left, center and right screens) and respective configuration.", "type": "object", "properties": { "device_type": { "const": "ScreenAssembly", "default": "ScreenAssembly", "title": "Device Type", "type": "string" }, "calibration": { "$ref": "#/$defs/ScreenAssemblyCalibration", "default": { "left": { "extrinsics": { "rotation": { "x": 0.0, "y": 1.0472, "z": 0.0 }, "translation": { "x": -16.6917756, "y": 1.309016, "z": -3.575264 } }, "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 } }, "center": { "extrinsics": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } }, "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 } }, "right": { "extrinsics": { "rotation": { "x": 0.0, "y": -1.0472, "z": 0.0 }, "translation": { "x": 16.6917756, "y": 1.309016, "z": -3.575264 } }, "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 } } }, "description": "Screen assembly calibration" }, "display_index": { "default": 1, "description": "Display index", "title": "Display Index", "type": "integer" }, "target_render_frequency": { "default": 60, "description": "Target render frequency", "title": "Target Render Frequency", "type": "number" }, "target_update_frequency": { "default": 120, "description": "Target update frequency", "title": "Target Update Frequency", "type": "number" }, "texture_assets_directory": { "default": "Textures", "description": "Calibration directory", "title": "Texture Assets Directory", "type": "string" }, "brightness": { "default": 0, "description": "Brightness", "maximum": 1, "minimum": -1, "title": "Brightness", "type": "number" }, "contrast": { "default": 1, "description": "Contrast", "maximum": 1, "minimum": -1, "title": "Contrast", "type": "number" } }, "$defs": { "DisplayCalibration": { "description": "Represents the calibration parameters of a display.", "properties": { "intrinsics": { "$ref": "#/$defs/DisplayIntrinsics", "default": { "frame_width": 1920, "frame_height": 1080, "display_width": 20.0, "display_height": 15.0 }, "description": "Intrinsics" }, "extrinsics": { "$ref": "#/$defs/DisplayExtrinsics", "default": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } }, "description": "Extrinsics" } }, "title": "DisplayCalibration", "type": "object" }, "DisplayExtrinsics": { "description": "Represents the extrinsic parameters of a display.", "properties": { "rotation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 0.0, "z": 0.0 }, "description": "Rotation vector (radians)" }, "translation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 1.309016, "z": -13.27 }, "description": "Translation (in cm)" } }, "title": "DisplayExtrinsics", "type": "object" }, "DisplayIntrinsics": { "description": "Represents the intrinsic parameters of a display.", "properties": { "frame_width": { "default": 1920, "description": "Frame width (px)", "minimum": 0, "title": "Frame Width", "type": "integer" }, "frame_height": { "default": 1080, "description": "Frame height (px)", "minimum": 0, "title": "Frame Height", "type": "integer" }, "display_width": { "default": 20, "description": "Display width (cm)", "minimum": 0, "title": "Display Width", "type": "number" }, "display_height": { "default": 15, "description": "Display width (cm)", "minimum": 0, "title": "Display Height", "type": "number" } }, "title": "DisplayIntrinsics", "type": "object" }, "ScreenAssemblyCalibration": { "description": "Represents the calibration parameters for a screen assembly with three displays.", "properties": { "left": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": 1.0472, "z": 0.0 }, "translation": { "x": -16.6917756, "y": 1.309016, "z": -3.575264 } } }, "description": "Left display calibration" }, "center": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } } }, "description": "Center display calibration" }, "right": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": -1.0472, "z": 0.0 }, "translation": { "x": 16.6917756, "y": 1.309016, "z": -3.575264 } } }, "description": "Right display calibration" } }, "title": "ScreenAssemblyCalibration", "type": "object" }, "Vector3": { "description": "Represents a 3D vector with float coordinates.", "properties": { "x": { "default": 0, "description": "X coordinate of the vector", "title": "X", "type": "number" }, "y": { "default": 0, "description": "Y coordinate of the vector", "title": "Y", "type": "number" }, "z": { "default": 0, "description": "Z coordinate of the vector", "title": "Z", "type": "number" } }, "title": "Vector3", "type": "object" } } }
- Fields:
- field calibration: ScreenAssemblyCalibration = ScreenAssemblyCalibration(left=DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=1.0472, z=0.0), translation=Vector3(x=-16.6917756, y=1.309016, z=-3.575264))), center=DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=0.0, z=0.0), translation=Vector3(x=0.0, y=1.309016, z=-13.27))), right=DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=-1.0472, z=0.0), translation=Vector3(x=16.6917756, y=1.309016, z=-3.575264))))[source]¶
Screen assembly calibration
- pydantic model aind_behavior_services.rig.visual_stimulation.ScreenAssemblyCalibration[source]¶
Bases:
BaseModelRepresents the calibration parameters for a screen assembly with three displays.
Show JSON schema
{ "title": "ScreenAssemblyCalibration", "description": "Represents the calibration parameters for a screen assembly with three displays.", "type": "object", "properties": { "left": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": 1.0472, "z": 0.0 }, "translation": { "x": -16.6917756, "y": 1.309016, "z": -3.575264 } } }, "description": "Left display calibration" }, "center": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } } }, "description": "Center display calibration" }, "right": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": -1.0472, "z": 0.0 }, "translation": { "x": 16.6917756, "y": 1.309016, "z": -3.575264 } } }, "description": "Right display calibration" } }, "$defs": { "DisplayCalibration": { "description": "Represents the calibration parameters of a display.", "properties": { "intrinsics": { "$ref": "#/$defs/DisplayIntrinsics", "default": { "frame_width": 1920, "frame_height": 1080, "display_width": 20.0, "display_height": 15.0 }, "description": "Intrinsics" }, "extrinsics": { "$ref": "#/$defs/DisplayExtrinsics", "default": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } }, "description": "Extrinsics" } }, "title": "DisplayCalibration", "type": "object" }, "DisplayExtrinsics": { "description": "Represents the extrinsic parameters of a display.", "properties": { "rotation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 0.0, "z": 0.0 }, "description": "Rotation vector (radians)" }, "translation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 1.309016, "z": -13.27 }, "description": "Translation (in cm)" } }, "title": "DisplayExtrinsics", "type": "object" }, "DisplayIntrinsics": { "description": "Represents the intrinsic parameters of a display.", "properties": { "frame_width": { "default": 1920, "description": "Frame width (px)", "minimum": 0, "title": "Frame Width", "type": "integer" }, "frame_height": { "default": 1080, "description": "Frame height (px)", "minimum": 0, "title": "Frame Height", "type": "integer" }, "display_width": { "default": 20, "description": "Display width (cm)", "minimum": 0, "title": "Display Width", "type": "number" }, "display_height": { "default": 15, "description": "Display width (cm)", "minimum": 0, "title": "Display Height", "type": "number" } }, "title": "DisplayIntrinsics", "type": "object" }, "Vector3": { "description": "Represents a 3D vector with float coordinates.", "properties": { "x": { "default": 0, "description": "X coordinate of the vector", "title": "X", "type": "number" }, "y": { "default": 0, "description": "Y coordinate of the vector", "title": "Y", "type": "number" }, "z": { "default": 0, "description": "Z coordinate of the vector", "title": "Z", "type": "number" } }, "title": "Vector3", "type": "object" } } }
- Fields:
- field center: DisplayCalibration = DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=0.0, z=0.0), translation=Vector3(x=0.0, y=1.309016, z=-13.27)))[source]¶
Center display calibration
- field left: DisplayCalibration = DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=1.0472, z=0.0), translation=Vector3(x=-16.6917756, y=1.309016, z=-3.575264)))[source]¶
Left display calibration
- field right: DisplayCalibration = DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=-1.0472, z=0.0), translation=Vector3(x=16.6917756, y=1.309016, z=-3.575264)))[source]¶
Right display calibration
aind_behavior_services.rig.water_valve module¶
- pydantic model aind_behavior_services.rig.water_valve.Measurement[source]¶
Bases:
BaseModelInput for water valve calibration class
Show JSON schema
{ "title": "Measurement", "description": "Input for water valve calibration class", "type": "object", "properties": { "valve_open_interval": { "description": "Time between two consecutive valve openings (s)", "exclusiveMinimum": 0, "title": "Valve open interval", "type": "number" }, "valve_open_time": { "description": "Valve open interval (s)", "exclusiveMinimum": 0, "title": "Valve open time", "type": "number" }, "water_weight": { "description": "Weight of water delivered (g)", "items": { "exclusiveMinimum": 0, "type": "number" }, "minItems": 1, "title": "Water weight", "type": "array" }, "repeat_count": { "description": "Number of times the valve opened.", "minimum": 0, "title": "Repeat count", "type": "integer" } }, "required": [ "valve_open_interval", "valve_open_time", "water_weight", "repeat_count" ] }
- Fields:
- pydantic model aind_behavior_services.rig.water_valve.WaterValveCalibration[source]¶
Bases:
DatedCalibrationRepresents a water valve calibration.
Show JSON schema
{ "title": "WaterValveCalibration", "description": "Represents a water valve calibration.", "type": "object", "properties": { "date": { "description": "Date of the calibration", "format": "date-time", "title": "Date", "type": "string" }, "measurements": { "default": [], "description": "List of measurements", "items": { "$ref": "#/$defs/Measurement" }, "title": "Measurements", "type": "array" }, "interval_average": { "anyOf": [ { "additionalProperties": { "exclusiveMinimum": 0, "type": "number" }, "type": "object" }, { "type": "null" } ], "default": null, "description": "Dictionary keyed by measured valve interval and corresponding average single event volume.", "title": "Interval average" }, "slope": { "description": "Slope of the linear regression : Volume(g) = Slope(g/s) * time(s) + offset(g)", "title": "Regression slope", "type": "number" }, "offset": { "description": "Offset of the linear regression : Volume(g) = Slope(g/s) * time(s) + offset(g)", "title": "Regression offset", "type": "number" }, "r2": { "anyOf": [ { "maximum": 1, "minimum": 0, "type": "number" }, { "type": "null" } ], "default": null, "description": "R2 metric from the linear model.", "title": "R2" }, "valid_domain": { "anyOf": [ { "items": { "exclusiveMinimum": 0, "type": "number" }, "minItems": 2, "type": "array" }, { "type": "null" } ], "default": null, "description": "The optional time-intervals the calibration curve was calculated on.", "title": "Valid domain" } }, "$defs": { "Measurement": { "description": "Input for water valve calibration class", "properties": { "valve_open_interval": { "description": "Time between two consecutive valve openings (s)", "exclusiveMinimum": 0, "title": "Valve open interval", "type": "number" }, "valve_open_time": { "description": "Valve open interval (s)", "exclusiveMinimum": 0, "title": "Valve open time", "type": "number" }, "water_weight": { "description": "Weight of water delivered (g)", "items": { "exclusiveMinimum": 0, "type": "number" }, "minItems": 1, "title": "Water weight", "type": "array" }, "repeat_count": { "description": "Number of times the valve opened.", "minimum": 0, "title": "Repeat count", "type": "integer" } }, "required": [ "valve_open_interval", "valve_open_time", "water_weight", "repeat_count" ], "title": "Measurement", "type": "object" } }, "required": [ "slope", "offset" ] }
- Fields:
- field interval_average: Dict[Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Gt(gt=0)])], Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Gt(gt=0)])]] | None = None[source]¶
Dictionary keyed by measured valve interval and corresponding average single event volume.
- field measurements: List[Measurement] = [][source]¶
List of measurements
- field offset: float [Required][source]¶
Offset of the linear regression : Volume(g) = Slope(g/s) * time(s) + offset(g)
- aind_behavior_services.rig.water_valve.calibrate_water_valves(measurements)[source]¶
Calibrate the water valve delivery system by populating the output field
- Parameters:
measurements (list[Measurement])
- Return type:
Module contents¶
- pydantic model aind_behavior_services.rig.DatedCalibration[source]¶
Bases:
BaseModelBase model for dated calibrations.
Show JSON schema
{ "title": "DatedCalibration", "description": "Base model for dated calibrations.", "type": "object", "properties": { "date": { "description": "Date of the calibration", "format": "date-time", "title": "Date", "type": "string" } } }
- Fields:
date (pydantic.types.AwareDatetime)
- field date: Annotated[AwareDatetime, WrapValidator(func=_add_default_tz, json_schema_input_type=PydanticUndefined), FieldInfo(annotation=NoneType, required=True, validate_default=True)] [Optional][source]¶
Date of the calibration
- Constraints:
func = <function _add_default_tz at 0x7f76749f39c0>
json_schema_input_type = PydanticUndefined
- pydantic model aind_behavior_services.rig.Device[source]¶
Bases:
BaseModelA device in the rig configuration. All devices are expected to derive from this base class.
Show JSON schema
{ "title": "Device", "description": "A device in the rig configuration.\nAll devices are expected to derive from this base class.", "type": "object", "properties": { "device_type": { "description": "Device type", "title": "Device Type", "type": "string" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration for the device." } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" } }, "required": [ "device_type" ] }
- Fields:
calibration (pydantic.main.BaseModel | None)device_type (str)
- pydantic model aind_behavior_services.rig.Rig[source]¶
Bases:
SchemaVersionedModelBase model for rig configuration. All rig configurations should derive from this base class.
Show JSON schema
{ "title": "Rig", "description": "Base model for rig configuration. All rig configurations should derive from this base class.", "type": "object", "properties": { "aind_behavior_services_pkg_version": { "const": "0.13.0-rc2", "default": "0.13.0-rc2", "title": "aind_behavior_services package version", "type": "string" }, "version": { "description": "schema version", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", "title": "Version", "type": "string" }, "computer_name": { "description": "Computer name", "title": "Computer Name", "type": "string" }, "rig_name": { "description": "Rig name", "title": "Rig Name", "type": "string" }, "data_directory": { "description": "Directory where data will be saved to", "format": "path", "title": "Data Directory", "type": "string" } }, "required": [ "version", "computer_name", "rig_name", "data_directory" ] }
- Fields:
aind_behavior_services_pkg_version (Literal[__semver__])computer_name (str)data_directory (pathlib.Path)rig_name (str)version (str)
- Validators:
coerce_version»aind_behavior_services_pkg_versioncoerce_version»version
- field aind_behavior_services_pkg_version: Literal[__semver__] = '0.13.0-rc2'[source]¶
- Constraints:
pattern = ^(0|[1-9]d*).(0|[1-9]d*).(0|[1-9]d*)(?:-((?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*)(?:.(?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:+([0-9a-zA-Z-]+(?:.[0-9a-zA-Z-]+)*))?$
- Validated by: