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_zpolyis the core function from thepyoofpackage.- Parameters
- data_info
list 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_obs
list 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_datais the three beam observations, minus, zero and plus out-of-focus, in a flat array.u_dataandv_dataare the beam axes in a flat array.- order_max
int 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_func
function Illumination function, \(E_\mathrm{a}(x, y)\), to be evaluated with the key
I_coeff. The illumination functions available areillum_parabolicandillum_gauss.- telescope
list 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].- resolution
int 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_factor
int 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. abox_factor = 5returnsx = np.linspace(-5 * pr, 5 * pr, resolution), an array to be used in the FFT2 (fft2).- fit_previous
bool If set to
True, it will fit the coefficients from the previous optimization this feature is strongly suggested. IfFalse, it will find the new coefficients by using the standard initial coefficients.- config_params_file
str Path for the configuration file, this includes, the maximum and minimum bounds, excluded, fixed and initial parameters for the optimization. See
config_params.ymlin the pyoof package directory.- make_plots
bool If
Truewill 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)\).- verbose
int {0, 1, 2} Level of algorithm verbosity. 0 work silent, 1 display termination report, 2, display progress during iteration (default).
- work_dir
str Default is
None, it will store thepyoof_out/folder in the FITS file current directory, for other provide the desired path.
- data_info