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_beam
is the core function from thepyoof
package.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_beam
). 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
andv_data
are the beam axes in a flat array.method :
str
Least squares minimization algorithm, it can be
'trf'
,'lm'
or'dogbox'
.'lm'
does not handle bounds, see documentationleast_squares
.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 are
illum_pedestal
andillum_gauss
.telescope :
list
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 = 5
returnsx = np.linspace(-5 * pr, 5 * pr, resolution)
, an array to be used in the FFT2 (fft2
).fit_previous :
bool
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.yml
in the pyoof package directory.make_plots :
bool
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)\).verbose :
int
{0, 1, 2} Level of algorithm verbosity. 0 work silent, 1 display termination report, 2, display progress during iteration (default).