Gaussian2D¶
-
class
astropy.modeling.functional_models.Gaussian2D[source] [edit on github]¶ Bases:
astropy.modeling.Fittable2DModelTwo dimensional Gaussian model.
Parameters: amplitude : float
Amplitude of the Gaussian.
x_mean : float
Mean of the Gaussian in x.
y_mean : float
Mean of the Gaussian in y.
x_stddev : float
Standard deviation of the Gaussian in x before rotating by theta.
x_stddevandy_stddevmust be specified unless a covariance matrix (cov_matrix) is input.y_stddev : float
Standard deviation of the Gaussian in y before rotating by theta.
x_stddevandy_stddevmust be specified unless a covariance matrix (cov_matrix) is input.theta : float, optional
Rotation angle in radians. The rotation angle increases counterclockwise, from the positive x-axis.
cov_matrix : ndarray, optional
A 2x2 covariance matrix. If specified, overrides the
x_stddev,y_stddev, andthetaspecification.Other Parameters: fixed : a dict
A dictionary
{parameter_name: boolean}of parameters to not be varied during fitting. True means the parameter is held fixed. Alternatively thefixedproperty of a parameter may be used.tied : dict
A dictionary
{parameter_name: callable}of parameters which are linked to some other parameter. The dictionary values are callables providing the linking relationship. Alternatively thetiedproperty of a parameter may be used.bounds : dict
eqcons : list
A list of functions of length
nsuch thateqcons[j](x0,*args) == 0.0in a successfully optimized problem.ineqcons : list
A list of functions of length
nsuch thatieqcons[j](x0,*args) >= 0.0is a successfully optimized problem.See also
Notes
Model formula:
f(x, y) = A e^{-a\left(x - x_{0}\right)^{2} -b\left(x - x_{0}\right) \left(y - y_{0}\right) -c\left(y - y_{0}\right)^{2}}
Using the following definitions:
a = \left(\frac{\cos^{2}{\left (\theta \right )}}{2 \sigma_{x}^{2}} + \frac{\sin^{2}{\left (\theta \right )}}{2 \sigma_{y}^{2}}\right) b = \left(\frac{\sin{\left (2 \theta \right )}}{2 \sigma_{x}^{2}} - \frac{\sin{\left (2 \theta \right )}}{2 \sigma_{y}^{2}}\right) c = \left(\frac{\sin^{2}{\left (\theta \right )}}{2 \sigma_{x}^{2}} + \frac{\cos^{2}{\left (\theta \right )}}{2 \sigma_{y}^{2}}\right)
- If using a
cov_matrix, the model is of the form: f(x, y) = A e^{-0.5 \left(\vec{x} - \vec{x}_{0}\right)^{T} \Sigma^{-1} \left(\vec{x} - \vec{x}_{0}\right)}
where \vec{x} = [x, y], \vec{x}_{0} = [x_{0}, y_{0}], and \Sigma is the covariance matrix:
\Sigma = \left(\begin{array}{ccc} \sigma_x^2 & \rho \sigma_x \sigma_y \\ \rho \sigma_x \sigma_y & \sigma_y^2 \end{array}\right)
\rho is the correlation between
xandy, which should be between -1 and +1. Positive correlation corresponds to athetain the range 0 to 90 degrees. Negative correlation corresponds to athetain the range of 0 to -90 degrees.See [R6] for more details about the 2D Gaussian function.
References
[R6] (1, 2) http://en.wikipedia.org/wiki/Gaussian_function Attributes Summary
amplitudeparam_namesthetax_meanx_stddevy_meany_stddevMethods Summary
evaluate(x, y, amplitude, x_mean, y_mean, ...)Two dimensional Gaussian function fit_deriv(x, y, amplitude, x_mean, y_mean, ...)Two dimensional Gaussian function derivative with respect to parameters Attributes Documentation
-
amplitude¶
-
param_names= ('amplitude', 'x_mean', 'y_mean', 'x_stddev', 'y_stddev', 'theta')¶
-
theta¶
-
x_mean¶
-
x_stddev¶
-
y_mean¶
-
y_stddev¶
Methods Documentation
-
static
evaluate(x, y, amplitude, x_mean, y_mean, x_stddev, y_stddev, theta)[source] [edit on github]¶ Two dimensional Gaussian function
-
static
fit_deriv(x, y, amplitude, x_mean, y_mean, x_stddev, y_stddev, theta)[source] [edit on github]¶ Two dimensional Gaussian function derivative with respect to parameters
- If using a