Skip to content

Commit d543fba

Browse files
authored
Update photometry devices metadata in resources (calderast#117)
* Update photometry devices metadata in resources * Update tests for phot device metadata
1 parent 7145d21 commit d543fba

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
lines changed

resources/photometry_devices.yaml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,49 @@
11
# A running list of devices used for photometry. Reference individual devices by name in the metadata yaml file.
22

33
excitation_sources:
4-
- name: Purple LED
4+
- name: Blue LED
55
excitation_wavelength_in_nm: 470.0
66
manufacturer: ThorLabs
7-
model: M405FP1
7+
model: M470F3
88
illumination_type: LED
9-
- name: Blue LED
9+
- name: Purple LED
1010
excitation_wavelength_in_nm: 405.0
1111
manufacturer: ThorLabs
12-
model: M470F3
12+
model: M405FP1
13+
illumination_type: LED
14+
15+
# excitation sources for Doric minicube:
16+
# https://neuro.doriclenses.com/products/fmc7?productoption%5BPort%20Configuration%5D=Built-in%20LED%20and%20DETECTOR
17+
- name: Doric Blue LED
18+
excitation_wavelength_in_nm: 470.0
19+
manufacturer: Doric
20+
model: ilFMC7-G2
21+
illumination_type: LED
22+
- name: Doric Purple LED
23+
excitation_wavelength_in_nm: 405.0
24+
manufacturer: Doric
25+
model: ilFMC7-G2
26+
illumination_type: LED
27+
- name: Doric Green LED
28+
excitation_wavelength_in_nm: 565.0
29+
manufacturer: Doric
30+
model: ilFMC7-G2
1331
illumination_type: LED
1432

1533
optic_fibers:
1634
- name: Optic Fiber
17-
numerical_aperture: 0.39 # TODO get correct value for this
35+
numerical_aperture: 0.66 # TODO get correct value for this
1836
core_diameter_in_um: 200.0
1937

2038
photodetectors:
2139
- name: Newport Femtowatt Photoreceiver
2240
manufacturer: Newport
2341
model: "2151"
2442
detector_type: Silicon PIN photodiode
25-
detected_wavelength_in_nm: 0.0 # TODO modify extension to allow range (320-1050 nm)
43+
detected_wavelength_in_nm: 0.0 # TODO modify extension to allow range (320-1050 nm)
44+
45+
- name: Doric ilFMC7-G2 (Integrated LED Fluorescence Mini Cube 5 ports Gen.2)
46+
manufacturer: Doric
47+
model: "ilFMC7-G2"
48+
detector_type: Silicon photodiode
49+
detected_wavelength_in_nm: 960.0 # TODO modify extension to allow range (320-1050 nm) currently peak wavelength

src/jdb_to_nwb/convert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def create_nwbs(metadata_file_path: Path, output_nwb_dir: Path):
111111
subject = Subject(**metadata["subject"])
112112

113113
# Create session_id in {rat}_{date} format where date is YYYYMMDD
114-
session_id = f"{metadata.get("animal_name")}_{metadata.get("datetime").strftime("%Y%m%d")}"
114+
session_id = f"{metadata.get('animal_name')}_{metadata.get('datetime').strftime('%Y%m%d')}"
115115

116116
# Create directory for associated figures
117117
fig_dir = Path(output_nwb_dir) / f"{session_id}_figures"
@@ -192,7 +192,7 @@ def create_nwbs(metadata_file_path: Path, output_nwb_dir: Path):
192192
# Otherwise keep the default start time (00:00:00 Pacific Time on the session date)
193193
else:
194194
logger.warning("No photometry or ephys start time found, \nso session_start_time is the default start time: "
195-
f"{nwbfile.fields["session_start_time"]} (00:00:00 Pacific Time on the session date)")
195+
f"{nwbfile.fields['session_start_time']} (00:00:00 Pacific Time on the session date)")
196196

197197
# Set the timestamps reference time equal to the session start time
198198
nwbfile.fields["timestamps_reference_time"] = nwbfile.fields["session_start_time"]

tests/test_convert_photometry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,17 +398,17 @@ def test_add_photometry_metadata(dummy_logger):
398398
)
399399

400400
assert "Purple LED" in nwbfile.devices
401-
assert nwbfile.devices["Purple LED"].excitation_wavelength_in_nm == 470.0
401+
assert nwbfile.devices["Purple LED"].excitation_wavelength_in_nm == 405.0
402402
assert nwbfile.devices["Purple LED"].illumination_type == "LED"
403403
assert nwbfile.devices["Purple LED"].manufacturer == "ThorLabs"
404404
assert nwbfile.devices["Purple LED"].model == "M405FP1"
405405
assert "Blue LED" in nwbfile.devices
406-
assert nwbfile.devices["Blue LED"].excitation_wavelength_in_nm == 405.0
406+
assert nwbfile.devices["Blue LED"].excitation_wavelength_in_nm == 470.0
407407
assert nwbfile.devices["Blue LED"].illumination_type == "LED"
408408
assert nwbfile.devices["Blue LED"].manufacturer == "ThorLabs"
409409
assert nwbfile.devices["Blue LED"].model == "M470F3"
410410
assert "Optic Fiber" in nwbfile.devices
411-
assert nwbfile.devices["Optic Fiber"].numerical_aperture == 0.39
411+
assert nwbfile.devices["Optic Fiber"].numerical_aperture == 0.66
412412
assert nwbfile.devices["Optic Fiber"].core_diameter_in_um == 200.0
413413
assert "Newport Femtowatt Photoreceiver" in nwbfile.devices
414414
assert nwbfile.devices["Newport Femtowatt Photoreceiver"].manufacturer == "Newport"

0 commit comments

Comments
 (0)