Feat/improved autofocuser - #129
Merged
Merged
Conversation
dgegen
force-pushed
the
feat/improved-autofocuser
branch
from
March 24, 2026 10:21
b70600c to
8069d43
Compare
ppp-one
reviewed
Mar 24, 2026
| except Exception as e: | ||
| field_of_view = np.array([np.nan, np.nan]) | ||
| self.observatory.error( | ||
| self.observatory.logger.error( |
dgegen
force-pushed
the
feat/improved-autofocuser
branch
from
July 21, 2026 09:09
1633aa0 to
33ffe60
Compare
Upgrades astrafocus from 0.1.2 to 0.1.3, which fixes autofocus runs crashing with "Input must be a 2D array" when an exposure fails mid-sweep (e.g. due to weather); the new version catches focus measure exceptions and records NaN instead of aborting. Also adds documentation (docstring and FIELD_DESCRIPTIONS) clarifying when to prefer non-parametric operators (fft, normalized_variance) for coarse searches vs. analytic operators (HFR) for fine tuning near the focus peak.
…f view determination
dgegen
force-pushed
the
feat/improved-autofocuser
branch
from
July 21, 2026 09:26
33ffe60 to
9632c68
Compare
dgegen
force-pushed
the
feat/improved-autofocuser
branch
from
July 21, 2026 09:28
9632c68 to
6bee361
Compare
Break the monolithic utils.py into astra/utils/{time,image,ephemeris,speculoos}.py
grouped by responsibility (JD/time conversions, image cleaning, sun/body
ephemeris, SPECULOOS error handling), and update all call sites and tests
to import from the new submodules.
Adds PairedDevices.calculate_fwhm(), estimating the DAOStarFinder FWHM from the camera/telescope plate scale assuming ~2" seeing when AutofocusConfig.fwhm is left unset. Also moves field-of-view calculation from Autofocuser into PairedDevices.calculate_field_of_view() for symmetry, reusing the shared math in astra.utils.optics.
…ogic Break out of the IsMoving poll loop early if observatory conditions fail during a focuser slew, rather than waiting for timeout. Also extract the repeated save_path/last_image_path fallback logic in Autofocuser into a shared _determine_save_dir() helper.
…he redundant prefix on check/ack function names Reflects that the module handles AsTelOS telescope errors specifically, not SPECULOOS-wide utilities.
Collaborator
Author
|
This led me to some cleanup related to, but also going beyond, the autofocuser improvements. With the acceptance of twirl/pull/44, the dependency tension between |
Owner
|
<3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
name: Pull request
about: Create a pull request
Description
Improves the
Autofocuserclass with a sharedrun_timestampproperty so all output files from a single autofocus run share a consistent timestamp-based naming scheme. Also simplify the focus record handling to use only the in-memory record, and adds logging for the observatory subclass type at startup.Changes Made
run_timestampproperty toAutofocuserthat lazily generates a single timestamp (formatYYYYMMDD_HHMMSS) shared across all output files of one run_output_path()helper that builds consistent output paths usingrun_timestampmake_summary_plot()andsave_result()to use_output_path()instead of ad-hoc timestamp/CSV-derived filenamesmake_summary_plot()— the in-memoryfocus_recordis now the only source; failures emit warnings and return earlymake_summary_plot()using the shared timestampobservatory.py)self.observatory.error(...)→self.observatory.logger.error(...)callastrafocusdependency to0.1.2. This fixes a few small bugs that propagated into Astra, especially when using secondary focus measure operators.Checklist