|
ERIS Pipeline Reference Manual 1.8.15
|
programme to find emission lines in spectra More...
#include <sc_specdiss.h>Go to the source code of this file.
| cpl_error_code | sc_specdiss_find_emissionlines (cpl_table *input_spectrum, cpl_table *linetab, cpl_parameterlist *parlist, const cpl_table *groups) |
| cpl_error_code | sc_specdiss_find_isolatedlines (cpl_table *linetab, cpl_table *input_spectrum, cpl_parameterlist *parlist) |
| cpl_error_code | sc_specdiss_find_localmaxima (cpl_table *input_table, char *newcolname, char *colname, const double lower_threshold, const double upper_threshold) |
| cpl_error_code | sc_specdiss_find_valuesoutside (cpl_table *input_table, char *newcolname, char *colname, const double lowlim, const double uplim) |
| int | sc_specdiss_count_lines (const cpl_table *intable) |
| cpl_error_code | sc_specdiss_create_hist (cpl_table *hist, const cpl_table *input_table, char *col_name, const int n_bins) |
| void | sc_specdiss_init_linetab (cpl_table *linetab) |
| cpl_error_code | sc_specdiss_merge_speclinelist (cpl_table *spec, const cpl_table *groups, const cpl_parameterlist *parlist) |
| cpl_error_code | sc_specdiss_identify_airglowlines (cpl_table *spec) |
| cpl_error_code | sc_specdiss_find_valuesabove (cpl_table *input_table, char *newcolname, char *colname, const double lowlim) |
programme to find emission lines in spectra
Definition in file sc_specdiss.c.
| int sc_specdiss_count_lines | ( | const cpl_table * | intable | ) |
Routine to count detected line peaks, i.e. counting the # of rows flagged with a value > 0 in column "peaks" of intable
INPUT:
| intable | input CPL table |
OUTPUT:
Definition at line 866 of file sc_specdiss.c.
| cpl_error_code sc_specdiss_create_hist | ( | cpl_table * | hist, |
| const cpl_table * | input_table, | ||
| char * | col_name, | ||
| const int | n_bins | ||
| ) |
Routine to create a histogram binning with n_bins from a choosable column of an input CPL table. The histogram data is stored into a CPL table
INPUT:
| hist | CPL table to be filled with histogram information |
| input_table | table containing column "col_name" |
| col_name | column of input table to be used for binning |
| n_bins | # of histogram bins |
OUTPUT:
| hist | CPL table with histogram information (bins/counts) |
ERRORS:
Definition at line 894 of file sc_specdiss.c.
| cpl_error_code sc_specdiss_find_emissionlines | ( | cpl_table * | input_spectrum, |
| cpl_table * | linetab, | ||
| cpl_parameterlist * | parlist, | ||
| const cpl_table * | groups | ||
| ) |
This routine is aimed to detect line peaks in an input spectrum to separate pixels belonging to lines and to the continuum. The lines are finally separated in isolated/blended lines, the first being used to determine a rough estimate of the FWHM of the spectrum.
The input spectrum has to be a CPL table containing (at least) the following columns:
col #1: lambda col #2: flux
The wavelength dimension must be [micron], the flux is arbitrary. An additional column labelled "class" is added to the spectrum table, which is used to classify the single pixels in the following way:
0 = Continuum 1 = Line pixel 2 = Line peak 3 = Isolated line peak
The second input parameter must be an empty CPL table, but already initialised with sc_specdiss_init_linetab(). This table is filled with information about the detected lines (see sc_specdiss_find_isolatedlines).
INPUT:
| input_spectrum | table containing input spectra |
| linetab | empty table to be filled with line information |
| parlist | CPL parameter list containing information of the parameter file |
| groups | CPL table with airglow line information |
OUTPUT:
ERRORS:
Definition at line 59 of file sc_specdiss.c.
References SC_MAXLEN, sc_specdiss_find_isolatedlines(), sc_specdiss_find_localmaxima(), sc_specdiss_identify_airglowlines(), sc_specdiss_merge_speclinelist(), and SC_THERMIRLIM.
Referenced by sc_skycorr_subcont().
| cpl_error_code sc_specdiss_find_isolatedlines | ( | cpl_table * | linetab, |
| cpl_table * | input_spectrum, | ||
| cpl_parameterlist * | parlist | ||
| ) |
This programme searches for isolated lines (required for determining the FWHM) in an input spectrum.
The following two criteria to identify an isolated line are applied:
(1) Distance to neighbouring line: larger / equal
[min_line_dist_fac] * [measured FWHM] (in px);
For first line: = distance to spectrum start (in px),
last line: = distance to spec end
(2) Symmetry of line shape: # pixels left of peak = # pixels on
the right hand side (+/- 1 px)
The input spectrum must be a CPL table containing (at least) the following columns:
col #1: lambda col #2: flux col #3: class
The column "class" finally contains information on the pixel type in following way:
0 = Continuum 1 = Line pixel 2 = Line peak 3 = Isolated line peak (used for FWHM determination)
Additionally, the CPL table linetab is filled with the following information:
col #1: width - line width [pixels]
col #2: peak_loc - Peak location [pixels]
col #3: peak_lam - Peak location [wavelength]
col #4: peak_flux - Flux of line peak pixel
col #5: px_bef - number of line pixels before line peak
col #6: px_aft - number of line pixels after line peak
col #7: line_px_start - first pixel of line
col #8: line_px_end - last pixel of line
col #9: dist_bef - distance to previous line [pixel]
col #10: dist_aft - distance to subsequent line [pixels]
col #11: isol_flag - flag indicating an isol. line
(0=no / 1=yes)
col #12: fwhm - Full Width Half Maximum column (to be
filled later)
col #13: line_list - Line list value:
=0 : not present
>0 : # of linelist lines in pixel
INPUT:
| linetab | table to be filled with information on the lines |
| input_spectrum | table containing input spectra |
| parlist | CPL parameter list containing information of the parameter file |
OUTPUT:
| linetab | information about the detected lines is stored to this table |
| input_spectrum | spectrum table col "class" is filled |
ERRORS:
Definition at line 346 of file sc_specdiss.c.
Referenced by sc_specdiss_find_emissionlines().
| cpl_error_code sc_specdiss_find_localmaxima | ( | cpl_table * | input_table, |
| char * | newcolname, | ||
| char * | colname, | ||
| const double | lower_threshold, | ||
| const double | upper_threshold | ||
| ) |
Routine to search for local maxima below and above two thresholds within a column table. It is used to identify line peaks within a range of pixels belonging to a single line.
INPUT:
| input_table | table containing input spectra |
| newcolname | table column to be added to input_table |
| colname | name of column to be used for search |
| lower_threshold | lower threshold for search |
| upper_threshold | upper threshold for search |
OUTPUT:
| input_table | an additional column is added to the input table |
| newcolname | table column to be added to input_table containing search results |
ERRORS:
Definition at line 634 of file sc_specdiss.c.
References SC_MAXLEN, sc_specdiss_find_valuesoutside(), and SC_THERMIRLIM.
Referenced by sc_specdiss_find_emissionlines().
| cpl_error_code sc_specdiss_find_valuesabove | ( | cpl_table * | input_table, |
| char * | newcolname, | ||
| char * | colname, | ||
| const double | lowlim | ||
| ) |
Routine to search for values within a column table: lowlim <= VALUES
An additional column (2nd input parameter) is added to the input table, rows fulfilling the condition are flagged (value=1, =0 otherwise).
INPUT:
| input_table | table containing input spectra |
| newcolname | column to be added to input table containing search results |
| lowlim | lower threshold |
| colname | column to be used for search |
OUTPUT:
| input_table | an additional column is added to the input table |
| newcolname | table column to be added to input_table containing search results |
ERRORS:
Definition at line 1234 of file sc_specdiss.c.
| cpl_error_code sc_specdiss_find_valuesoutside | ( | cpl_table * | input_table, |
| char * | newcolname, | ||
| char * | colname, | ||
| const double | lowlim, | ||
| const double | uplim | ||
| ) |
Routine to search for entries in a table column fulfilling the following criteria:
entry <= lowlim && entry >= uplim
An additional column (2nd input parameter) is added to the input table, rows fulfilling the condition are flagged:
value = -1, if entry <= lowlim value = 1, if entry >= uplim value = 0, otherwise
INPUT:
| input_table | table containing input spectra |
| newcolname | column to be added to input table containing search results |
| lowlim | lower threshold |
| uplim | upper threshold |
| colname | column to be used for search |
OUTPUT:
| input_table | an additional column is added to the input table |
| newcolname | table column to be added to input_table containing search results |
ERRORS:
Definition at line 802 of file sc_specdiss.c.
Referenced by sc_specdiss_find_localmaxima().
| cpl_error_code sc_specdiss_identify_airglowlines | ( | cpl_table * | spec | ) |
Identifies airglow lines in spectrum and updates 'linelist' column
INPUT:
| spec | CPL table with spectrum |
OUTPUT:
| spec | spectrum table with updated 'linelist' column |
Definition at line 1202 of file sc_specdiss.c.
Referenced by sc_specdiss_find_emissionlines().
| void sc_specdiss_init_linetab | ( | cpl_table * | linetab | ) |
Routine to initialise CPL table containing all information about the detected lines. The following columns are added:
col #1: width - line width [pixels]
col #2: peak_loc - Peak location [pixels]
col #3: peak_lam - Peak location [wavelength]
col #4: peak_flux - Flux of line peak pixel
col #5: px_bef - number of line pixels before line peak
col #6: px_aft - number of line pixels after line peak
col #7: line_px_start - first pixel of line
col #8: line_px_end - last pixel of line
col #9: dist_bef - distance to previous line [pixel]
col #10: dist_aft - distance to subsequent line [pixels]
col #11: isol_flag - flag indicating an isol. line
(0=no / 1=yes)
col #12: fwhm - Full Width Half Maximum column
col #13: line_list - Line list value:
=0 : not present
>0 : # of linelist lines in pixel
INPUT:
| linetab | empty CPL table |
OUTPUT:
| linetab | table with initialised columns for information on detected lines |
Definition at line 974 of file sc_specdiss.c.
Referenced by sc_skycorr().
| cpl_error_code sc_specdiss_merge_speclinelist | ( | cpl_table * | spec, |
| const cpl_table * | groups, | ||
| const cpl_parameterlist * | parlist | ||
| ) |
Routine to read line list and merge line list with input spectrum. The line list is read from a file, all lines of the list are marked in the column "linelist" of the input spectrum table in the following way:
1 = line list pixel 2 = line list peak
INPUT:
| spec | CPL table with input spectrum |
| groups | CPL table with airglow line information |
| parlist | parameter list containing file name of line list |
OUTPUT:
| spec | CPL table with initialised columns for information on detected lines |
Definition at line 1023 of file sc_specdiss.c.
Referenced by sc_specdiss_find_emissionlines().