diff --git a/doc/news/DM-47890.bugfix.rst b/doc/news/DM-47890.bugfix.rst new file mode 100644 index 000000000..7569bc7e4 --- /dev/null +++ b/doc/news/DM-47890.bugfix.rst @@ -0,0 +1 @@ +In `auxtel/daytime_checkout/slew_and_take_image_checkout.py`, fix how TCS readiness is configured. diff --git a/doc/news/DM-47890.feature.rst b/doc/news/DM-47890.feature.rst new file mode 100644 index 000000000..ec47eaa0e --- /dev/null +++ b/doc/news/DM-47890.feature.rst @@ -0,0 +1 @@ +In `maintel/m1m3/enable_m1m3_slew_controller_flags.py`, update `run_block`` method to use new `m1m3_in_engineering_mode`` context manager to enter/exit engineering mode when setting slew controller settings. diff --git a/python/lsst/ts/standardscripts/auxtel/daytime_checkout/slew_and_take_image_checkout.py b/python/lsst/ts/standardscripts/auxtel/daytime_checkout/slew_and_take_image_checkout.py index e7afa642a..f8b0b142f 100644 --- a/python/lsst/ts/standardscripts/auxtel/daytime_checkout/slew_and_take_image_checkout.py +++ b/python/lsst/ts/standardscripts/auxtel/daytime_checkout/slew_and_take_image_checkout.py @@ -84,7 +84,7 @@ def __init__(self, index=1, add_remotes: bool = True): # published to the efd. self.atcs = ATCS(domain=self.domain, intended_usage=atcs_usage, log=self.log) - tcs_ready_to_take_data = self.atcs if add_remotes else None + tcs_ready_to_take_data = self.atcs.ready_to_take_data if add_remotes else None self.latiss = LATISS( domain=self.domain, intended_usage=latiss_usage, diff --git a/python/lsst/ts/standardscripts/maintel/m1m3/enable_m1m3_slew_controller_flags.py b/python/lsst/ts/standardscripts/maintel/m1m3/enable_m1m3_slew_controller_flags.py index dc18c33b4..5837905d8 100644 --- a/python/lsst/ts/standardscripts/maintel/m1m3/enable_m1m3_slew_controller_flags.py +++ b/python/lsst/ts/standardscripts/maintel/m1m3/enable_m1m3_slew_controller_flags.py @@ -164,6 +164,7 @@ async def configure(self, config): async def run_block(self): - for flag, enable in zip(self.config.slew_flags, self.config.enable): - self.log.info(f"Setting m1m3 slew flag {flag.name} to {enable}.") - await self.mtcs.set_m1m3_slew_controller_settings(flag, enable) + async with self.mtcs.m1m3_in_engineering_mode(): + for flag, enable in zip(self.config.slew_flags, self.config.enable): + self.log.info(f"Setting m1m3 slew flag {flag.name} to {enable}.") + await self.mtcs.set_m1m3_slew_controller_settings(flag, enable) diff --git a/tests/test_maintel_m1m3_enable_m1m3_controller_flags.py b/tests/test_maintel_m1m3_enable_m1m3_controller_flags.py index 161e1f5b8..6a795d3c5 100644 --- a/tests/test_maintel_m1m3_enable_m1m3_controller_flags.py +++ b/tests/test_maintel_m1m3_enable_m1m3_controller_flags.py @@ -35,9 +35,16 @@ async def basic_make_script(self, index): self.script.mtcs = unittest.mock.AsyncMock() self.script.mtcs.start_task = utils.make_done_future() self.script.mtcs.set_m1m3_slew_controller_settings = unittest.mock.AsyncMock() + self.script.mtcs.configure_mock( + m1m3_in_engineering_mode=self.mock_m1m3_in_engineering_mode + ) return (self.script,) + @contextlib.asynccontextmanager + async def mock_m1m3_in_engineering_mode(self): + yield + @contextlib.asynccontextmanager async def make_dry_script(self): async with self.make_script():