Skip to content

Commit

Permalink
Use supplemented_group_id in close loop script
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeyers314 committed Nov 24, 2024
1 parent ddf41fa commit f0ff641
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions doc/news/DM-47780.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use supplemented_group_id ``maintel/base_close_loop.py``.
21 changes: 13 additions & 8 deletions python/lsst/ts/standardscripts/maintel/base_close_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def set_metadata(self, metadata: salobj.type_hints.BaseMsgType) -> None:

async def take_intra_extra_focal_images(
self,
supplemented_group_id: str,
) -> typing.Tuple[typing.Any, typing.Any]:
"""Take intra and extra focal images.
Expand All @@ -347,7 +348,7 @@ async def take_intra_extra_focal_images(
intra_image = await self.camera.take_cwfs(
exptime=self.exposure_time,
n=1,
group_id=self.group_id,
group_id=supplemented_group_id,
filter=self.filter,
reason="INTRA" + ("" if self.reason is None else f"_{self.reason}"),
program=self.program,
Expand All @@ -368,7 +369,7 @@ async def take_intra_extra_focal_images(
extra_image = await self.camera.take_cwfs(
exptime=self.exposure_time,
n=1,
group_id=self.group_id,
group_id=supplemented_group_id,
filter=self.filter,
reason="EXTRA" + ("" if self.reason is None else f"_{self.reason}"),
program=self.program,
Expand All @@ -395,11 +396,13 @@ async def wait_for_images_in_oods(self):
except asyncio.TimeoutError:
self.log.warning("Timeout waiting for images in OODS.")

async def handle_fam_mode(self) -> None:
async def handle_fam_mode(self, supplemented_group_id: str) -> None:
"""Handle Full Array Mode."""

# Take intra and extra focal images
intra_image, extra_image = await self.take_intra_extra_focal_images()
intra_image, extra_image = await self.take_intra_extra_focal_images(
supplemented_group_id
)

# Set intra and extra visit id
intra_visit_id = int(intra_image[0])
Expand All @@ -408,7 +411,7 @@ async def handle_fam_mode(self) -> None:
take_infocus_image_task = asyncio.create_task(
self.camera.take_acq(
self.exposure_time,
group_id=self.group_id,
group_id=supplemented_group_id,
reason="INFOCUS" + ("" if self.reason is None else f"_{self.reason}"),
program=self.program,
filter=self.filter,
Expand All @@ -426,13 +429,13 @@ async def handle_fam_mode(self) -> None:
)
await take_infocus_image_task

async def handle_cwfs_mode(self) -> None:
async def handle_cwfs_mode(self, supplemented_group_id: str) -> None:
"""Handle CWFS mode."""

# Take in-focus image
image = await self.camera.take_acq(
self.exposure_time,
group_id=self.group_id,
group_id=supplemented_group_id,
reason="INFOCUS" + ("" if self.reason is None else f"_{self.reason}"),
program=self.program,
filter=self.filter,
Expand Down Expand Up @@ -539,7 +542,9 @@ async def arun(self, checkpoint: bool = False) -> None:
)

# Run the operational mode handler function.
await self.operation_model_handlers[self.mode]()
await self.operation_model_handlers[self.mode](
self.next_supplemented_group_id()
)

# Retrieve the rotation angle after taking data.
end_rotation_angle = await self.mtcs.rem.mtrotator.tel_rotation.next(
Expand Down

0 comments on commit f0ff641

Please sign in to comment.