astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v0.3 »
- Models And Fitting (`astropy.modeling`) »
- Gaussian2D

# 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)

  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 Either x_fwhm or x_stddev must be specified

  y_stddev : float

  > Standard deviation of the gaussian in y Either y_fwhm or y_stddev must be specified

  theta : float

  > Rotation angle in radians. Note: increases clockwise.

  cov_matrix : ndarray

  > A 2x2 covariance matrix. If specified, overrides stddev, fwhm, 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{\sin^{2}{\left (\theta \right )}}{2 \sigma_{y}^{2}} - \frac{\cos^{2}{\left (\theta \right )}}{2 \sigma_{x}^{2}}\right) b = \left(\frac{\sin{\left (2 \theta \right )}}{2 \sigma_{y}^{2}} - \frac{\sin{\left (2 \theta \right )}}{2 \sigma_{x}^{2}}\right) c = \left(\frac{\cos^{2}{\left (\theta \right )}}{2 \sigma_{y}^{2}} + \frac{\sin^{2}{\left (\theta \right )}}{2 \sigma_{x}^{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)

    Two dimensional Gaussian function derivative

  static `eval`(x, y, amplitude, x_mean, y_mean, x_stddev, y_stddev, theta)

    Two dimensional Gaussian function