ERIS Pipeline Reference Manual 1.8.15
sc_contsub.c File Reference
#include <sc_contsub.h>

Go to the source code of this file.

Functions

cpl_error_code sc_contsub (cpl_table *spec)
 
cpl_error_code sc_contsub_identcont (cpl_table *spec, const cpl_table *groups, const cpl_table *linetab, const double fluxlim, const cpl_parameterlist *parlist)
 
int sc_contsub_check (cpl_table *spec)
 
cpl_error_code sc_contsub_skipthermir (cpl_table *spec)
 

Detailed Description

Routines related to continuum identification, interpolation, and subtraction

Author
Marco Barden, Stefan Noll, & ESO In-Kind Team Innsbruck
Date
19 Sep 2013

Definition in file sc_contsub.c.

Function Documentation

◆ sc_contsub()

cpl_error_code sc_contsub ( cpl_table *  spec)

Interpolate and subtract continuum from a spectrum.

This routine uses the mask column in spec to identify emission lines and interpolate the flux at their position using the closest continuum points.

The input spectrum has to be a CPL table containing (at least) the following columns:

 col #1: lambda
 col #2: flux
 col #3: mask

The column "class" is is expected to contain the following values: 0 = Continuum 1 = Line pixel 2 = Line peak 3 = Isolated line peak

On output the spectrum contains two new columns: col #4: cflux col #5: lflux containing the continuum and line fluxes. Col #5, lflux, is the continuum subtracted line flux. The sum of lflux and cflux corresponds to col #2, flux.

INPUT:

Parameters
specspectrum

OUTPUT:

Parameters
specspectrum

ERRORS:

  • CPL_ERROR_NONE: no error occurred
  • CPL_ERROR_ILLEGAL_INPUT: error in input spectra

Definition at line 50 of file sc_contsub.c.

References sc_basic_filtermedian(), and sc_basic_interpollin().

Referenced by sc_skycorr_subcont().

◆ sc_contsub_check()

int sc_contsub_check ( cpl_table *  spec)

Checks distribution of continuum pixels over spectral range. If the distribution allows the continuum to be interpolated in a reliable way, a value of 0 is returned. The fraction of continuum pixels and the fraction of the wavelength range covered by continuum pixels is checked.

INPUT:

Parameters
specCPL table with spectrum

OUTPUT:

  • none

ERRORS:

  • none

Definition at line 422 of file sc_contsub.c.

Referenced by sc_skycorr_subcont().

◆ sc_contsub_identcont()

cpl_error_code sc_contsub_identcont ( cpl_table *  spec,
const cpl_table *  groups,
const cpl_table *  linetab,
const double  fluxlim,
const cpl_parameterlist *  parlist 
)

Identifies continuum windows in a spectrum by excluding airglow lines from a list with a peak flux above a threshold which is the product of the input parameter 'fluxlim' and the median peak flux of the lines already identified by a line finder. The remaining continuum pixels are identified by a value of 0 in the 'mask' column of the spectrum table. If there are no identified lines, the mean of the line list fluxes is used instead of the median peak flux of the identified lines.

INPUT:

Parameters
specCPL table with spectrum
groupsCPL table with airglow line information
linetabCPL table with information on detected lines
fluxlimrelative lower line peak flux limit
parlistgeneral CPL parameter list

OUTPUT:

Parameters
specspectrum with updated line/continuum flag

ERRORS:

  • see subroutines

Definition at line 171 of file sc_contsub.c.

References sc_basic_rebin().

Referenced by sc_skycorr_subcont().

◆ sc_contsub_skipthermir()

cpl_error_code sc_contsub_skipthermir ( cpl_table *  spec)

Identifies all pixels at wavelengths longer than SC_THERMIRLIM as continuum pixels. This measure avoids the scaling of emission lines originating in the lower atmosphere.

INPUT:

Parameters
specCPL table with spectrum

OUTPUT:

Parameters
specspectrum with continuum beyond thermal IR limit

ERRORS:

  • none

Definition at line 497 of file sc_contsub.c.

References SC_THERMIRLIM.

Referenced by sc_skycorr_subcont().