-
Notifications
You must be signed in to change notification settings - Fork 0
Corrects metadata #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Corrects metadata #154
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
06cfd65
fix: update instrument metadata mapper per issue DF-Refactoring#173
micahwoodard a1d9385
fix: update acquisition mapper per issue DF-Refactoring#172
micahwoodard 6fdc731
adds additional metadata
micahwoodard 17cdda5
fix: add required notes for LickSpout with Other manufacturer
micahwoodard 6e442d4
adds note for other manufacturer
micahwoodard 9f8358f
use task_logic.name for acquisition_type and adds camera note
micahwoodard 03178fd
improves camera note
micahwoodard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ | |
| from aind_behavior_services.rig import water_valve as abs_water_valve | ||
| from aind_behavior_services.utils import get_fields_of_type, utcnow | ||
| from aind_data_schema.components.connections import Connection | ||
| from aind_data_schema.components.coordinates import Axis, AxisName, CoordinateSystem, Direction, Origin | ||
| from aind_data_schema.components.coordinates import Axis, AxisName, CoordinateSystem, Direction, Origin, Scale | ||
| from aind_data_schema.components.devices import ( | ||
| AnatomicalRelative, | ||
| Camera, | ||
|
|
@@ -20,11 +20,17 @@ | |
| Cooling, | ||
| DataInterface, | ||
| Device, | ||
| Enclosure, | ||
| HarpDevice, | ||
| HarpDeviceType, | ||
| Lens, | ||
| LickSensorType, | ||
| LickSpout, | ||
| LickSpoutAssembly, | ||
| LightEmittingDiode, | ||
| MotorizedStage, | ||
| SizeUnit, | ||
| Tube, | ||
| ) | ||
| from aind_data_schema.components.measurements import CalibrationFit, FitType, GenericModel, VolumeCalibration | ||
| from aind_data_schema.core.acquisition import CALIBRATIONS | ||
|
|
@@ -140,6 +146,13 @@ def _map(self) -> Instrument: | |
| controller = rig.triggered_camera_controller | ||
| fps = float(controller.frame_rate) if controller.frame_rate else float("nan") | ||
| for name, cam in rig.triggered_camera_controller.cameras.items(): | ||
| additional_settings = cam.model_dump() | ||
| additional_settings["note"] = ( | ||
| "The additional_settings values are the input parameters used to initialize the camera. Model found at https://github.com/AllenNeuralDynamics/Aind.Behavior.Services/blob/a6c0f539275f73af87da82a8ea0101836389f1b3/src/aind_behavior_services/rig/cameras.py#L226. Enum clarifications: adc_bit_depth is an " | ||
| "Spinnaker SDK enum-coded value (0=ADC8BIT, 1=ADC10BIT, 2=ADC12BIT), and pixel_format " | ||
| "is also enum-coded (for this configuration, 0=MONO8)." | ||
| ) | ||
|
|
||
| camera = Camera( | ||
| name=name, | ||
| manufacturer=Organization.FLIR, | ||
|
|
@@ -160,7 +173,7 @@ def _map(self) -> Instrument: | |
| crop_width=cam.region_of_interest.width if cam.region_of_interest.width > 0 else None, | ||
| crop_height=cam.region_of_interest.height if cam.region_of_interest.height > 0 else None, | ||
| crop_unit=SizeUnit.PX, | ||
| additional_settings=GenericModel.model_validate(cam.model_dump()), | ||
| additional_settings=GenericModel.model_validate(additional_settings), | ||
| ) | ||
| assembly = CameraAssembly( | ||
| name=f"{name}Assembly", | ||
|
|
@@ -269,32 +282,90 @@ def _map(self) -> Instrument: | |
| ) | ||
| ) | ||
|
|
||
| # manipulator\ | ||
| # lick spout assembly | ||
| components.append( | ||
| MotorizedStage( | ||
| name="motorized_stage", | ||
| manufacturer=Organization.AIND, | ||
| model="328-300-00", | ||
| travel=Decimal("30"), | ||
| travel_unit=SizeUnit.CM, | ||
| notes="This stage is driven by the manipulator device.", | ||
| LickSpoutAssembly( | ||
| name="LickSpoutAssembly", | ||
| lick_spouts=[ | ||
| LickSpout( | ||
| name="Left lick spout", | ||
| manufacturer=Organization.OTHER, | ||
| notes=" (v1v2 upgrade): 'manufacturer' field was missing, defaulting to 'Other'.", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| spout_diameter=Decimal("1.2"), | ||
| spout_diameter_unit=SizeUnit.MM, | ||
| solenoid_valve=Device( | ||
| name="Solenoid Left", | ||
| manufacturer=Organization.THE_LEE_COMPANY, | ||
| model="LHDB1233518H", | ||
| ), | ||
| lick_sensor=Device( | ||
| name="Lick Sensor Left", | ||
| manufacturer=Organization.JANELIA, | ||
| ), | ||
| lick_sensor_type=LickSensorType.CAPACITIVE, | ||
| ), | ||
| LickSpout( | ||
| name="Right lick spout", | ||
| manufacturer=Organization.OTHER, | ||
| notes="Lick spout manufacturer is unknown.", | ||
| spout_diameter=Decimal("1.2"), | ||
| spout_diameter_unit=SizeUnit.MM, | ||
| solenoid_valve=Device( | ||
| name="Solenoid Right", | ||
| manufacturer=Organization.THE_LEE_COMPANY, | ||
| model="LHDB1233518H", | ||
| ), | ||
| lick_sensor=Device( | ||
| name="Lick Sensor Right", | ||
| manufacturer=Organization.JANELIA, | ||
| ), | ||
| lick_sensor_type=LickSensorType.CAPACITIVE, | ||
| ), | ||
| ], | ||
| motorized_stage=MotorizedStage( | ||
| name="motorized_stage", | ||
| manufacturer=Organization.AIND, | ||
| model="328-300-00", | ||
| travel=Decimal("30"), | ||
| travel_unit=SizeUnit.MM, | ||
| notes="This stage is driven by the manipulator device.", | ||
| ), | ||
| ) | ||
| ) | ||
|
|
||
| # solenoid | ||
| # mouse platform | ||
| components.append( | ||
| Device( | ||
| name="left_water_valve_solenoid", | ||
| manufacturer=Organization.THE_LEE_COMPANY, | ||
| model="LHDB1233518H", | ||
| Tube( | ||
| name="mouse_tube_foraging", | ||
| manufacturer=Organization.CUSTOM, | ||
| diameter=Decimal("3.0"), | ||
| diameter_unit=SizeUnit.CM, | ||
| ) | ||
| ) | ||
|
|
||
| # IR light source | ||
| components.append( | ||
| Device( | ||
| name="right_water_valve_solenoid", | ||
| manufacturer=Organization.THE_LEE_COMPANY, | ||
| model="LHDB1233518H", | ||
| LightEmittingDiode( | ||
| name="IR LED", | ||
| manufacturer=Organization.THORLABS, | ||
| model="M810L5", | ||
| wavelength=810, | ||
| ) | ||
| ) | ||
|
|
||
| # enclosure | ||
| components.append( | ||
| Enclosure( | ||
| name="Behavior enclosure", | ||
| manufacturer=Organization.AIND, | ||
| size=Scale(scale=[54, 54, 54]), | ||
| size_unit=SizeUnit.CM, | ||
| internal_material="", | ||
| external_material="", | ||
| grounded=False, | ||
| laser_interlock=False, | ||
| air_filtration=False, | ||
| notes=" (v1v2 upgrade): Scale is width/length/height", | ||
| ) | ||
| ) | ||
|
|
||
|
|
@@ -317,14 +388,12 @@ def _map(self) -> Instrument: | |
| connections.append( | ||
| Connection( | ||
| source_device="BehaviorBoard", | ||
| target_device="left_water_valve_solenoid", | ||
| target_device="Solenoid Left", | ||
| source_port="SupplyPort0", | ||
| ) | ||
| ) | ||
| connections.append( | ||
| Connection( | ||
| source_device="BehaviorBoard", target_device="right_water_valve_solenoid", source_port="SupplyPort1" | ||
| ) | ||
| Connection(source_device="BehaviorBoard", target_device="Solenoid Right", source_port="SupplyPort1") | ||
| ) | ||
|
|
||
| return Instrument( | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.