File containing methods for fitting Gaussian distributions to field components. More...
Functions | |
| def | PyPO.FitGauss.calcEstimates (x, y, area, field_norm) |
| Calculate estimates for beam parameters from an input field component. More... | |
| def | PyPO.FitGauss.fitGaussAbs (field, surfaceObject, thres, scale, ratio=1) |
| Fit a Gaussian to an amplitude pattern of a field component. More... | |
| def | PyPO.FitGauss.GaussAbs (p0, *args) |
| Generate absolute Gaussian from parameters. More... | |
| def | PyPO.FitGauss.generateGauss (p0, surfaceObject, scale) |
| Generate a Gaussian from Gaussian and surface parameters. More... | |
File containing methods for fitting Gaussian distributions to field components.
| def PyPO.FitGauss.calcEstimates | ( | x, | |
| y, | |||
| area, | |||
| field_norm | |||
| ) |
Calculate estimates for beam parameters from an input field component.
These estimates are used as initial values for Gaussian fitting.
| x | Grid of x co-ordinates of input field. |
| y | Grid of y co-ordinates of input field. |
| area | Grid of area elements. |
| field_norm | Normalised input field component. |
| def PyPO.FitGauss.fitGaussAbs | ( | field, | |
| surfaceObject, | |||
| thres, | |||
| scale, | |||
ratio = 1 |
|||
| ) |
Fit a Gaussian to an amplitude pattern of a field component.
First, the center and position angle of the pattern is calculated using the method of image moments. Then, local maxima that might interfere with fitting are removed using the findConnectedSubsets method from MatUtils.py.
| field | Component of field to fit. |
| surfaceObject | Surface on which the field is defined. |
| thres | Threshold for fitting in decibels. |
| mode | Whether to fit the Gaussian in linear or logarithmic space. |
| ratio | Allowed maximal ratio of fit to actual beam. If "None", will just attempt to fit the Gaussian to supplied pattern. If given, will only accept a fit if the ratio of integrated power in the fitted Gaussian to the supplied beam pattern is less than or equal to the given value. Defaults to 1. |
| def PyPO.FitGauss.GaussAbs | ( | p0, | |
| * | args | ||
| ) |
Generate absolute Gaussian from parameters.
Called in optimalisation. This method returns an overlap parameter of the fitted Gaussian .
| p0 | Array containing parameters for Gaussian. |
| args | Extra arguments for defining Gaussian and fit. |
| def PyPO.FitGauss.generateGauss | ( | p0, | |
| surfaceObject, | |||
| scale | |||
| ) |
Generate a Gaussian from Gaussian and surface parameters.
| p0 | Gaussian parameters. |
| surfaceObject | Surface on which Gaussian is defined. |
| scale | Whether to generate Gaussian in linear or decibel space. |