Lorentz2D#
- class astropy.modeling.functional_models.Lorentz2D(amplitude=1, x_0=0, y_0=0, fwhm=1, **kwargs)[source]#
Bases:
Fittable2DModel
Two-dimensional Lorentzian model.
- Parameters:
See also
Notes
The
x
,y
,x_0
,y_0
, andfwhm
inputs must have compatible units or as unitless numbers.Model formula:
\[f(x, y) = \frac{A \gamma^{2}}{\gamma^{2} + \left(x - x_{0}\right)^2 + \left(y - y_{0}\right)^{2}}\]where \(\gamma\) is the half width at half maximum (HWHM), which is half the FWHM.
The area under the
Lorentz2D
profile is infinite, therefore this model profile cannot be normalized to sum to 1.Examples
import numpy as np import matplotlib.pyplot as plt from astropy.modeling.models import Lorentz2D plt.figure() model = Lorentz2D(x_0=12, y_0=12, fwhm=3) yy, xx = np.mgrid[:25, :25] data = model(xx, yy) plt.imshow(data) plt.show()
Attributes Summary
This property is used to indicate what units or sets of units the evaluate method expects, and returns a dictionary mapping inputs to units (or
None
if any units are accepted).Names of the parameters that describe models of this type.
Methods Summary
evaluate
(x, y, amplitude, x_0, y_0, fwhm)Two dimensional Lorentzian model function.
fit_deriv
(x, y, amplitude, x_0, y_0, fwhm)Two dimensional Lorentzian model derivative with respect to parameters.
Attributes Documentation
- amplitude = Parameter('amplitude', value=1.0)#
- fwhm = Parameter('fwhm', value=1.0)#
- input_units#
- param_names = ('amplitude', 'x_0', 'y_0', 'fwhm')#
Names of the parameters that describe models of this type.
The parameters in this tuple are in the same order they should be passed in when initializing a model of a specific type. Some types of models, such as polynomial models, have a different number of parameters depending on some other property of the model, such as the degree.
When defining a custom model class the value of this attribute is automatically set by the
Parameter
attributes defined in the class body.
- x_0 = Parameter('x_0', value=0.0)#
- y_0 = Parameter('y_0', value=0.0)#
Methods Documentation