Skip to content

Commit

Permalink
Merge pull request #139 from lsst-ts/tickets/DM-43628
Browse files Browse the repository at this point in the history
initial commit to MTCalsys
  • Loading branch information
parfa30 authored Sep 5, 2024
2 parents 30d6189 + 9a6b61e commit a43ac20
Show file tree
Hide file tree
Showing 8 changed files with 1,181 additions and 7 deletions.
1 change: 1 addition & 0 deletions doc/news/DM-43628.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds initial implementation of MTCalsys.
12 changes: 7 additions & 5 deletions python/lsst/ts/observatory/control/auxtel/atcalsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ async def change_wavelength(self, wavelength: float) -> None:
)

async def is_ready_for_flats(self) -> bool:
"""Add doctring"""
"""Designates if the calibraiton hardware is in a state
to take flats.
"""
# TODO (DM-44310): Implement method to check that the
# system is ready for flats.
return True
Expand All @@ -170,12 +172,12 @@ async def setup_calsys(self, sequence_name: str) -> None:
await self.switch_lamp_on()
await self.wait_for_lamp_to_warm_up()

async def prepare_for_flat(self, config_name: str) -> None:
async def prepare_for_flat(self, sequence_name: str) -> None:
"""Configure the ATMonochromator according to the flat parameters
Parameters
----------
config_name : `str`
sequence_name : `str`
name of the type of configuration you will run, which is saved
in the configuration.yaml files
Expand All @@ -184,7 +186,7 @@ async def prepare_for_flat(self, config_name: str) -> None:
RuntimeError:
"""
config_data = self.get_calibration_configuration(config_name)
config_data = self.get_calibration_configuration(sequence_name)

wavelength = (
float(config_data["wavelength"])
Expand All @@ -204,7 +206,7 @@ async def prepare_for_flat(self, config_name: str) -> None:

if self.latiss is None and config_data["use_camera"]:
raise RuntimeError(
f"LATISS is not defined but {config_name} requires it. "
f"LATISS is not defined but {sequence_name} requires it. "
"Make sure you are instantiating LATISS and passing it to ATCalsys."
)
task_setup_latiss = (
Expand Down
26 changes: 25 additions & 1 deletion python/lsst/ts/observatory/control/base_calsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ async def setup_calsys(self, sequence_name: str) -> None:
raise NotImplementedError()

@abc.abstractmethod
async def prepare_for_flat(self, config_name: str) -> None:
async def prepare_for_flat(self, sequence_name: str) -> None:
"""Configure calibration system to be ready to take a flat
Parameters
Expand Down Expand Up @@ -159,6 +159,30 @@ async def run_calibration_sequence(
"""
raise NotImplementedError()

@abc.abstractmethod
async def calculate_optimized_exposure_times(
self, wavelengths: list, config_data: dict
) -> list:
"""Calculates the exposure times for the electrometer and
fiber spectrograph given the type and wavelength of the exposure
and the length of the camera exposure time
Parameters
----------
wavelengths : `list`
List of all wavelengths for this exposure list
config_data : `dict`
All information from configuration file
Returns
-------
exposure_list : `list`[ATCalsysExposure|MTCalsysExposure]
List of exposure information, includes wavelength
and camera, fiberspectrograph and electrometer exposure times.
"""
# TO-DO: DM-44777
raise NotImplementedError()

def load_calibration_config_file(self, filename: str | None = None) -> None:
"""Load the calibration configuration file.
Expand Down
132 changes: 132 additions & 0 deletions python/lsst/ts/observatory/control/data/mtcalsys.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Configuration for calibration hardware setup
# Created 2024-07-15

whitelight_u:
calib_type: WhiteLight
use_camera: true
mtcamera_filter: u
led_name:
- M385L3
wavelength: 385.0
led_location: 210.21
led_focus: 50.68
use_electrometer: true
use_fiberspectrograph_red: true
use_fiberspectrograph_blue: true
electrometer_integration_time: 0.1
electrometer_mode: CURRENT
electrometer_range: -1
exposure_times:
- 15.0

whitelight_g:
calib_type: WhiteLight
use_camera: true
mtcamera_filter: g
led_name:
- M455L4
- M505L4
wavelength: 480.0
led_location: 9.15
led_focus: 17.029
use_electrometer: true
use_fiberspectrograph_red: true
use_fiberspectrograph_blue: true
electrometer_integration_time: 0.1
electrometer_mode: CURRENT
electrometer_range: -1
exposure_times:
- 15.0

whitelight_r:
calib_type: WhiteLight
use_camera: true
mtcamera_filter: r
led_name:
- M565L3
- M660L4
wavelength: 612.5
led_location: 70.40
led_focus: 16.279
use_electrometer: true
use_fiberspectrograph_red: true
use_fiberspectrograph_blue: true
electrometer_integration_time: 0.1
electrometer_mode: CURRENT
electrometer_range: -1
exposure_times:
- 15.0

whitelight_i:
calib_type: WhiteLight
use_camera: true
mtcamera_filter: i
led_name:
- M730L5
- M780LP1
wavelength: 755.0
led_location: 237.36
led_focus: 15.829
use_electrometer: true
use_fiberspectrograph_red: true
use_fiberspectrograph_blue: true
electrometer_integration_time: 0.1
electrometer_mode: CURRENT
electrometer_range: -1
exposure_times:
- 15.0

whitelight_z:
calib_type: WhiteLight
use_camera: true
mtcamera_filter: z
led_name:
- M850L3
- M940L3
wavelength: 895.0
led_location: 299.034
led_focus: 15.505
use_electrometer: true
use_fiberspectrograph_red: true
use_fiberspectrograph_blue: true
electrometer_integration_time: 0.1
electrometer_mode: CURRENT
electrometer_range: -1
exposure_times:
- 15.0

whitelight_y:
calib_type: WhiteLight
use_camera: true
mtcamera_filter: y
led_name:
- M970L4
wavelength: 970.0
led_location: 174.91
led_focus: 15.380
use_electrometer: true
use_fiberspectrograph_red: true
use_fiberspectrograph_blue: true
electrometer_integration_time: 0.1
electrometer_mode: CURRENT
electrometer_range: -1
exposure_times:
- 15.0

scan_r:
calib_type: Mono
use_camera: true
mtcamera_filter: r
led_location: 174.91
led_focus: 15.380
wavelength: 625.0
wavelength_width: 250
wavelength_resolution: 5.0
use_electrometer: true
use_fiberspectrograph_red: true
use_fiberspectrograph_blue: true
electrometer_integration_time: 0.1
electrometer_mode: CURRENT
electrometer_range: -1
exposure_times:
- 15.0
2 changes: 2 additions & 0 deletions python/lsst/ts/observatory/control/maintel/comcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ComCamUsages(Usages):

TakeImage = 1 << 3
TakeImageFull = 1 << 4
DryTest = 1 << 6

def __iter__(self) -> typing.Iterator[int]:
return iter(
Expand All @@ -56,6 +57,7 @@ def __iter__(self) -> typing.Iterator[int]:
self.MonitorHeartBeat,
self.TakeImage,
self.TakeImageFull,
self.DryTest,
]
)

Expand Down
Loading

0 comments on commit a43ac20

Please sign in to comment.