EllipseFitter¶
- class photutils.isophote.EllipseFitter(sample)[source]¶
Bases:
object
Class to fit ellipses.
- Parameters:
- sample
EllipseSample
instance The sample data to be fitted.
- sample
Methods Summary
fit
([conver, minit, maxit, fflag, maxgerr, ...])Fit an elliptical isophote.
Methods Documentation
- fit(conver=0.05, minit=10, maxit=50, fflag=0.7, maxgerr=0.5, going_inwards=False)[source]¶
Fit an elliptical isophote.
- Parameters:
- converfloat, optional
The main convergence criterion. Iterations stop when the largest harmonic amplitude becomes smaller (in absolute value) than
conver
times the harmonic fit rms. The default is 0.05.- minitint, optional
The minimum number of iterations to perform. A minimum of 10 (the default) iterations guarantees that, on average, 2 iterations will be available for fitting each independent parameter (the four harmonic amplitudes and the intensity level). For the first isophote, the minimum number of iterations is 2 *
minit
to ensure that, even departing from not-so-good initial values, the algorithm has a better chance to converge to a sensible solution.- maxitint, optional
The maximum number of iterations to perform. The default is 50.
- fflagfloat, optional
The acceptable fraction of flagged data points in the sample. If the actual fraction of valid data points is smaller than this, the iterations will stop and the current
Isophote
will be returned. Flagged data points are points that either lie outside the image frame, are masked, or were rejected by sigma-clipping. The default is 0.7.- maxgerrfloat, optional
The maximum acceptable relative error in the local radial intensity gradient. This is the main control for preventing ellipses to grow to regions of too low signal-to-noise ratio. It specifies the maximum acceptable relative error in the local radial intensity gradient. Busko (1996; ASPC 101, 139) showed that the fitting precision relates to that relative error. The usual behavior of the gradient relative error is to increase with semimajor axis, being larger in outer, fainter regions of a galaxy image. In the current implementation, the
maxgerr
criterion is triggered only when two consecutive isophotes exceed the value specified by the parameter. This prevents premature stopping caused by contamination such as stars and HII regions.A number of actions may happen when the gradient error exceeds
maxgerr
(or becomes non-significant and is set toNone
). If the maximum semimajor axis specified bymaxsma
is set toNone
, semimajor axis growth is stopped and the algorithm proceeds inwards to the galaxy center. Ifmaxsma
is set to some finite value, and this value is larger than the current semimajor axis length, the algorithm enters non-iterative mode and proceeds outwards until reachingmaxsma
. The default is 0.5.- going_inwardsbool, optional
Parameter to define the sense of SMA growth. When fitting just one isophote, this parameter is used only by the code that defines the details of how elliptical arc segments (“sectors”) are extracted from the image, when using area extraction modes (see the
integrmode
parameter in theEllipseSample
class). The default isFalse
.
- Returns:
- result
Isophote
instance The fitted isophote, which also contains fit status information.
- result
Examples
>>> from photutils.isophote import EllipseSample, EllipseFitter >>> sample = EllipseSample(data, sma=10.0) >>> fitter = EllipseFitter(sample) >>> isophote = fitter.fit()