MMTWFS API Documentation¶
mmtwfs Package¶
The mmtwfs
package is a collection of code that for analyzing Shack-Hartmann wavefront sensor data for the MMTO
mmtwfs.zernike Module¶
A collection of functions and classes for performing wavefront analysis using Zernike polynomials. Several of these routines were adapted from https://github.com/tvwerkhoven/libtim-py. They have been updated to make them more applicable for MMTO usage and comments added to clarify what they do and how.
- Expressions for cartesian derivatives of the Zernike polynomials were adapted from:
Functions¶
|
Convert array of [x, y] vectors to [rho, theta] |
|
Convert array of [rho, theta] vectors to [x, y] |
|
Make radial Zernike polynomial on coordinate grid rho. |
|
First derivative of Zernike radial polynomial, R(m, n, rho) calculated on coordinate grid rho. |
|
Calculate angular Zernike mode on coordinate grid phi |
|
Calculate the first derivative of the m-th Zernike angular mode on coordinate grid phi |
|
Calculate Zernike mode (m, n) on grid rho and phi. |
|
Calculate the X slopes of Zernike mode (m, n) on grid rho and phi. |
|
Calculate the Y slopes of Zernike mode (m, n) on grid rho and phi. |
Convert linear Noll index to tuple of Zernike indices. |
|
|
Calculate Noll Zernike mode j on grid rho and phi. |
|
Calculate X/Y slopes for Noll Zernike mode j on grid rho and phi. |
|
Calculate total slope of a set of Zernike modes on a polar coordinate grid, (rho, phi). |
|
Calculate Noll normalization vector. |
|
Calculate the normalization coefficient for the (m, n) Zernike mode. |
|
Calculate the Noll coefficent to normalize mode l to unit variance. |
Classes¶
|
Class to wrap and visualize a vector of Zernike polynomial coefficients. |
mmtwfs.telescope Module¶
Functions¶
|
Build and return proper Telescope sub-class instance based on the value of 'telescope' and 'secondary'. |
Classes¶
|
Defines configuration and methods that pertain to the MMT's telescope and primary mirror systems |
|
Defines configuration and methods for the FLWO 1.2-meter |
mmtwfs.secondary Module¶
Classes and utilities for optical modeling and controlling the position of the secondary mirrors of the MMTO.
Functions¶
|
Build and return proper Secondary sub-class instance based on the value of 'secondary'. |
Classes¶
|
Defines configuration and methods specific to the F/9 secondary system |
|
Defines configuration and methods specific to the F/5 secondary system |
|
Secondary mirror configuration for the FLWO 1.2-meter |
mmtwfs.wfs Module¶
Classes and utilities for operating the wavefront sensors of the MMTO and analyzing the data they produce
Functions¶
|
Build and return proper WFS sub-class instance based on the value of 'wfs'. |
|
Define default image normalization to use for WFS images |
|
Utility to validate WFS data |
|
Use photutils.DAOStarFinder() to find and centroid spots in a Shack-Hartmann WFS image. |
|
Measure the WFS grid spacing which changes with telescope focus. |
|
Find the center of the pupil in a WFS image using skimage.feature.match_template(). |
|
Use wfsfind to locate and centroid spots. |
|
Given reference aperture and spot X/Y positions, loop through reference apertures and find closest spot. |
|
Calculate the sum of the distances between each reference aperture and the closest measured spot position. |
|
Scale the reference positions by the fit parameters and calculate the total distance between the matches. |
|
Analyze a WFS image and produce pixel offsets between reference and observed spot positions. |
|
Make a set of initial parameters that can be used with |
|
For a given set of wavefront fit parameters, calculate the "distance" between the predicted and measured wavefront slopes. |
|
Take a WFS image and mask/scale it so that it can be used as a reference for pupil centering |
Classes¶
|
Class to handle Shack-Hartmann reference data |
|
Defines configuration pattern and methods common to all WFS systems |
|
Defines configuration and methods specific to the F/9 WFS system |
|
Defines configuration and methods specific to the F/9 WFS system with the new SBIG CCD |
|
Defines configuration and methods specific to the F/5 WFS systems |
|
Defines configuration and methods specific to the Binospec WFS system. |
|
Defines configuration and methods specific to the MMIRS WFS system |
mmtwfs.utils Module¶
Misc. utility routines
Functions¶
|
Perform a SRV lookup of 'server' and return its hostname and port. |
mmtwfs.custom_exceptions Module¶
Classes¶
|
Superclass of all custom exceptions |
|
Raise when an error occurs due to invalid configuration data. |
|
Raise when an error occurs due to invalid command sent to a WFS system or invalid inputs given to WFS method. |
|
Raise when something is wrong with the WFS data that prevents it from being analyzed |
|
Raise when an error occurs in handling or configuring of ZernikeVectors |
mmtwfs.config Module¶
config.py - Configuration data and utility functions
Functions¶
|
The __subclasses__() method only goes one level deep, but various classes can be separated by multiple inheritance layers. |
|
This takes a list of python dicts and merges them into a single dict. |