residual_true

pyoof.residual_true(params, beam_data, u_data, v_data, d_z, wavel, illum_func, telgeo, resolution, box_factor, interp)[source]

Computes the true residual ready to use for the fit_zpoly function. True means that some of the parameters used will not be fitted. Their selection is done by default or by adding config_params.yml file to the fit_zpoly function.

Parameters
paramsndarray

Two stacked arrays, the illumination and Zernike circle polynomials coefficients. params = np.hstack([I_coeff, K_coeff]).

beam_datandarray

The beam_data is an array with the three observed beam maps, \(P^\mathrm{obs}(u, v)\), minus, zero and plus out-of-focus.

u_dataQuantity

\(x\) axis value for the 3 beam maps in radians. The values have to be flatten, in one dimension, and stacked in the same order as the d_z = [d_z-, 0., d_z+] values from each beam map.

v_dataQuantity

\(y\) axis value for the 3 beam maps in radians. The values have to be flatten, one dimensional, and stacked in the same order as the d_z = [d_z-, 0., d_z+] values from each beam map.

d_zQuantity

Radial offset \(d_z\), added to the sub-reflector in length units. This characteristic measurement adds the classical interference pattern to the beam maps, normalized squared (field) radiation pattern, which is an out-of-focus property. The radial offset list must be as follows, d_z = [d_z-, 0., d_z+] all of them in length units.

wavelQuantity

Wavelength, \(\lambda\), of the observation in meters.

illum_funcfunction

Illumination function, \(E_\mathrm{a}(x, y)\), to be evaluated with the key I_coeff. The illumination functions available are illum_parabolic and illum_gauss.

telgeolist

List that contains the blockage distribution, optical path difference (OPD) function, and the primary radius (float) in meters. The list must have the following order, telego = [block_dist, opd_func, pr].

resolutionint

Fast Fourier Transform resolution for a rectangular grid. The input value has to be greater or equal to the telescope resolution and with power of 2 for faster FFT processing. It is recommended a value higher than resolution = 2 ** 8.

box_factorint

Related to the FFT resolution (resolution key), defines the image pixel size level. It depends on the primary radius, pr, of the telescope, e.g. a box_factor = 5 returns x = np.linspace(-5 * pr, 5 * pr, resolution), an array to be used in the FFT2 (fft2).

interpbool

If True, it will process the correspondent interpolation between the observed grid (\(P^\mathrm{obs}(u, v)\)) and the computed grid (\(P(u, v)\)) for the FFT2 aperture distribution model (\(\underline{E_\mathrm{a}}(x, y)\)).

Returns
_residual_truendarray

One dimensional array of the residual between the observed data and the FFT aperture distribution model. It has been concatenated as minus, zero and plus radial offset (to do a multiple fit). It is required to have the residual in one dimension in order to use a least squares minimization least_squares package.