gaussian_2d_moments¶
-
gaussian_2d_moments(data, fit_method, fit_sigma)[source]¶ Guess the gaussian parameters of a distribution
Use for initial fitting parameters
the gaussian parameters of a 2D distribution by calculating its moments
Modified from : http://scipy-cookbook.readthedocs.io/items/FittingData.html
Parameters: - data (float 2D-array) – 2D distribution to evaluate
- fit_method (string) – fit method that will be used: ‘gaussian_2d_fixedwidth’, ‘gaussian_2d_1width’ or ‘gaussian_2d_2width’
- fit_sigma (float>0) – standard deviation of the gaussian fit_function. Default is 1.555.
Returns: (height, x, y), (height, x, y, sigma_x, sigma_y) or (height, x, y, sigma) depending on fit_method
Return type: floats (number of which depend on the fit_method)