Skip to content

Commit

Permalink
Merge pull request #169 from lsst-ts/tickets/DM-46458
Browse files Browse the repository at this point in the history
Tickets/dm 46458: Support Summit Observing Weeks 39-40 of 2024
  • Loading branch information
edennihy authored Oct 7, 2024
2 parents 2f8ace0 + ce52ab0 commit 17cbe73
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 20 deletions.
6 changes: 6 additions & 0 deletions doc/news/DM-46458.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Add feature to allow ``ATCalSys`` to skip monochromator configuration.

- In ``atcalsys_schema.yaml``, add default values for wavelength, entrace_slit and exit_slit.
Add option to set monochromator_grating to None to skip monchromator configuration and set None as default value.
- In ``atcalsys.py``, add feature to skip configuring monochromator if monchromator_grating is None.
- In ``atcalsys.yaml``, update monochromator configuration values for ptc curves to skip monchromator configuration.
38 changes: 22 additions & 16 deletions python/lsst/ts/observatory/control/auxtel/atcalsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ def __init__(
intended_usage: typing.Optional[int] = None,
latiss: typing.Optional[LATISS] = None,
) -> None:

self.electrometer_index = 201
self.fiberspectrograph_index = 3

Expand Down Expand Up @@ -199,16 +198,22 @@ async def prepare_for_flat(self, sequence_name: str) -> None:
"Make sure you are instantiating LATISS and passing it to ATCalsys."
)

grating_type = getattr(Grating, config_data["monochromator_grating"])
task_setup_monochromator = (
self.rem.atmonochromator.cmd_updateMonochromatorSetup.set_start(
wavelength=wavelength,
gratingType=grating_type.value,
fontExitSlitWidth=config_data["exit_slit"],
fontEntranceSlitWidth=config_data["entrance_slit"],
timeout=self.long_long_timeout,
if config_data["monochromator_grating"] is None:
self.log.info(
"Monochromator grating set to None, skipping monochromator configuration."
)
task_setup_monochromator = utils.make_done_future()
else:
grating_type = getattr(Grating, config_data["monochromator_grating"])
task_setup_monochromator = (
self.rem.atmonochromator.cmd_updateMonochromatorSetup.set_start(
wavelength=wavelength,
gratingType=grating_type.value,
fontExitSlitWidth=config_data["exit_slit"],
fontEntranceSlitWidth=config_data["entrance_slit"],
timeout=self.long_long_timeout,
)
)
)

task_setup_latiss = (
self.latiss.setup_instrument(
Expand Down Expand Up @@ -437,7 +442,8 @@ async def run_calibration_sequence(
self.log.debug(
f"Performing {calibration_type.name} calibration with {exposure.wavelength=}."
)
await self.change_wavelength(wavelength=exposure.wavelength)
if config_data["monochromator_grating"] is not None:
await self.change_wavelength(wavelength=exposure.wavelength)
_exposure_metadata = exposure_metadata.copy()
if "group_id" in _exposure_metadata:
_exposure_metadata["group_id"] += f"#{i+1}"
Expand Down Expand Up @@ -485,7 +491,6 @@ async def _take_data(
fiber_spectrum_exposure_time: float | None,
electrometer_exposure_time: float | None,
) -> dict:

assert self.latiss is not None

latiss_exposure_task = self.latiss.take_flats(
Expand Down Expand Up @@ -518,10 +523,11 @@ async def _take_data(
latiss_exposure_id = await latiss_exposure_task
finally:
exposures_done.set_result(True)
fiber_spectrum_exposure_result, electrometer_exposure_result = (
await asyncio.gather(
fiber_spectrum_exposure_task, electrometer_exposure_task
)
(
fiber_spectrum_exposure_result,
electrometer_exposure_result,
) = await asyncio.gather(
fiber_spectrum_exposure_task, electrometer_exposure_task
)

return {
Expand Down
6 changes: 3 additions & 3 deletions python/lsst/ts/observatory/control/data/atcalsys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ptc_1:
atspec_filter: SDSSr_65mm
atspec_grating: empty_1
wavelength: 500.0
monochromator_grating: MIRROR
monochromator_grating: null
exit_slit: 7.0
entrance_slit: 7.0
electrometer_integration_time: 0.1
Expand Down Expand Up @@ -168,7 +168,7 @@ ptc_2:
atspec_filter: SDSSr_65mm
atspec_grating: empty_1
wavelength: 500.0
monochromator_grating: MIRROR
monochromator_grating: null
exit_slit: 7.0
entrance_slit: 7.0
electrometer_integration_time: 0.1
Expand Down Expand Up @@ -251,7 +251,7 @@ ptc_3:
atspec_filter: SDSSr_65mm
atspec_grating: empty_1
wavelength: 500.0
monochromator_grating: MIRROR
monochromator_grating: null
exit_slit: 7.0
entrance_slit: 7.0
electrometer_integration_time: 0.1
Expand Down
9 changes: 8 additions & 1 deletion python/lsst/ts/observatory/control/data/atcalsys_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,27 @@ properties:
atspec_grating:
type: string
wavelength:
default: 500.0
type: number
wavelength_width:
type: number
wavelength_resolution:
type: number
monochromator_grating:
type: string
default: null
type:
- string
- "null"
enum:
- MIRROR
- RED
- BLUE
- null
exit_slit:
default: 7.0
type: number
entrance_slit:
default: 7.0
type: number
electrometer_integration_time:
type: number
Expand Down

0 comments on commit 17cbe73

Please sign in to comment.