astrohack.utils.zernike_aperture_fitting ======================================== .. py:module:: astrohack.utils.zernike_aperture_fitting Attributes ---------- .. autoapisummary:: astrohack.utils.zernike_aperture_fitting.zernike_matrix_functions Functions --------- .. autoapisummary:: astrohack.utils.zernike_aperture_fitting.zernike_order_0 astrohack.utils.zernike_aperture_fitting.zernike_order_1 astrohack.utils.zernike_aperture_fitting.zernike_order_2 astrohack.utils.zernike_aperture_fitting.zernike_order_3 astrohack.utils.zernike_aperture_fitting.zernike_order_4 astrohack.utils.zernike_aperture_fitting.zernike_order_5 astrohack.utils.zernike_aperture_fitting.zernike_order_6 astrohack.utils.zernike_aperture_fitting.zernike_order_7 astrohack.utils.zernike_aperture_fitting.zernike_order_8 astrohack.utils.zernike_aperture_fitting.zernike_order_9 astrohack.utils.zernike_aperture_fitting.zernike_order_10 astrohack.utils.zernike_aperture_fitting.create_osa_coordinates astrohack.utils.zernike_aperture_fitting.fit_zernike_coefficients Module Contents --------------- .. py:function:: zernike_order_0(u_ax, _) Zernike 0-eth order polynomial, simple flat disk. :param u_ax: Aperture U axis :param _: Aperture V axis :returns: a [n, 1] Matrix filled with ones. .. py:function:: zernike_order_1(u_ax, v_ax) Zernike first order polynomials, simple linear gradients. :param u_ax: Aperture U axis :param v_ax: Aperture V axis :returns: a [n, 3] Matrix filled with U and V values. .. py:function:: zernike_order_2(u_ax, v_ax, return_powers=False) Zernike second order polynomials, first astigmatisms and linear defocus. :param u_ax: Aperture U axis :param v_ax: Aperture V axis :param return_powers: return list of already compute U and V powers? (saves computing time) :returns: a [n, 6] Matrix filled with the first 6 polynomials. .. py:function:: zernike_order_3(u_ax, v_ax, return_powers=False) Zernike third order polynomials, first comas and trefoils. :param u_ax: Aperture U axis :param v_ax: Aperture V axis :param return_powers: return list of already compute U and V powers? (saves computing time) :returns: a [n, 10] Matrix filled the first 10 polynomials. .. py:function:: zernike_order_4(u_ax, v_ax, return_powers=False) Zernike forth order polynomials, second astigmatisms, first spherical aberations and tetrafoils. :param u_ax: Aperture U axis :param v_ax: Aperture V axis :param return_powers: return list of already compute U and V powers? (saves computing time) :returns: a [n, 15] Matrix filled the first 15 polynomials. .. py:function:: zernike_order_5(u_ax, v_ax, return_powers=False) Zernike fifth order polynomials, pentafoils, second comas. :param u_ax: Aperture U axis :param v_ax: Aperture V axis :param return_powers: return list of already compute U and V powers? (saves computing time) :returns: a [n, 21] Matrix filled the first 21 polynomials. .. py:function:: zernike_order_6(u_ax, v_ax, return_powers=False) Zernike sixth order polynomials, second spherical aberations, hexafoils :param u_ax: Aperture U axis :param v_ax: Aperture V axis :param return_powers: return list of already compute U and V powers? (saves computing time) :returns: a [n, 28] Matrix filled the first 28 polynomials. .. py:function:: zernike_order_7(u_ax, v_ax, return_powers=False) Zernike seventh order polynomials, heptafoils :param u_ax: Aperture U axis :param v_ax: Aperture V axis :param return_powers: return list of already compute U and V powers? (saves computing time) :returns: a [n, 36] Matrix filled the first 36 polynomials. .. py:function:: zernike_order_8(u_ax, v_ax, return_powers=False) Zernike eigth order polynomials, octafoils :param u_ax: Aperture U axis :param v_ax: Aperture V axis :param return_powers: return list of already compute U and V powers? (saves computing time) :returns: a [n, 45] Matrix filled the first 45 polynomials. .. py:function:: zernike_order_9(u_ax, v_ax, return_powers=False) Zernike nineth order polynomials, enneafoils :param u_ax: Aperture U axis :param v_ax: Aperture V axis :param return_powers: return list of already compute U and V powers? (saves computing time) :returns: a [n, 55] Matrix filled the first 55 polynomials. .. py:function:: zernike_order_10(u_ax, v_ax, return_powers=False) Zernike tenth order polynomials, decafoils :param u_ax: Aperture U axis :param v_ax: Aperture V axis :param return_powers: return list of already compute U and V powers? (saves computing time) :returns: a [n, 66] Matrix filled the first 66 polynomials. .. py:data:: zernike_matrix_functions .. py:function:: create_osa_coordinates(zernike_order, split_nm=False) Create a list of the labels of all the polynomials from the N order given. :param zernike_order: The value of the N order. :param split_nm: Is result to be given in a 1D list (False, default) or in a 2D [N,M] list. :returns: A list containing the OSA ordered Zernike indices labels. .. py:function:: fit_zernike_coefficients(aperture, u_axis, v_axis, zernike_order, telescope, fitting_engine='numpy', mask_arm_shadows=True) Fit zernike polynomial coefficients to an aperture array. :param aperture: 5D array containing the correlation apertures ([time, chan, pol, u, v]). :param u_axis: U axis for the apertures :param v_axis: V axis for the apertures. :param zernike_order: The N-eth order to be fitted to the aperture. :param telescope: Telescope class object with telescope's optical info. :param fitting_engine: Which fittign engine to use, numpy's linear algebra or scipy optimize. :param mask_arm_shadows: Mask the shadows of the arms holding the secondary in place (usually only relevant for :param cassegrain telescopes): :returns: The Zernike coefficients, the model derived from these coefficients, the RMS of the fit and the labeling for the zernike coeficients.