fit_beam¶
-
pyoof.fit_beam(data_info, data_obs, method, order_max, illum_func, telescope, resolution, box_factor, fit_previous=True, config_params_file=None, make_plots=True, verbose=2)[source] [edit on github]¶ 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_beamis the core function from thepyoofpackage.Parameters: data_info :
listIt 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 :
listIt contains beam maps and \(x\)-, and \(y\)-axis (\(uv\)-plane in Fourier space) data for the least squares minimization (see
fit_beam). 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.method :
strLeast squares minimization algorithm, it can be
'trf','lm'or'dogbox'.'lm'does not handle bounds, see documentationleast_squares.order_max :
intMaximum 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 :
functionIllumination function, \(E_\mathrm{a}(x, y)\), to be evaluated with the key I_coeff. The illumination functions available are
illum_pedestalandillum_gauss.telescope :
listresolution :
intFast 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 :
intRelated 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 :
boolconfig_params_file :
strPath 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 :
boolIf
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).