1616
1717import numpy
1818
19+ from lvmopstools .retrier import Retrier
20+
1921from gort .devices .core import GortDevice , GortDeviceSet
2022from gort .enums import Event
2123from gort .exceptions import ErrorCode , GortTelescopeError
@@ -97,6 +99,7 @@ async def slew_delay(self):
9799 else :
98100 await asyncio .sleep (self .SLEW_DELAY [self .telescope ])
99101
102+ @Retrier (max_attempts = 3 , delay = 2 )
100103 async def stop (self , force : bool = False ):
101104 """Stop the K-mirror movement."""
102105
@@ -107,7 +110,7 @@ async def stop(self, force: bool = False):
107110 await self .run_command ("slewStop" , timeout = self .timeouts ["slewStop" ])
108111 await self .run_command ("stop" , timeout = self .timeouts ["slewStop" ])
109112
110- await asyncio .sleep (3 )
113+ await asyncio .sleep (1 )
111114
112115 if await self .is_moving ():
113116 raise GortTelescopeError (
@@ -158,6 +161,7 @@ async def park(self):
158161
159162 await self .move (90 )
160163
164+ @Retrier (max_attempts = 3 , delay = 2 )
161165 async def move (self , degs : float ):
162166 """Move the k-mirror to a position in degrees. Does NOT track after the move.
163167
@@ -171,7 +175,7 @@ async def move(self, degs: float):
171175 await self .check_reachable ()
172176
173177 await self .slew_delay ()
174- # await self.stop()
178+ await self .stop ()
175179
176180 self .write_to_log (f"Moving k-mirror to { degs :.3f} degrees." , level = "info" )
177181 await self .run_command (
@@ -229,7 +233,7 @@ async def slew(
229233 if abs (stop_degs_before ) > 0 :
230234 self .write_to_log (f"Using stop_degs_before={ stop_degs_before } ." )
231235
232- # await self.stop()
236+ await self .stop ()
233237 await self .run_command (
234238 "slewStart" ,
235239 ra / 15.0 ,
0 commit comments