astropy:docs

Gaussian2D

class astropy.modeling.functional_models.Gaussian2D(amplitude, x_mean, y_mean, x_stddev=None, y_stddev=None, theta=0.0, cov_matrix=None, **constraints)[source] [edit on github]

Bases: astropy.modeling.core.Parametric2DModel

Two 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. x_stddev and y_stddev must be specified unless a covariance matrix (cov_matrix) is input.

y_stddev : float

Standard deviation of the Gaussian in y. x_stddev and y_stddev must be specified unless a covariance matrix (cov_matrix) is input.

theta : float, optional

Rotation angle in radians. The rotation angle increases clockwise.

cov_matrix : ndarray, optional

A 2x2 covariance matrix. If specified, overrides the x_stddev, y_stddev, and theta specification.

See also

Gaussian1D, Box2D, Beta2D

fixed
a dict a dictionary {parameter_name: boolean} of parameters to not be varied during fitting. True means the parameter is held fixed. Alternatively the fixed property 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 the tied property of a parameter may be used.
bounds
dict a dictionary {parameter_name: boolean} of lower and upper bounds of parameters. Keys are parameter names. Values are a list of length 2 giving the desired range for the parameter. Alternatively the min and max properties of a parameter may be used.
eqcons
list A list of functions of length n such that eqcons[j](x0,*args) == 0.0 in a successfully optimized problem.
ineqcons
list A list of functions of length n such that ieqcons[j](x0,*args) >= 0.0 is a successfully optimized problem.

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)

Attributes Summary

amplitude
param_names list() -> new empty list
theta
x_mean
x_stddev
y_mean
y_stddev

Methods Summary

deriv(x, y, amplitude, x_mean, y_mean, ...) Two dimensional Gaussian function derivative
eval(x, y, amplitude, x_mean, y_mean, ...) Two dimensional Gaussian function

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 deriv(x, y, amplitude, x_mean, y_mean, x_stddev, y_stddev, theta)[source] [edit on github]

Two dimensional Gaussian function derivative

static eval(x, y, amplitude, x_mean, y_mean, x_stddev, y_stddev, theta)[source] [edit on github]

Two dimensional Gaussian function

Page Contents