Skip to content

Commit

Permalink
Merge pull request #246 from lsst-ts/tickets/DM-47744
Browse files Browse the repository at this point in the history
Add ability to take only intra and extra focal pair
  • Loading branch information
gmegh authored Nov 22, 2024
2 parents 5828121 + 0e8d575 commit ddf41fa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
1 change: 1 addition & 0 deletions doc/news/DM-47744.perf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In ``maintel/take_aos_sequence_comcam.py``, allow for only intra and extra focal pair.
38 changes: 24 additions & 14 deletions python/lsst/ts/standardscripts/maintel/take_aos_sequence_comcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Mode(enum.IntEnum):
TRIPLET = enum.auto()
INTRA = enum.auto()
EXTRA = enum.auto()
PAIR = enum.auto()


class TakeAOSSequenceComCam(BaseBlockScript):
Expand Down Expand Up @@ -247,7 +248,11 @@ async def take_aos_sequence(self) -> None:
"""Take out-of-focus sequence images."""
supplemented_group_id = self.next_supplemented_group_id()

if self.mode == Mode.TRIPLET or self.mode == Mode.INTRA:
if (
self.mode == Mode.TRIPLET
or self.mode == Mode.INTRA
or self.mode == Mode.PAIR
):
self.log.debug("Moving to intra-focal position")

# Move the hexapod to the target z position
Expand All @@ -267,7 +272,11 @@ async def take_aos_sequence(self) -> None:
note=self.note,
)

if self.mode == Mode.TRIPLET or self.mode == Mode.EXTRA:
if (
self.mode == Mode.TRIPLET
or self.mode == Mode.EXTRA
or self.mode == Mode.PAIR
):
self.log.debug("Moving to extra-focal position")

# Move the hexapod to the target z position
Expand All @@ -288,7 +297,7 @@ async def take_aos_sequence(self) -> None:
note=self.note,
)

if self.mode == Mode.TRIPLET:
if self.mode == Mode.TRIPLET or self.mode == Mode.PAIR:
self.log.debug("Waiting for images to be ingested in OODS.")
extra_image_ingested = False
while not extra_image_ingested:
Expand Down Expand Up @@ -334,17 +343,18 @@ async def take_aos_sequence(self) -> None:
await self.mtcs.offset_camera_hexapod(x=0, y=0, z=z_offset, u=0, v=0)
self.current_z_position = 0

self.log.info("Taking in-focus image")
self.camera.rem.ccoods.evt_imageInOODS.flush()
await self.camera.take_acq(
exptime=self.exposure_time,
n=1,
group_id=self.group_id,
filter=self.filter,
reason="INFOCUS" + ("" if self.reason is None else f"_{self.reason}"),
program=self.program,
note=self.note,
)
if self.mode != Mode.PAIR:
self.log.info("Taking in-focus image")
self.camera.rem.ccoods.evt_imageInOODS.flush()
await self.camera.take_acq(
exptime=self.exposure_time,
n=1,
group_id=self.group_id,
filter=self.filter,
reason="INFOCUS" + ("" if self.reason is None else f"_{self.reason}"),
program=self.program,
note=self.note,
)

if self.mode == Mode.TRIPLET:
try:
Expand Down

0 comments on commit ddf41fa

Please sign in to comment.