cngi.image.cont_sub
¶
-
cont_sub
(xds, dv='IMAGE', fitorder=2, chans=None, linename='LINE', contname='CONTINUUM', compute=False)[source]¶ Continuum subtraction of an image cube
Perform a polynomial baseline fit to the specified channels from an image and subtract it from all channels
- Parameters
xds (xarray.core.dataset.Dataset) – image xarray dataset
dv (str) – name of data_var in xds to polynomal fit. Default is ‘IMAGE’
chans (array of int) – Spectral channels to use for fitting a polynomial to determine continuum. Default is None, use all channels.
fitorder (int) – Order of polynomial to fit to the specified spectral channels to determine the continuum. Default is 2.
linename (str) – dataset variable name for output: name of image to which to save the result of subtracting the computed continuum from the input image. overwrites if already present. Default is ‘LINE’
contname (str) – dataset variable name for output:the computed continuum image. overwrites if already present. Default is ‘CONTINUUM’
compute (bool) – execute the DAG to compute the fit error. Default False returns lazy DAG (error can then be retrieved via xds.<name>.<key>.values)
- Returns
output Image
- Return type
xarray.core.dataset.Dataset