From 73fbc775cb292090c0dfe91b9f55ab7de3adb2dc Mon Sep 17 00:00:00 2001 From: edennihy Date: Thu, 8 Aug 2024 10:27:33 -0700 Subject: [PATCH 1/3] In base_tcs.py, expand captured rotator limit exceptions during slew cmd. --- .../lsst/ts/observatory/control/base_tcs.py | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/python/lsst/ts/observatory/control/base_tcs.py b/python/lsst/ts/observatory/control/base_tcs.py index 3ef8e64d..3b8067a8 100644 --- a/python/lsst/ts/observatory/control/base_tcs.py +++ b/python/lsst/ts/observatory/control/base_tcs.py @@ -648,11 +648,21 @@ async def slew_icrs( offset_y=offset_y, ) except salobj.AckError as ack_error: - if "Target out of rotator limit" in ack_error.ackcmd.result: + if "rotator position angle out of range" in ack_error.ackcmd.result: self.log.warning( "Target out of rotator limit. Trying different angle." ) continue + elif "Target out of rotator limit" in ack_error.ackcmd.result: + self.log.warning( + "Target out of rotator limit. Trying different angle." + ) + continue + elif "out of slew limit margin" in ack_error.ackcmd.result: + self.log.warning( + "Target out of rotator slew limit margin. Trying different angle." + ) + continue else: raise ack_error except Exception as e: @@ -660,18 +670,29 @@ async def slew_icrs( break else: if self._overslew_az: - overslew_az = 2.0 * 3600.0 * np.cos(alt_az.alt.rad) - self.log.info( - "Overslew Azimuth feature is enabled. Slewing past target position by" - f"{(overslew_az/3600.):.1f} degrees and waiting for settle." - ) - await asyncio.sleep(self.tel_settle_time) - await self.offset_azel(az=overslew_az, el=0, relative=False) - await asyncio.sleep(self.tel_settle_time) - self.log.info("Slewing back to target position.") - await self.offset_azel(az=0, el=0, relative=False) + try: + overslew_az = 2.0 * 3600.0 * np.cos(alt_az.alt.rad) + self.log.info( + "Overslew Azimuth feature is enabled. Slewing past target position by" + f"{(overslew_az/3600.):.1f} degrees and waiting for settle." + ) + await asyncio.sleep(self.tel_settle_time) + await self.offset_azel(az=overslew_az, el=0, relative=False) + await asyncio.sleep(self.tel_settle_time) + self.log.info("Slewing back to target position.") + await self.offset_azel(az=0, el=0, relative=False) + except salobj.AckError as ack_error: + if ( + "out of range" + or "out of slew limit" in ack_error.ackcmd.result + ): + self.log.warning( + "Overslew is out of operational limits. Skipping overslew." + ) + continue + else: + raise ack_error break - if slew_exception is not None: raise slew_exception From b89e9976201300ac0e2dda52a661c0d057d2e7a2 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Tue, 20 Aug 2024 11:28:34 -0400 Subject: [PATCH 2/3] In atcalsys, pass group_id metadata to the electromer and fiber spectrograph when taking data. --- python/lsst/ts/observatory/control/auxtel/atcalsys.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python/lsst/ts/observatory/control/auxtel/atcalsys.py b/python/lsst/ts/observatory/control/auxtel/atcalsys.py index be3fbf67..a1faa11e 100644 --- a/python/lsst/ts/observatory/control/auxtel/atcalsys.py +++ b/python/lsst/ts/observatory/control/auxtel/atcalsys.py @@ -474,10 +474,12 @@ async def _take_data( fiber_spectrum_exposure_coroutine = self.take_fiber_spectrum( exposure_time=fiber_spectrum_exposure_time, exposures_done=exposures_done, + group_id=exposure_metadata.get("group_id", ""), ) electrometer_exposure_coroutine = self.take_electrometer_scan( exposure_time=electrometer_exposure_time, exposures_done=exposures_done, + group_id=exposure_metadata.get("group_id", ""), ) try: fiber_spectrum_exposure_task = asyncio.create_task( @@ -507,6 +509,7 @@ async def take_electrometer_scan( self, exposure_time: float | None, exposures_done: asyncio.Future, + group_id: str, ) -> list[str]: """Perform an electrometer scan for the specified duration. @@ -516,6 +519,8 @@ async def take_electrometer_scan( Exposure time for the fiber spectrum (seconds). exposures_done : `asyncio.Future` A future indicating when the camera exposures where complete. + group_id : `str` + Group ID for this data. Returns ------- @@ -531,6 +536,7 @@ async def take_electrometer_scan( try: await self.electrometer.cmd_startScanDt.set_start( scanDuration=exposure_time, + groupId=group_id, timeout=exposure_time + self.long_timeout, ) except salobj.AckTimeoutError: @@ -556,6 +562,7 @@ async def take_fiber_spectrum( self, exposure_time: float | None, exposures_done: asyncio.Future, + group_id: str, ) -> list[str]: """Take exposures with the fiber spectrograph until the exposures with the camera are complete. @@ -569,6 +576,8 @@ async def take_fiber_spectrum( Exposure time for the fiber spectrum (seconds). exposures_done : `asyncio.Future` A future indicating when the camera exposures where complete. + group_id : str + Group id for the data. Returns ------- @@ -584,6 +593,7 @@ async def take_fiber_spectrum( await self.fiberspectrograph.cmd_expose.set_start( duration=exposure_time, numExposures=1, + groupId=group_id, timeout=exposure_time + self.long_timeout, ) except salobj.AckTimeoutError: From 44d58e7e2105080327b3cbe8c8c4f93565a5aef7 Mon Sep 17 00:00:00 2001 From: edennihy Date: Tue, 27 Aug 2024 15:12:02 -0700 Subject: [PATCH 3/3] Add news fragments. --- doc/news/DM-45696.feature.1.rst | 1 + doc/news/DM-45696.feature.2.rst | 1 + 2 files changed, 2 insertions(+) create mode 100644 doc/news/DM-45696.feature.1.rst create mode 100644 doc/news/DM-45696.feature.2.rst diff --git a/doc/news/DM-45696.feature.1.rst b/doc/news/DM-45696.feature.1.rst new file mode 100644 index 00000000..23929d37 --- /dev/null +++ b/doc/news/DM-45696.feature.1.rst @@ -0,0 +1 @@ +In base_tcs.py, expand captured rotator limit exceptions during slew cmd. diff --git a/doc/news/DM-45696.feature.2.rst b/doc/news/DM-45696.feature.2.rst new file mode 100644 index 00000000..3c2c4d0d --- /dev/null +++ b/doc/news/DM-45696.feature.2.rst @@ -0,0 +1 @@ +In atcalsys, pass group_id metadata to the electromer and fiber spectrograph when taking data.