Package: astrafocus
AstrAFocusAstrAFocus is a package that provides flexible autofocus (AF) procedures for telescopes.
The tasks that this package aims to automate fall into two broad categories.Locate the focus calibration region:Identify an area around the zenith that is suitable for focus calibration, given the chosen
focus measurement operator.Perform autofocus:Select the focus positions at which exposures should be taken.Measure the focus of an exposure at a given focus position using a focus measure operator.Estimate the point of optimal focus given a set of exposures taken at different focus positions.Example UsageThe file,exploration/speculoos_main.pyprovides an example of using the Autofocus Telescope System.
The key components include:The initialisation of the interface with the hardwareTelescopeSpecs: Loading specs of the telescope from a.yamlfile (see e.g.exploration/speculoos.yaml)AutofocuserDeviceInterface: The interface between the API of the devices and this library.CameraInterface: Interface for performing exposures.FocuserInterface: Interface for changing the focus position of the telescope.TelescopeInterface: The implementation of this interface is optional, as the telescope
only needs to be oriented once after the focus calibration region has been determined
with the targeting classZenithNeighbourhoodQuery, which can be implemented externally.
Accordingly, this swaying of the telescope can also be implemented externally. Note that it is
currently assumed that the target tracking is controlled outside of this package.TargetingZenithNeighbourhoodQuery: Queries the zenith neighbourhood in a database to find a suitable section of the sky for focusing.FocsuingSweepingAutofocuser: Performs the autofocusing using sweeping through a range of focus positions.AnalyticResponseAutofocuser(SweepingAutofocuser): Performs the autofocusing utilising the analytic nature of the focus response curve of a given focus measure.NonParametricResponseAutofocuser(SweepingAutofocuser): Performs the autofocusing using an arbitrary focus measure operator and then applying an extremum estimator from to find the position of maximal focus.For detailed usage and customization, refer to the source code and docstrings in each module.InstallationTo install the package, clone the project and run:python3-mpipinstallto install from source orpython3-mpipinstall-e.to install in editable mode.
For more information, consult thePython Packaging User Guide.The Gaia-2MASS Local CatalogueThe targeting procedure requires theGaia-2MASS Local Cataloguewhich can be downlaodedhere.Optional DependenciesThe package supports additional features through optional dependencies.
You can install these dependencies based on your needs. Choose from the following options:# To also install visualization tools, including matplotlib, plotly and dashpython3-mpipinstall".[visualization]"# To install packages for more statistics and machine learning, including scikit-learn.python3-mpipinstall".[extended]"# To install dashpython3-mpipinstall".[dash]"# To install alpycapython3-mpipinstall".[alpaca]"Alpycais aPython 3.7+ API libraryfor all Astronomy Common Object Model (ASCOM)
Alpaca universal interfaces.
This library is a possible API for communication between this package and the devices required
for focussing, namely the camera and the focuser.Project StructureThe project structure includes several key directories:astrafocus: The main package containing autofocus-related modules.interface: Subpackage with modules for interfacing with the devices through their API components.models: Modules defining mathematical models used by some of the autofocus procedures.sql: Modules handling database queries of the Gaia-2MASS Local Catalogue (seeabove).targeting: Modules related to targeting specific regions in the sky.utils: General utility modules.May your stars align and your focus be as sharp as a caffeinated owl spotting its prey!