Skip to content

Commit

Permalink
Slew to the coordinates that put the spec target on fibre
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jul 12, 2023
1 parent b4b9b23 commit afab2bf
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 @@ -17,6 +17,7 @@

from gort.exceptions import GortObserverError
from gort.tools import register_observation
from gort.transforms import fibre_slew_coordinates


if TYPE_CHECKING:
Expand Down Expand Up @@ -65,7 +66,10 @@ async def slew(self):

spec = None
if self.tile.spec_coords and len(self.tile.spec_coords) > 0:
spec = (self.tile.spec_coords[0].ra, self.tile.spec_coords[0].dec)
# For spec we slew to the fibre with which we'll observe first.
# This should save a bit of time converging.
spec_target = (self.tile.spec_coords[0].ra, self.tile.spec_coords[0].dec)
spec = fibre_slew_coordinates(*spec_target, self.mask_positions[0])
self.write_to_log(f"Spec: {self.tile.spec_coords[0]}")

sky = {}
Expand Down Expand Up @@ -378,12 +382,18 @@ async def _iterate_over_mask_positions(self, exposure_time: float):
# Moving the mask to an intermediate position while we move around.
await spec_tel.fibsel.move_relative(500)

# Slew to new coordinates.
# TODO: to speed up acquisition we should slew to the coordinates
# of the fibre, or do an offset just before beginning to guide.
await spec_tel.goto_coordinates(ra=new_coords.ra, dec=new_coords.dec)
# Slew to new coordinates. We actually slew to the coordinates
# that make the new star close to the fibre that will observe it.
slew_ra, slew_dec = fibre_slew_coordinates(
new_coords.ra,
new_coords.dec,
new_mask_position,
)
await spec_tel.goto_coordinates(ra=slew_ra, dec=slew_dec)

# Start to guide.
# Start to guide. Note that here we use the original coordinates
# of the star along with the pixel on the master frame on which to
# guide. See the note in fibre_slew_coordinates().
self.write_to_log("Starting to guide on spec telescope.")
await self.gort.guiders.spec.guide(
ra=new_coords.ra,
Expand Down

0 comments on commit afab2bf

Please sign in to comment.