|
ERIS Pipeline Reference Manual 1.9.2
|
#include <sc_skycorr.h>Go to the source code of this file.
Functions | |
| cpl_error_code | sc_skycorr (cpl_parameterlist *parlist, cpl_table *scispec, cpl_table *skyspec, int product_depth) |
| cpl_error_code | sc_skycorr_subcont (cpl_table *spec, cpl_table *linetab, cpl_parameterlist *parlist, const cpl_table *groups) |
| cpl_error_code | sc_skycorr_fit (cpl_table *scispec, cpl_table *skyspec, cpl_table *groups, cpl_parameterlist *parlist, int product_depth) |
| cpl_error_code | sc_skycorr_subsky (cpl_table *scispec) |
| cpl_error_code sc_skycorr | ( | cpl_parameterlist * | parlist, |
| cpl_table * | scispec, | ||
| cpl_table * | skyspec, | ||
| int | product_depth | ||
| ) |
This is the top-level routine of the sky correction code that subtracts an optimised 1D sky spectrum from an 1D science spectrum. The optimisation process is a CMPFIT-based fitting procedure that adapts airglow lines in the sky spectrum to those in the science spectrum. Object-related lines in the science spectrum should not be affected by this procedure. The sky continuum is taken from the sky spectrum without optimisation, since a separation of object and sky continuum in the science spectrum is not possible. All required information for the sky correction procedure is provided by an input ASCII parameter file.
INPUT:
| parfile_in | name of parameter file |
ERRORS:
Definition at line 48 of file sc_skycorr.c.
References sc_lines(), SC_MAXLEN, sc_skycorr_fit(), sc_skycorr_subcont(), sc_skycorr_subsky(), and sc_specdiss_init_linetab().
Referenced by eris_ifu_jitter_process_cubes().
| cpl_error_code sc_skycorr_fit | ( | cpl_table * | scispec, |
| cpl_table * | skyspec, | ||
| cpl_table * | groups, | ||
| cpl_parameterlist * | parlist, | ||
| int | product_depth | ||
| ) |
CMPFIT-based fitting procedure to adapt the sky line spectrum to the science line spectrum.
INPUT:
| scispec | CPL table with science spectrum |
| skyspec | CPL table with sky spectrum |
| groups | CPL table with airglow line information |
| parlist | general CPL parameter list |
OUTPUT:
| scispec | science and best-fit modified sky spectrum |
| skyspec | sky spectrum with line group weights |
| groups | modified line table |
| parlist | parameter list with additional entries |
ERRORS:
Definition at line 330 of file sc_skycorr.c.
References sc_mpfit(), sc_mpfit_freememresult(), and sc_weights().
Referenced by sc_skycorr().
| cpl_error_code sc_skycorr_subcont | ( | cpl_table * | spec, |
| cpl_table * | linetab, | ||
| cpl_parameterlist * | parlist, | ||
| const cpl_table * | groups | ||
| ) |
Subtracts continuum from a spectrum and derives FWHM of spectral lines in this spectrum.
The FWHM is derived by an iterative procedure that identifies isolated lines, subtracts the continuum from these lines, and derives a clipped mean FWHM. Then, the resulting line width is used for another line search and so on. The procedure stops either if the relative change of the FWHM between two iterations is below the 'ltol' value from the input parameter list or after the 10th iteration.
The list of line pixels identified by means of the first derivative of the line flux is supplemented by pixels belonging to lines taken from the airglow line lists. The number of pixels per line depends on the FWHM derived before. Only lines are considered that have peak fluxes above a threshold. If desired (parameter 'fluxlim' = -1), the flux limit will be searched by an iterative procedure which tries to find the best compromise between sufficient continuum pixels and a high number of considered lines. In the case of a positive value for 'fluxlim', this value is multiplied by the median flux of the already identified lines in order to obtain the actual threshold. Factors in the order of 0.01 are expected to work for most kind of spectra.
INPUT:
| spec | CPL table with spectrum |
| linetab | CPL table for information on detected lines |
| parlist | general CPL parameter list |
| groups | CPL table with airglow line information |
OUTPUT:
| spec | spectrum with separation of lines and continuum |
| linetab | CPL table with information on detected lines |
| parlist | parameter list with updated line FWHM and relative line flux limit |
ERRORS:
Definition at line 134 of file sc_skycorr.c.
References sc_basic_arr2col(), sc_basic_col2arr(), sc_contsub(), sc_contsub_check(), sc_contsub_identcont(), sc_contsub_skipthermir(), sc_fwhmest(), and sc_specdiss_find_emissionlines().
Referenced by sc_skycorr().
| cpl_error_code sc_skycorr_subsky | ( | cpl_table * | scispec | ) |
Subtracts sky continuum and fit-optimised sky line flux from science spectrum. The resulting sky-corrected flux is written into the new column "scflux". If an error occurred before, the flux correction is not carried out. If flux error and mask column exist in the input spectra, the effect of sky subtraction on these columns is also considered. The resulting columns are labelled "scdflux" and "scmask" in this case.
INPUT:
| scispec | CPL table with science spectrum and best-fit modified sky spectrum |
OUTPUT:
| scispec | data table with column for sky-subtracted flux |
ERRORS:
Definition at line 450 of file sc_skycorr.c.
Referenced by sc_skycorr().