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

DM-41593: Update MoveP2P script to monitor state of the components and fault if any of them goes to FAULT #119

Merged
merged 3 commits into from
Dec 7, 2023
Merged
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
1 change: 1 addition & 0 deletions doc/news/DM-41593.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In ``maintel/mtcs.py``, update ``move_p2p_radec`` to check that the mtcs is in ENABLED state while moving.
17 changes: 13 additions & 4 deletions python/lsst/ts/observatory/control/maintel/mtcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1778,11 +1778,20 @@ async def move_p2p_radec(
"""
async with self.m1m3_booster_valve():
azel = self.azel_from_radec(ra=ra, dec=dec)
await self.rem.mtmount.cmd_moveToTarget.set_start(
azimuth=azel.az.value,
elevation=azel.alt.value,
timeout=timeout,
tasks = [
asyncio.create_task(self.check_component_state(component))
for component in self.components_to_check()
]
tasks.append(
asyncio.create_task(
self.rem.mtmount.cmd_moveToTarget.set_start(
azimuth=azel.az.value,
elevation=azel.alt.value,
timeout=timeout,
)
)
)
await self.process_as_completed(tasks)

async def offset_camera_hexapod(
self,
Expand Down
24 changes: 24 additions & 0 deletions tests/maintel/test_mtcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1780,12 +1780,21 @@ async def test_move_p2p_azel_with_timeout(self) -> None:

self.assert_m1m3_booster_valve()

async def test_move_p2p_azel_fail_cscs_not_enabled(self) -> None:
with pytest.raises(
RuntimeError,
match=".* state is <State.STANDBY: 5>, expected <State.ENABLED: 2>",
):
await self.mtcs.move_p2p_azel(az=0.0, el=80.0, timeout=30.0)

async def test_move_p2p_radec(self) -> None:
az = 90.0
el = 80.0

radec = self.mtcs.radec_from_azel(az=az, el=el)

await self.mtcs.enable()

self.log.info(f"{radec=}")
await self.mtcs.move_p2p_radec(
ra=radec.ra.to(units.hourangle).value,
Expand All @@ -1800,6 +1809,21 @@ async def test_move_p2p_radec(self) -> None:

self.assert_m1m3_booster_valve()

async def test_move_p2p_radec_fail_cscs_not_enabled(self) -> None:
az = 90.0
el = 80.0

radec = self.mtcs.radec_from_azel(az=az, el=el)

with pytest.raises(
RuntimeError,
match=".* state is <State.STANDBY: 5>, expected <State.ENABLED: 2>",
):
await self.mtcs.move_p2p_radec(
ra=radec.ra.to(units.hourangle).value,
dec=radec.dec.value,
)

async def test_m1m3_booster_valve(self) -> None:
async with self.mtcs.m1m3_booster_valve():
await asyncio.sleep(0)
Expand Down
Loading