From b73ef66159a69830809dd4f8c4e6a103383d8c59 Mon Sep 17 00:00:00 2001 From: craiglagegit Date: Mon, 28 Aug 2023 18:09:27 +0000 Subject: [PATCH 1/2] First push of modified take_stuttered code --- .../ts/standardscripts/base_take_stuttered.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/python/lsst/ts/standardscripts/base_take_stuttered.py b/python/lsst/ts/standardscripts/base_take_stuttered.py index 0f62f0a11..ab48dd7d6 100644 --- a/python/lsst/ts/standardscripts/base_take_stuttered.py +++ b/python/lsst/ts/standardscripts/base_take_stuttered.py @@ -89,6 +89,16 @@ def get_schema(cls): minimum: 1 type: integer default: 100 + change_focus: + description: Whether or not to change focus between shifts. + minimum: 0 + type: boolean + default: False + focus_step: + description: Amount to shift focus if shift_focus is True. + minimum: 0 + type: number + default: 0.025 exp_time: description: The exposure time (sec). type: number @@ -124,6 +134,9 @@ def set_metadata(self, metadata): * self.config.n_images * self.config.exp_time ) + async def offset_hexapod(self, msg): + await self.checkpoint(msg) + await self.atcs.rem.ataos.cmd_offset.set_start(z=self.config.focus_step) async def run(self): note = getattr(self.config, "note", None) @@ -134,13 +147,25 @@ async def run(self): await self.camera.setup_instrument(**self.get_instrument_configuration()) await self.checkpoint("Take stuttered") + if self.config.change_focus: + # Change moveWhileWhileExposing parameter to allow hexapod + # to move while shutter is open + await self.atcs.rem.ataos.cmd_disableCorrection.set_start(hexapod=True) + await atcs.rem.ataos.cmd_enableCorrection.set_start(hexapod=True, moveWhileExposing=True) + await self.camera.take_stuttered( exptime=self.config.exp_time, n_shift=self.config.n_shift, row_shift=self.config.row_shift, n=self.config.n_images, + change_focus=self.config.change_focus + checkpoint=self.offset_hexapod reason=reason, program=program, group_id=self.group_id, note=note, ) + if self.config.change_focus: + # Put moveWhileExposing back to False + await self.atcs.rem.ataos.cmd_disableCorrection.set_start(hexapod=True) + await atcs.rem.ataos.cmd_enableCorrection.set_start(hexapod=True, moveWhileExposing=False) From c5ae277cde43b4e2223e88c1505b6537a1e9d99b Mon Sep 17 00:00:00 2001 From: craiglagegit Date: Fri, 1 Sep 2023 15:40:08 +0000 Subject: [PATCH 2/2] Changes using checkpoint in CameraExposure --- python/lsst/ts/standardscripts/base_take_stuttered.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/lsst/ts/standardscripts/base_take_stuttered.py b/python/lsst/ts/standardscripts/base_take_stuttered.py index ab48dd7d6..b50761e34 100644 --- a/python/lsst/ts/standardscripts/base_take_stuttered.py +++ b/python/lsst/ts/standardscripts/base_take_stuttered.py @@ -153,13 +153,17 @@ async def run(self): await self.atcs.rem.ataos.cmd_disableCorrection.set_start(hexapod=True) await atcs.rem.ataos.cmd_enableCorrection.set_start(hexapod=True, moveWhileExposing=True) + if self.config.change_focus: + checkpoint=self.offset_hexapod + else: + checkpoint=None + await self.camera.take_stuttered( exptime=self.config.exp_time, n_shift=self.config.n_shift, row_shift=self.config.row_shift, n=self.config.n_images, - change_focus=self.config.change_focus - checkpoint=self.offset_hexapod + checkpoint=checkpoint, reason=reason, program=program, group_id=self.group_id,