Substep: Rebinning

Functions

static double integrate_flux (const double *spectrum_data_double, const float *spectrum_data_float, const int *spectrum_data_int, const cpl_binary *spectrum_bad, int spectrum_row, int nx, double x_min, double x_max, bool threshold_to_positive, bool *is_bad)
 Integrate flux.
static double integrate_noise (const double *spectrum_data_double, const float *spectrum_data_float, const int *spectrum_data_int, const cpl_binary *spectrum_bad, int spectrum_row, int nx, double x_min, double x_max, bool threshold_to_positive, bool *is_bad)
 Integrate variance.
cpl_parameterlist * uves_rebin_define_parameters (void)
 Define recipe parameters used for rebinning.
cpl_image * uves_rebin (const cpl_image *spectrum, const cpl_parameterlist *parameters, const char *context, const cpl_table *linetable, const polynomial *dispersion_relation, int first_abs_order, int last_abs_order, int n_traces, bool threshold_to_positive, bool is_noise, uves_propertylist **rebinned_header)
 Rebin a spectrum.

Detailed Description

Resample a spectrum in (pixel, order)-space to achieve a spectrum in (wavelength, order)-space


Function Documentation

static double integrate_flux ( const double *  spectrum_data_double,
const float *  spectrum_data_float,
const int *  spectrum_data_int,
const cpl_binary *  spectrum_bad,
int  spectrum_row,
int  nx,
double  x_min,
double  x_max,
bool  threshold_to_positive,
bool *  is_bad 
) [static]

Integrate flux.

Parameters:
spectrum_data_double Input spectrum data buffer as double or float, or int, other must be NULL
spectrum_data_float Input spectrum data buffer as double or float, or int, other must be NULL
spectrum_data_int Input spectrum data buffer as double or float, or int, other must be NULL
spectrum_bad Input spectrum bad pixel map
spectrum_row Current row of input spectrum
nx Input image width
x_min Start of integration interval (FITS coordinate in [0.5 ; nx+0.5])
x_max End of integration interval (FITS coordinate in [0.5 ; nx+0.5])
threshold_to_positive enforce a positive result?
is_bad (output) Flag indicating if there were only bad pixels in the specified interval
Returns:
Integrated flux

This function integrates the flux in a way that conserves the total flux (i.e. using a flux-conserving interpolant)

Definition at line 822 of file uves_rebin.c.

References uves_max_double(), uves_max_int(), uves_min_double(), uves_min_int(), and uves_round_double().

Referenced by uves_rebin().

static double integrate_noise ( const double *  spectrum_data_double,
const float *  spectrum_data_float,
const int *  spectrum_data_int,
const cpl_binary *  spectrum_bad,
int  spectrum_row,
int  nx,
double  x_min,
double  x_max,
bool  threshold_to_positive,
bool *  is_bad 
) [static]

Integrate variance.

Parameters:
spectrum_data_double Input spectrum data buffer as double or float, or int, other must be NULL
spectrum_data_float Input spectrum data buffer as double or float, or int, other must be NULL
spectrum_data_int Input spectrum data buffer as double or float, or int, other must be NULL
spectrum_bad Input spectrum bad pixel map
spectrum_row Current row of input spectrum
nx Input image width
x_min Start of integration interval (FITS coordinate in [0.5 ; nx+0.5])
x_max End of integration interval (FITS coordinate in [0.5 ; nx+0.5])
threshold_to_positive enforce a positive result?
is_bad (output) Flag indicating if there were only bad pixels in the specified interval
Returns:
Integrated flux

This function integrates the flux in a way that conserves the total flux (i.e. using a flux-conserving interpolant)

Definition at line 1050 of file uves_rebin.c.

References uves_max_double(), uves_max_int(), uves_min_double(), uves_min_int(), and uves_round_double().

Referenced by uves_rebin().

cpl_parameterlist* uves_rebin_define_parameters ( void   ) 

Define recipe parameters used for rebinning.

Returns:
The parameters for this step

The parameters defined are wavestep, scale. See source code or 'esorex --man-page' for a description of each parameter.

Definition at line 245 of file uves_rebin.c.

cpl_image* uves_rebin ( const cpl_image *  spectrum,
const cpl_parameterlist *  parameters,
const char *  context,
const cpl_table *  linetable,
const polynomial dispersion_relation,
int  first_abs_order,
int  last_abs_order,
int  n_traces,
bool  threshold_to_positive,
bool  is_noise,
uves_propertylist **  rebinned_header 
)

Rebin a spectrum.

Parameters:
spectrum Input spectrum in (x, order) space
parameters The parameters used for rebinning. Add parameters by calling uves_propagate_parameters_step() from the recipe_create() function
context Use parameters belonging to this context
linetable The linetable. Used to read the average pixel size, when the wavelength step is not specified.
dispersion_relation The dispersion relation in the form lambda.m = f(x,m), where m is the absolute order number
first_abs_order Absolute order number of row number 1 in the spectrum image
last_abs_order Absolute order number of the highest row in the spectrum image
n_traces Number of traces per order (equal to 1, or more if 2d extraction)
threshold_to_positive if true, negative values are set to 'infinity'. This makes sense for the error bar spectrum, which may become negative due to the interpolation profile used, even if the input is positive. In this context 'infinity' is defined as the maximum value of all other pixels
rebinned_header (output) Header with keywords defining the wavelengths of the first column in the rebinned image
Returns:
Rebinned spectrum in (lambda, order) space. Same type (float/double) as input

This function rebins each order of an extracted spectrum according to the relation N_lambda = N_x * |d x/d (lambda)| where N_x and N_lambda are the flux intensities per pixel and wavelength, respectively.

The conversion factor |d x / d (lambda)| can be switched on/off by (un-)setting the corresponding parameter (see uves_rebin_define_parameters()).

If the MIDAS flag is set, the resampled spectrum is shifted a random amount (depending on round-off) up to wavestep / 2.

Bad pixels are taken into account and propagated, and an output bin is marked as bad if no flux (from good pixels) went into that bin.

Definition at line 348 of file uves_rebin.c.

References assure_mem, check, check_nomsg, integrate_flux(), integrate_noise(), passure, uves_absolute_order(), uves_error_reset, uves_initialize_image_header(), uves_max_double(), uves_max_int(), uves_min_double(), uves_msg_debug, uves_msg_warning, uves_pfits_get_wstart(), uves_pfits_set_wend(), uves_pfits_set_wstart(), uves_polynomial_collapse(), uves_polynomial_delete(), uves_polynomial_derivative_2d(), uves_polynomial_evaluate_2d(), uves_polynomial_solve_1d(), uves_round_double(), and uves_tostring_cpl_type().

Referenced by extract_ff_rebin_merge().


Generated on 9 Mar 2012 for UVES Pipeline Reference Manual by  doxygen 1.6.1