Skip to content

Commit

Permalink
Disable corrections for spec once acquired
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Sep 28, 2023
1 parent 60a00fb commit b2e4712
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/gort/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit b2e4712

Please sign in to comment.