fit_zpoly

pyoof.fit_zpoly(data_info, data_obs, order_max, illum_func, telescope, resolution, box_factor, fit_previous=True, config_params_file=None, make_plots=False, verbose=2, work_dir=None)[source]

Computes the Zernike circle polynomial coefficients, K_coeff, and the illumination function coefficients, I_coeff, stores and plots data ( optional) by using a least squares minimization. The stored data belongs to the best fitted power pattern (or beam map). fit_zpoly is the core function from the pyoof package.

Parameters
data_infolist

It contains all extra data besides the beam map. The output corresponds to a list, [name, pthto, obs_object, obs_date, freq, wavel, d_z, meanel]. These are, name of the FITS file, paht of the FITS file, observed object, observation date, frequency, wavelength, radial offset and mean elevation, respectively.

data_obslist

It contains beam maps and \(x\)-, and \(y\)-axis (\(uv\)-plane in Fourier space) data for the least squares minimization (see fit_zpoly). The list has the following order [beam_data, u_data, v_data]. beam_data is the three beam observations, minus, zero and plus out-of-focus, in a flat array. u_data and v_data are the beam axes in a flat array.

order_maxint

Maximum order used for the Zernike circle polynomials, \(n\), least squares minimization. If order_max = 3, it will do the optimization for orders 1, 2 and 3.

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.

telescopelist

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

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).

fit_previousbool

If set to True, it will fit the coefficients from the previous optimization this feature is strongly suggested. If False, it will find the new coefficients by using the standard initial coefficients.

config_params_filestr

Path for the configuration file, this includes, the maximum and minimum bounds, excluded, fixed and initial parameters for the optimization. See config_params.yml in the pyoof package directory.

make_plotsbool

If True will generate a sub-directory with all the important plots for the OOF holography, including the phase-error, \(\varphi(x, y)\) and fitted beam, \(P_\mathrm{norm}(u, v)\).

verboseint

{0, 1, 2} Level of algorithm verbosity. 0 work silent, 1 display termination report, 2, display progress during iteration (default).

work_dirstr

Default is None, it will store the pyoof_out/ folder in the FITS file current directory, for other provide the desired path.