Skip to content
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

updates channel #1222

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/exaspim_acquisition.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"file_name": "tile_X_0000_Y_0000_Z_0000_CH_488.ims",
"channel": {
"channel_name": "488",
"intended_measurement": null,
"light_source_name": "Ex_488",
"filter_names": [
"Em_600"
Expand All @@ -96,6 +97,8 @@
"excitation_power": 200.0,
"excitation_power_unit": "milliwatt",
"filter_wheel_index": 0,
"emission_wavelength": null,
"emission_wavelength_unit": "nanometer",
"dilation": null,
"dilation_unit": "pixel",
"description": null
Expand Down Expand Up @@ -128,6 +131,7 @@
"file_name": "tile_X_0000_Y_0000_Z_0000_CH_561.ims",
"channel": {
"channel_name": "561",
"intended_measurement": null,
"light_source_name": "Ex_561",
"filter_names": [
"Em_600"
Expand All @@ -139,6 +143,8 @@
"excitation_power": 200.0,
"excitation_power_unit": "milliwatt",
"filter_wheel_index": 0,
"emission_wavelength": null,
"emission_wavelength_unit": "nanometer",
"dilation": null,
"dilation_unit": "pixel",
"description": null
Expand Down
46 changes: 43 additions & 3 deletions examples/ophys_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,53 @@
"patch_cord_name": "Patch Cord A",
"patch_cord_output_power": "40",
"output_power_unit": "microwatt",
"fiber_name": "Fiber A"
"fiber_name": "Fiber A",
"channel": {
"channel_name": "Channel A",
"intended_measurement": "Dopamine",
"light_source_name": "Laser A",
"filter_names": [
"Excitation filter 410nm"
],
"detector_name": "Green CMOS",
"additional_device_names": [],
"excitation_wavelength": 410,
"excitation_wavelength_unit": "nanometer",
"excitation_power": 10.0,
"excitation_power_unit": "milliwatt",
"filter_wheel_index": null,
"emission_wavelength": 600,
"emission_wavelength_unit": "nanometer",
"dilation": null,
"dilation_unit": "pixel",
"description": null
}
},
{
"patch_cord_name": "Patch Cord B",
"patch_cord_output_power": "43",
"output_power_unit": "microwatt",
"fiber_name": "Fiber B"
"fiber_name": "Fiber B",
"channel": {
"channel_name": "Channel B",
"intended_measurement": "Dopamine",
"light_source_name": "Laser B",
"filter_names": [
"Excitation filter 560nm"
],
"detector_name": "Red CMOS",
"additional_device_names": [],
"excitation_wavelength": 560,
"excitation_wavelength_unit": "nanometer",
"excitation_power": 7.0,
"excitation_power_unit": "milliwatt",
"filter_wheel_index": null,
"emission_wavelength": 700,
"emission_wavelength_unit": "nanometer",
"dilation": null,
"dilation_unit": "pixel",
"description": null
}
}
],
"fiber_modules": [],
Expand All @@ -78,7 +118,7 @@
}
],
"software": [],
"notes": "Internal trigger. GRAB-DA2m shows signal. Unclear about GRAB-rAC"
"notes": "Internal trigger."
}
],
"stimulus_epochs": [],
Expand Down
23 changes: 22 additions & 1 deletion examples/ophys_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from aind_data_schema_models.modalities import Modality

from aind_data_schema.components.tile import Channel
from aind_data_schema.core.session import DetectorConfig, FiberConnectionConfig, LaserConfig, Session, Stream

t = datetime(2022, 7, 12, 7, 00, 00, tzinfo=timezone.utc)
Expand Down Expand Up @@ -46,15 +47,35 @@
patch_cord_output_power=40,
output_power_unit="microwatt",
fiber_name="Fiber A",
channel=Channel(
channel_name="Channel A",
intended_measurement="Dopamine",
light_source_name="Laser A",
filter_names=["Excitation filter 410nm"],
detector_name="Green CMOS",
excitation_wavelength=410,
excitation_power=10,
emission_wavelength=600,
)
),
FiberConnectionConfig(
patch_cord_name="Patch Cord B",
patch_cord_output_power=43,
output_power_unit="microwatt",
fiber_name="Fiber B",
channel=Channel(
channel_name="Channel B",
intended_measurement="Dopamine",
light_source_name="Laser B",
filter_names=["Excitation filter 560nm"],
detector_name="Red CMOS",
excitation_wavelength=560,
excitation_power=7,
emission_wavelength=700,
)
),
],
notes="Internal trigger. GRAB-DA2m shows signal. Unclear about GRAB-rAC",
notes="Internal trigger.",
)
],
)
Expand Down
12 changes: 8 additions & 4 deletions src/aind_data_schema/components/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,21 @@ class Channel(AindModel):
"""Description of a channel"""

