From b2e47122efe0b39108abeedf4c7c2308ba61d4e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Thu, 28 Sep 2023 16:20:14 -0600 Subject: [PATCH] Disable corrections for spec once acquired --- src/gort/observer.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/gort/observer.py b/src/gort/observer.py index 01c1d0ce..0d96bd19 100644 --- a/src/gort/observer.py +++ b/src/gort/observer.py @@ -20,7 +20,7 @@ import pandas from astropy.time import Time -from gort.exceptions import GortObserverError +from gort.exceptions import ErrorCodes, GortObserverError from gort.exposure import Exposure from gort.maskbits import GuiderStatus from gort.tile import Coordinates @@ -242,11 +242,16 @@ async def acquire(self, guide_tolerance: float = 1, timeout: float = 180): "Science telescope is not guiding.", error_code=801, ) - if tel == "spec" and not is_guiding: - raise GortObserverError( - "Spec telescope is not guiding.", - error_code=801, - ) + + if tel == "spec": + if not is_guiding: + raise GortObserverError( + "Spec telescope is not guiding.", + error_code=ErrorCodes.ACQUISITION_FAILED, + ) + else: + await self.gort.guiders.spec.apply_corrections(False) + if "sky" in tel and not is_guiding: self.write_to_log(f"{tel} telescope is not guiding.", "warning") @@ -908,6 +913,11 @@ async def _iterate(self, exposure_time: float): # Move mask to uncover fibre. await spec_tel.fibsel.move_to_position(new_mask_position) + # Do not guide. This means RA/Dec drifting will happen + # but not rotation drifting since we are guiding on a point + # source. + await self.gort.guiders.spec.apply_corrections(False) + n_observed += 1 t0_last_std = time()