Skip to content

Commit

Permalink
Actually use the focus parser
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jul 27, 2023
1 parent 62dd803 commit 98cce49
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/gort/devices/guider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 98cce49

Please sign in to comment.