ERIS Pipeline Reference Manual 1.9.2
Functions
sc_plot.h File Reference

Header for plotting library. More...

#include <sc_basic.h>

Go to the source code of this file.

Functions

cpl_error_code sc_plot_single_spec (const cpl_table *spec, cpl_parameterlist *plottags)
 
cpl_error_code sc_plot_double_spec (const cpl_table *spec1, const cpl_table *spec2, cpl_parameterlist *plottags)
 
cpl_error_code sc_overplot_spec (const cpl_table *spec, cpl_parameterlist *plottags)
 
cpl_error_code sc_plot_hist (const cpl_table *histdat, cpl_parameterlist *plottags)
 
cpl_error_code sc_plot_single_spec_with_lines (const cpl_table *spec, cpl_parameterlist *plottags)
 
void sc_setplottags_single_spec (cpl_parameterlist *plottags, const char *x_column, const char *y_column, const char *title, const char *x_label, const char *y_label, const cpl_parameterlist *parlist)
 
void sc_setplottags_double_spec (cpl_parameterlist *plottags, const char *x_column1, const char *y_column1, const char *title1, const char *x_label1, const char *y_label1, const char *x_column2, const char *y_column2, const char *title2, const char *x_label2, const char *y_label2, const cpl_parameterlist *parlist)
 
void sc_setplottags_overplot_spec (cpl_parameterlist *plottags, const char *x_column, const char *y_column1, const char *y_column2, const char *specname1, const char *specname2, const char *title, const char *x_label, const char *y_label, const cpl_parameterlist *parlist)
 
void sc_setplottags_hist (cpl_parameterlist *plottags, const char *title, const char *x_label, const char *y_label, const cpl_parameterlist *parlist)
 
void sc_setplottags_single_spec_lines (cpl_parameterlist *plottags, const char *title, const char *x_label, const char *y_label, const cpl_parameterlist *parlist)
 

Detailed Description

Header for plotting library.

Author
Wolfgang Kausch & ESO In-Kind Team Innsbruck
Since
02 Feb 2011
Date
28 Aug 2013

Definition in file sc_plot.h.

Function Documentation

◆ sc_overplot_spec()

cpl_error_code sc_overplot_spec ( const cpl_table *  spec,
cpl_parameterlist *  plottags 
)

This program is dedicated to produce plots for a direct comparison of spectra. The input must be a CPL table containing ONE column used as abscissa ('x_column' in plot tags), but TWO individual columns must be present to be used as individual ordinates ('y_column1' and 'y_column2', see plottags). This is necessary, as it must be ensured that both spectra are defined on the same wavelength grid.

