Skip to content

Commit

Permalink
Make configurable rotator angle.
Browse files Browse the repository at this point in the history
  • Loading branch information
elanaku committed Nov 13, 2024
1 parent 28daca4 commit 548a236
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
25 changes: 19 additions & 6 deletions python/lsst/ts/externalscripts/base_take_twilight_flats.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ def get_schema(cls):
description: If True, track sky. If False, keep az and el constant.
type: boolean
default: True
rotator_angle:
description: Rotator angle in degrees relative to physical sky.
type: number
default: 0
ignore:
description: >-
CSCs from the camera group to ignore in status check.
Expand Down Expand Up @@ -507,7 +511,7 @@ async def take_twilight_flats(self):

# Take one 1s flat to calibrate the exposure time
self.log.info(
"Taking {self.config.min_exp_time}s flat to calibrate exposure time."
f"Taking {self.config.min_exp_time}s flat to calibrate exposure time."
)
exp_time = self.config.min_exp_time
# TODO: change from take_acq to take_sflat (DM-46675)
Expand Down Expand Up @@ -544,11 +548,20 @@ async def take_twilight_flats(self):
exp_time = self.config.max_exp_time

if exp_time < self.config.min_exp_time:
self.log.warning(
f"Calculated exposure time {exp_time} below min exposure time \
{self.config.min_exp_time}. Stopping."
)
break
if self.where_sun == "setting":
sleep_time = 30
self.log.warning(
f"Calculated exposure time {exp_time} below min exposure time \
{self.config.min_exp_time}. Waiting {sleep_time}s."
)
await asyncio.sleep(sleep_time)
continue
else:
self.log.warning(
f"Calculated exposure time {exp_time} below min exposure time \
{self.config.min_exp_time}. Stopping."
)
break

await self.checkpoint(
f"Taking flat {i+1} of {self.config.n_flat} with exposure time {exp_time}."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,15 @@ async def track_radec_and_setup_instrument(self, ra, dec):
dec : float
Dec of target field.
"""
current_filter = await self.comcam.get_current_filter()

self.tracking_started = True
await self.mtcs.slew_icrs(
ra=ra,
dec=dec,
rot_type=RotType.Physical,
rot=0,
)

current_filter = await self.comcam.get_current_filter()

if current_filter != self.config.filter:
self.log.debug(
Expand All @@ -197,8 +203,11 @@ async def track_radec_and_setup_instrument(self, ra, dec):
ra=ra,
dec=dec,
rot_type=RotType.PhysicalSky,
rot=self.config.rotator_angle,
)

self.tracking_started = True

async def slew_azel_and_setup_instrument(self, az, el):
"""Abstract method to set the instrument. Change the filter
and slew and track target.
Expand All @@ -225,6 +234,7 @@ async def slew_azel_and_setup_instrument(self, az, el):
await self.mtcs.point_azel(
az=az,
el=el,
rot_tel=self.config.rotator_angle,
)

async def configure(self, config):
Expand Down

0 comments on commit 548a236

Please sign in to comment.