Recipe to correct sky residuals on science cubes

Functions

int cpl_plugin_get_info (cpl_pluginlist *list)
 Build the list of available plugins, for this module.

sinfo_skycor_qc_new

structure to init skycor_qc

Returns:
pointer to structure


sinfo_skycor_qc * sinfo_skycor_qc_new (void)

sinfo_skycor_qc_delete

function to free a skycor_qc structure

Returns:
void


void sinfo_skycor_qc_delete (sinfo_skycor_qc **sqc)
int sinfo_skycor (cpl_parameterlist *config, cpl_frame *obj_frm, cpl_frame *sky_frm, sinfo_skycor_qc *sqc, cpl_imagelist **obj_cor, cpl_table **int_obj)
 Execute the plugin instance given by the interface.

sinfo_where_tab_min_max

finds table rows comprised between a min and a max

Parameters:
t input table
col column involved in selection
op1 first operation of selection
v1 first threshold value
op2 second operation of selection
v2 second threshold value
Returns:
new allocated sub table satisfying conditions


cpl_table * sinfo_where_tab_min_max (cpl_table *t, const char *col, cpl_table_select_operator op1, const double v1, cpl_table_select_operator op2, const double v2)

sinfo_histogram

computes histogram

Parameters:
data input data table
nbins input size of histogram bin
min input min data to be considered in histogram
max input max data to be considered in histogram
hist output histogram: table with results: # H: histogram # X: array of data values corresponding to the center of each bin # Xmean: 1D array corresponding to the mean of the data values entering each histogram bin Returns in case of succes -1 else.

Compute the histogram with the IDL intrinsic function HISTOGRAM, using the input options specified by the parameters Dmin, Dmax, Bin. All the computations are performed in floating-point arithmetics. Then compute arrays of values corresponding to each histogram bin, useful for plots, fitting, etc.



int sinfo_histogram (const cpl_table *data, const int nbins, const double min, const double max, cpl_table **histo)

sinfo_termal_background2

computes thermal emission background from the sky at a i given temperature

Parameters:
int_sky input sky spectrum table
lambda input wavelength table
lrange input wavelength table
temp input temperature in Kelvin
bkg output background Returns in case of succes -1 else.


int sinfo_thermal_background2 (cpl_table *int_sky, cpl_table *lambda, cpl_table *lrange, cpl_table **bkg)

sinfo_filter_smo

passes a running mean of a given size to a vector

Parameters:
vi input vector
size size of filter
Returns:
a new allocated vector resulting from the filter proces The following static function passes a running mean of given box size on the data buffer. The box size must be a positive odd integer.


cpl_vector * sinfo_sky_background_estimate (cpl_vector *spectrum, int msize, int fsize)
 Background determination on 1D emission line spectrum (arc).

sinfo_table_get_index_of_max

find raw index of table column's max

Parameters:
t input table
name input table column
type CPL_TYPE of input table column
Returns:
table raw correspoinding to table max


int sinfo_table_get_index_of_max (cpl_table *t, const char *name, cpl_type type)

sinfo_table_get_index_of_val

get raw index corresponding to input table column's value

Parameters:
t input table
name input table column name
val table column value
type CPL_TYPE of table column


int sinfo_table_get_index_of_val (cpl_table *t, const char *name, double val, cpl_type type)

sinfo_table_column_interpolate

interpolate table column

Parameters:
t input table
name input table column name
x (double) raw value at which the column value need to be estimate return if success table column value at x else -1


double sinfo_table_column_interpolate (const cpl_table *t, const char *name, const double x)

sinfo_table_smooth_column

Parameters:
t input/output(smoothed) table
c table column
r smoothing radii


int sinfo_table_smooth_column (cpl_table **t, const char *c, const int r)

sinfo_convolve_kernel

convolve a table with a box of a given radii

Parameters:
t input table
rad kernel's radii


int sinfo_convolve_kernel2 (cpl_table **t, const int rad)

sinfo_convolve_exp

convolve a table with an exponential of a given radii and fwhm

Parameters:
t input table
rad Gaussian radii
fwhm Gaussian radii


int sinfo_convolve_exp (cpl_table **t, const int rad, const double fwhm)

sinfo_convolve_gauss

convolve a table with an Gaussian of a given radii and fwhm

Parameters:
t input table
rad Gaussian radii
fwhm Gaussian radii


int sinfo_convolve_gauss (cpl_table **t, const int rad, const double fwhm)

Function Documentation

int cpl_plugin_get_info ( cpl_pluginlist *  list  ) 

Build the list of available plugins, for this module.

Parameters:
list the plugin list
Returns:
0 if everything is ok

This function is exported.

Definition at line 91 of file sinfo_utl_skycor.c.

References sinfo_get_license().

cpl_vector * sinfo_sky_background_estimate ( cpl_vector *  spectrum,
int  msize,
int  fsize 
)

Background determination on 1D emission line spectrum (arc).

Parameters:
spectrum A 1D emission line spectrum
msize Size of min-filter
fsize Size of running-average-filter
Returns:
CPL_ERROR_NONE in case of success

CPL_ERROR_NULL_INPUT

The input spectrum is a NULL pointer.

CPL_ERROR_ILLEGAL_INPUT

Either msize is less than 3, or fsize is less than msize, or fsize is greater than length/2.

This function fills the array back with the estimated values of the background along the input spectrum. The algorithm is based on the assumption that there is at least one background value at any position of the min-filter box running along the spectrum. A min-filter is passed on the spectrum, and the result is smoothed by averaging on a running box of size fsize. The min-filter is run between the positions msize / 2 and length - msize / 2, and the min value found at such positions is then repeated up to the spectrum ends. Similarly, the running average is limited to the interval from fsize / 2 and length - fsize / 2, leaving the most external values untouched. After this, a max filter and a smoothing using boxes with double the specified sizes are run, as a way to eliminate the contamination from occasional cold pixels. Finally, the min filter and the smoothing are applied again to obviate the slight background over-estimation introduced by the max filter.

It is required that the back array is at least long as the array spectrum. Moreover msize must be greater than 1, and fsize greater than, or equal to, msize. Likewise, length must be greater than twice fsize. If such conditions are not met, or if the input arrays are NULL pointers, this function will set an error code, and leave the back array untouched. If either msize or fsize are even numbers, they are made odd by adding 1. Suggested values for msize and fsize are 15 pixels for typical arc lamp spectra.

Definition at line 3328 of file sinfo_skycor.c.

int sinfo_skycor ( cpl_parameterlist *  config,
cpl_frame *  obj_frm,
cpl_frame *  sky_frm,
sinfo_skycor_qc *  sqc,
cpl_imagelist **  obj_cor,
cpl_table **  int_obj 
)

Execute the plugin instance given by the interface.

Parameters:
config parameter configuration
obj_frm input object frm
sky_frm input sky frm
sqc QC parameters
obj_cor corrected object cube
int_obj corrected object spectrum
Returns:
0 if everything is ok, -1 else

Definition at line 521 of file sinfo_skycor.c.

References sinfo_free_image(), sinfo_free_imagelist(), and sinfo_free_table().


Generated on 8 Mar 2011 for SINFONI Pipeline Reference Manual by  doxygen 1.6.1