astrohack.utils.zernike_aperture_fitting

Attributes

zernike_matrix_functions

Functions

zernike_order_0(u_ax, _)

Zernike 0-eth order polynomial, simple flat disk.

zernike_order_1(u_ax, v_ax)

Zernike first order polynomials, simple linear gradients.

zernike_order_2(u_ax, v_ax[, return_powers])

Zernike second order polynomials, first astigmatisms and linear defocus.

zernike_order_3(u_ax, v_ax[, return_powers])

Zernike third order polynomials, first comas and trefoils.

zernike_order_4(u_ax, v_ax[, return_powers])

Zernike forth order polynomials, second astigmatisms, first spherical aberations and tetrafoils.

zernike_order_5(u_ax, v_ax[, return_powers])

Zernike fifth order polynomials, pentafoils, second comas.

zernike_order_6(u_ax, v_ax[, return_powers])

Zernike sixth order polynomials, second spherical aberations, hexafoils

zernike_order_7(u_ax, v_ax[, return_powers])

Zernike seventh order polynomials, heptafoils

zernike_order_8(u_ax, v_ax[, return_powers])

Zernike eigth order polynomials, octafoils

zernike_order_9(u_ax, v_ax[, return_powers])

Zernike nineth order polynomials, enneafoils

zernike_order_10(u_ax, v_ax[, return_powers])

Zernike tenth order polynomials, decafoils

create_osa_coordinates(zernike_order[, split_nm])

Create a list of the labels of all the polynomials from the N order given.

fit_zernike_coefficients(aperture, u_axis, v_axis, ...)

Fit zernike polynomial coefficients to an aperture array.

Module Contents

zernike_order_0(u_ax, _)[source]

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.

zernike_order_1(u_ax, v_ax)[source]

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.

zernike_order_2(u_ax, v_ax, return_powers=False)[source]

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.

zernike_order_3(u_ax, v_ax, return_powers=False)[source]

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.

zernike_order_4(u_ax, v_ax, return_powers=False)[source]

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.

zernike_order_5(u_ax, v_ax, return_powers=False)[source]

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.

zernike_order_6(u_ax, v_ax, return_powers=False)[source]

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.

zernike_order_7(u_ax, v_ax, return_powers=False)[source]

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.

zernike_order_8(u_ax, v_ax, return_powers=False)[source]

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.

zernike_order_9(u_ax, v_ax, return_powers=False)[source]

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.

zernike_order_10(u_ax, v_ax, return_powers=False)[source]

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.

zernike_matrix_functions[source]
create_osa_coordinates(zernike_order, split_nm=False)[source]

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.

fit_zernike_coefficients(aperture, u_axis, v_axis, zernike_order, telescope, fitting_engine='numpy', mask_arm_shadows=True)[source]

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.