From 98cce4923005e9ade1414af6ef9276ee546554d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Thu, 27 Jul 2023 05:01:12 +0000 Subject: [PATCH] Actually use the focus parser --- src/gort/devices/guider.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gort/devices/guider.py b/src/gort/devices/guider.py index ebe1335..262986e 100644 --- a/src/gort/devices/guider.py +++ b/src/gort/devices/guider.py @@ -158,7 +158,7 @@ async def focus( try: self.write_to_log(f"Focusing telescope {self.name}.", "info") await self.actor.commands.focus( - reply_callback=self.print_reply, + reply_callback=self._parse_focus, guess=guess, step_size=step_size, steps=steps, @@ -171,12 +171,12 @@ async def focus( self.write_to_log( f"Best focus: {self._best_focus[1]} arcsec " f"at {self._best_focus[0]} DT", - "info" + "info", ) return self._best_focus - async def _parse_focus(self, reply: AMQPReply): + def _parse_focus(self, reply: AMQPReply): """Parses replies from the guider command.""" if not reply.body: @@ -390,9 +390,9 @@ async def focus( ] results = await asyncio.gather(*jobs) - best_focus = [f'{name}: {results[itel][1]}' for itel, name in enumerate(self)] + best_focus = [f"{name}: {results[itel][1]}" for itel, name in enumerate(self)] - self.write_to_log('Best focus: ' + ', '.join(best_focus), 'info') + self.write_to_log("Best focus: " + ", ".join(best_focus), "info") async def guide(self, *args, **kwargs): """Guide on all telescopes.