Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First push of modified take_stuttered code #100

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions python/lsst/ts/observatory/control/base_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,8 @@ async def take_stuttered(
note : `str`
Optional observer note to be added to the image header.
checkpoint : `coro`
A optional awaitable callback that accepts one string argument
that is called before each bias is taken.
An awaitable callback that accepts one string argument
that is called to shift the focus.
**kwargs
Arbitrary keyword arguments.

Expand Down Expand Up @@ -978,9 +978,6 @@ async def take_imgtype(
else:
self.log.debug(f"imagetype: {imgtype}, skip TCS synchronization.")

if checkpoint is not None:
await checkpoint(f"Expose {n} {imgtype}")

camera_exposure = CameraExposure(
exp_time=exptime if imgtype != "BIAS" else 0.0,
shutter=imgtype not in ["BIAS", "DARK"],
Expand All @@ -990,6 +987,7 @@ async def take_imgtype(
n_snaps=n_snaps,
n_shift=n_shift,
row_shift=row_shift,
checkpoint=checkpoint,
test_type=test_type,
reason=reason,
program=program,
Expand Down Expand Up @@ -1283,6 +1281,10 @@ async def _handle_expose_shift(self, camera_exposure: CameraExposure) -> None:
assert type(camera_exposure.n_shift) is int

for i in range(camera_exposure.n_shift - 1):
if (camera_exposure.checkpoint is not None) and (i % 2 == 1):
# shift focus on odd numbered shifts
await camera_exposure.checkpoint("Shifting hexapod z")

self.log.debug(
f"Exposing {i+1} of {camera_exposure.n_shift} for {camera_exposure.exp_time} seconds."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class CameraExposure:
n_snaps: int
n_shift: typing.Union[int, None]
row_shift: typing.Union[int, None]
checkpoint: None | typing.Optional[typing.Callable[[str], typing.Awaitable]]
test_type: typing.Union[str, None]
reason: typing.Union[str, None]
program: typing.Union[str, None]
Expand Down