The comparison is made with two plot panels lying above each other. The upper panel of the plot is a direct overplot of the two spectra, whereas in the lower panel the Residual plot (Spectrum #1 - Spectrum #2) is given.

INPUT:

Parameters
specTable containing both spectra (output of molecfit)
plottagsparameter list containing tags

ERRORS:

  • CPL_ERROR_NONE: no error occurred

Definition at line 893 of file sc_plot.c.

References sc_basic_initstring(), and SC_MAXLEN.

◆ sc_plot_double_spec()

cpl_error_code sc_plot_double_spec ( const cpl_table *  spec1,
const cpl_table *  spec2,
cpl_parameterlist *  plottags 
)

This program plots two spectra, e.g. object and sky spectra. Input parameters must be CPL tables. The two spectra are plotted on two different panels, lying upon another. Spectrum 1 is plotted in the upper Spectrum 2 in the lower panel. Hence, required tags for the individual data sets have to be set using sc_setplottags_double_spec().

INPUT:

Parameters
spec1Spectrum 1
spec2Spectrum 2
plottagsparameter list containing tags

ERRORS:

  • CPL_ERROR_NONE: no error occurred

Definition at line 464 of file sc_plot.c.

References sc_basic_initstring(), and SC_MAXLEN.

◆ sc_plot_hist()

cpl_error_code sc_plot_hist ( const cpl_table *  histdat,
cpl_parameterlist *  plottags 
)

This program creates a histogram from a 2-column CPL table. This table must have two columns labelled as "bins" and "counts" (see create_hist() ).

INPUT:

Parameters
histdat2 column cpl table
plottagsparameter list containing info from parameter file

ERRORS:

  • CPL_ERROR_NONE: no error occurred
  • CPL_ERROR_ILLEGAL_INPUT

Definition at line 1430 of file sc_plot.c.

References sc_basic_initstring(), and SC_MAXLEN.

◆ sc_plot_single_spec()

cpl_error_code sc_plot_single_spec ( const cpl_table *  spec,
cpl_parameterlist *  plottags 
)

This program creates a plot from two choosable columns of a CPL table. It expects the following plot tags:

 - column name used for the x-axis
 - column name used for the y-axis
 - plot title
 - label for x-axis
 - label for y-axis

These plot tags have to be set via sc_setplottags_single_spec() routine. Additionally, the gnuplot terminal type, and the directory structure given in the parameter file are added automatically.

INPUT:

Parameters
spec2 column cpl table containing spectrum (wavelength [micron], radiance flux/transmission)
plottagsCPL parameterlist containing plot tags

ERRORS:

  • CPL_ERROR_NONE: no error occurred

Definition at line 139 of file sc_plot.c.

References sc_basic_initstring(), and SC_MAXLEN.

◆ sc_plot_single_spec_with_lines()

cpl_error_code sc_plot_single_spec_with_lines ( const cpl_table *  spec,
cpl_parameterlist *  plottags 
)

This program plots a single spectrum with detected lines from a CPL table. One column (labelled "lambda") must contain wavelength information, another one ("flux") gives the flux, and a the third column labelled "class" must contain information whether the corresponding pixel belongs to the continuum (value=0), a line (=1), a line peak (=2) or is the line peak of an isolated line (=3). Line peaks are marked by a marker, i.e. a black line, isolated peaks by a blue line. In addition, the wavelength of the corresponding line peak pixel is added.

INPUT:

Parameters
specCpl table containing spectrum
plottagsparameter list containing tags

ERRORS:

  • CPL_ERROR_NONE: no error occurred

Definition at line 1731 of file sc_plot.c.

References sc_basic_initstring(), and SC_MAXLEN.

◆ sc_setplottags_double_spec()

void sc_setplottags_double_spec ( cpl_parameterlist *  plottags,
const char *  x_column1,
const char *  y_column1,
const char *  title1,
const char *  x_label1,
const char *  y_label1,
const char *  x_column2,
const char *  y_column2,
const char *  title2,
const char *  x_label2,
const char *  y_label2,
const cpl_parameterlist *  parlist 
)

Routine to set plot tags for double spectrum plot. The two spectra are plotted on two different panels, lying upon another. Hence, tags for the individual data sets have to be given. Spectrum 1 is plotted in the upper Spectrum 2 in the lower panel.

The following input tags are required:

INPUT:

Parameters
plottagsParameter list to be filled with tags
x_column1CPL table column name used for the abscissa (Spectrum 1)
y_column1CPL table column name used for the ordinate (Spectrum 1)
title1Plot title (Spectrum 1)
x_label1Label string for x-axis (Spectrum 1)
y_label1Label string for y-axis (Spectrum 1)
x_column2CPL table column name used for the abscissa (Spectrum 2)
y_column2CPL table column name used for the ordinate (Spectrum 2)
title2Plot title (Spectrum 2)
x_label2Label string for x-axis (Spectrum 2)
y_label2Label string for y-axis (Spectrum 2)
parlistParameter list containing information from the parameter file OUTPUT:
plottagsFilled parameter list containing tags

Base directory, output directory, output name, and gnuplot terminal type are added automatically from parameter list. NOTE: NULL is not accepted, use " " instead!

Definition at line 366 of file sc_plot.c.

References SC_MAXLEN.

◆ sc_setplottags_hist()

void sc_setplottags_hist ( cpl_parameterlist *  plottags,
const char *  title,
const char *  x_label,
const char *  y_label,
const cpl_parameterlist *  parlist 
)

Routine to set plot tags for histogram plots.

The following input tags are required:

INPUT:

Parameters
plottagsParameter list to be filled with tags
titlePlot title
x_labelLabel string for x-axis
y_labelLabel string for y-axis
parlistParameter list containing information from the parameter file OUTPUT:
plottagsFilled parameter list containing tags

Base directory, output directory, output name, and gnuplot terminal type are added automatically from parameter list. NOTE: NULL is not accepted, use " " instead!

Definition at line 1366 of file sc_plot.c.

References SC_MAXLEN.

◆ sc_setplottags_overplot_spec()

void sc_setplottags_overplot_spec ( cpl_parameterlist *  plottags,
const char *  x_column,
const char *  y_column1,
const char *  y_column2,
const char *  specname1,
const char *  specname2,
const char *  title,
const char *  x_label,
const char *  y_label,
const cpl_parameterlist *  parlist 
)

Routine to set plot tags for spectra overplot routine. The two spectra are plotted in one panel (upper), the residual of the two input spectra (Spectrum #1 - Spectrum #2) is plotted in the lower panel.

The following input tags are required:

INPUT:

Parameters
plottagsParameter list to be filled with tags
x_columnCPL table column name used for the abscissa
y_column1CPL table column name used for the ordinate (Spectrum 1)
y_column2CPL table column name used for the ordinate (Spectrum 2)
specname1Designator of spectrum 1 (used in legend)
specname2Designator of spectrum 2 (used in legend)
titlePlot title
x_labelLabel string for x-axis
y_labelLabel string for y-axis
parlistParameter list containing information from the parameter file OUTPUT:
plottagsFilled parameter list containing tags

Base directory, output directory, output name, and gnuplot terminal type are added automatically from parameter list. NOTE: NULL is not accepted, use " " instead!

Definition at line 802 of file sc_plot.c.

References SC_MAXLEN.

◆ sc_setplottags_single_spec()

void sc_setplottags_single_spec ( cpl_parameterlist *  plottags,
const char *  x_column,
const char *  y_column,
const char *  title,
const char *  x_label,
const char *  y_label,
const cpl_parameterlist *  parlist 
)

Routine to set plot tags for single spectrum plot. The following input tags are required:

INPUT:

Parameters
plottagsParameter list to be filled with tags
x_columnCPL table column name used for the abscissa
y_columnCPL table column name used for the ordinate
titlePlot title
x_labelLabel string for x-axis
y_labelLabel string for y-axis
parlistParameter list containing information from the parameter file OUTPUT:
plottagsFilled parameter list containing tags

Base directory, output directory, output name, and gnuplot terminal type are added automatically from parameter list. NOTE: NULL is not accepted, use " " instead!

Definition at line 66 of file sc_plot.c.

References SC_MAXLEN.

◆ sc_setplottags_single_spec_lines()

void sc_setplottags_single_spec_lines ( cpl_parameterlist *  plottags,
const char *  title,
const char *  x_label,
const char *  y_label,
const cpl_parameterlist *  parlist 
)

Routine to set plot tags for single spectrum plot with detected lines. Required input parameters are:

INPUT:

Parameters
plottagsParameter list to be filled with tags
titlePlot title
x_labelLabel string for x-axis
y_labelLabel string for y-axis
parlistParameter list containing information from the parameter file OUTPUT:
plottagsFilled parameter list containing tags

Base directory, output directory, output name, and gnuplot terminal type are added automatically from parameter list. NOTE: NULL is not accepted, use " " instead!

Definition at line 1664 of file sc_plot.c.

References SC_MAXLEN.