channel_name: str = Field(..., title="Channel")
intended_measurement: Optional[str] = Field(default=None, title="Intended measurement",
description="What signal is this channel measuring")
light_source_name: str = Field(..., title="Light source name", description="Must match device name")
filter_names: List[str] = Field(..., title="Filter names", description="Must match device names")
detector_name: str = Field(..., title="Detector name", description="Must match device name")
additional_device_names: List[str] = Field(default=[], title="Additional device names")
# excitation
excitation_wavelength: int = Field(..., title="Wavelength", ge=300, le=1000)
excitation_wavelength_unit: SizeUnit = Field(default=SizeUnit.NM, title="Laser wavelength unit")
excitation_power: float = Field(..., title="Laser power", le=2000)
excitation_power_unit: PowerUnit = Field(default=PowerUnit.MW, title="Laser power unit")
excitation_wavelength_unit: SizeUnit = Field(default=SizeUnit.NM, title="Wavelength unit")
excitation_power: float = Field(..., title="Light source power", le=2000)
excitation_power_unit: PowerUnit = Field(default=PowerUnit.MW, title="Light source power unit")
# emission
filter_wheel_index: int = Field(..., title="Filter wheel index")
filter_wheel_index: Optional[int] = Field(default=None, title="Filter wheel index")
emission_wavelength: Optional[int] = Field(default=None, title="Emission wavelength")
emission_wavelength_unit: SizeUnit = Field(default=SizeUnit.NM, title="Wavelength unit")
# dilation
dilation: Optional[int] = Field(default=None, title="Dilation (pixels)")
dilation_unit: SizeUnit = Field(default=SizeUnit.PX, title="Dilation unit")
Expand Down
1 change: 1 addition & 0 deletions src/aind_data_schema/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class FiberConnectionConfig(AindModel):
patch_cord_output_power: Decimal = Field(..., title="Output power (uW)")
output_power_unit: PowerUnit = Field(default=PowerUnit.UW, title="Output power unit")
fiber_name: str = Field(..., title="Fiber name (must match procedure)")
channel: Channel = Field(..., title="Channel")


class TriggerType(str, Enum):
Expand Down
21 changes: 21 additions & 0 deletions tests/test_rig_session_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from aind_data_schema_models.organizations import Organization

import aind_data_schema.components.devices as d
from aind_data_schema.components.tile import Channel
import aind_data_schema.core.rig as r
from aind_data_schema.components.devices import (
Calibration,
Expand Down Expand Up @@ -809,12 +810,32 @@ def read_json(filepath: Path) -> dict:
patch_cord_output_power=40,
output_power_unit="microwatt",
fiber_name="Fiber A",
channel=Channel(
channel_name="Channel A",
intended_measurement="Dopamine",
light_source_name="Laser A",
filter_names=["Excitation filter 410nm"],
detector_name="Green CMOS",
excitation_wavelength=410,
excitation_power=10,
emission_wavelength=600,
)
),
FiberConnectionConfig(
patch_cord_name="Patch Cord B",
patch_cord_output_power=43,
output_power_unit="microwatt",
fiber_name="Fiber B",
channel=Channel(
channel_name="Channel B",
intended_measurement="Dopamine",
light_source_name="Laser B",
filter_names=["Excitation filter 560nm"],
detector_name="Red CMOS",
excitation_wavelength=560,
excitation_power=7,
emission_wavelength=700,
)
),
],
notes="Internal trigger. GRAB-DA2m shows signal. Unclear about GRAB-rAC",
Expand Down
Loading