Skip to content

Commit

Permalink
restore initial focus, if focus-series failed
Browse files Browse the repository at this point in the history
  • Loading branch information
thusser committed Jan 5, 2025
1 parent cf2df52 commit 424d511
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyobs/modules/focus/focusseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ async def _auto_focus(self, count: int, step: float, exposure_time: float, **kwa
try:
focus = self._series.fit_focus()
except Exception as e:
# restore initial guess
if self._offset:
await focuser.set_focus_offset(float(guess))
else:
await focuser.set_focus(float(guess))
raise exc.GeneralError(f"Could not calculate best focus: {e}")

# did focus series fail?
Expand Down

0 comments on commit 424d511

Please sign in to comment.