OptimalExtract¶
- class specreduce.extract.OptimalExtract(image: ~astropy.nddata.nddata.NDData, trace_object: ~specreduce.tracing.Trace, bkgrd_prof: ~astropy.modeling.core.Model = <Polynomial1D(2, c0=0., c1=0., c2=0.)>, variance: ~typing.Optional[~numpy.ndarray] = None, mask: ~typing.Optional[~numpy.ndarray] = None, unit: ~typing.Optional[~numpy.ndarray] = None, disp_axis: int = 1, crossdisp_axis: int = 0)[source]¶
Bases:
HorneExtract
An alias for
HorneExtract
.Perform a Horne (a.k.a. optimal) extraction on a two-dimensional spectrum.
- Parameters:
- image
NDData
-like or array-like, required The input 2D spectrum from which to extract a source. An NDData object must specify uncertainty and a mask. An array requires use of the
variance
,mask
, &unit
arguments.- trace_object
Trace
, required The associated 1D trace object created for the 2D image.
- disp_axisint, optional
The index of the image’s dispersion axis. [default: 1]
- crossdisp_axisint, optional
The index of the image’s cross-dispersion axis. [default: 0]
- bkgrd_prof
Model
, optional A model for the image’s background flux. [default: models.Polynomial1D(2)]
- variance
ndarray
, optional (Only used if
image
is not an NDData object.) The associated variances for each pixel in the image. Must have the same dimensions asimage
. If all zeros, the variance will be ignored and treated as all ones. If any zeros, those elements will be excluded via masking. If any negative values, an error will be raised. [default: None]- mask
ndarray
, optional (Only used if
image
is not an NDData object.) Whether to mask each pixel in the image. Must have the same dimensions asimage
. If blank, all non-NaN pixels are unmasked. [default: None]- unit
Unit
or str, optional (Only used if
image
is not an NDData object.) The associated unit for the data inimage
. If blank, fluxes are interpreted in DN. [default: None]
- image