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:
imageNDData-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_objectTrace, 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_profModel, optional

A model for the image’s background flux. [default: models.Polynomial1D(2)]

variancendarray, optional

(Only used if image is not an NDData object.) The associated variances for each pixel in the image. Must have the same dimensions as image. 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]

maskndarray, optional

(Only used if image is not an NDData object.) Whether to mask each pixel in the image. Must have the same dimensions as image. If blank, all non-NaN pixels are unmasked. [default: None]

unitUnit or str, optional

(Only used if image is not an NDData object.) The associated unit for the data in image. If blank, fluxes are interpreted in DN. [default: None]