Subtraction of Frames (xsh_subtract)
[DRL Functions]

Defines

#define DEGX   2
#define DEGY   2
#define KAPPA   4.

Functions

static cpl_error_code subtract_background (cpl_image *image, cpl_image *background_im, const polynomial *background_pol)
 Subtract the previously defined background.
static cpl_image * xsh_background_poly (cpl_image *image, xsh_grid *grid)
cpl_frame * xsh_subtract_bias (cpl_frame *frame, cpl_frame *bias, xsh_instrument *instr, const char *type, const int pre_overscan_corr)
 Subtract the master bias frame from PRE frame.
cpl_frameset * xsh_subtract_nir_on_off (cpl_frameset *on, cpl_frameset *off, xsh_instrument *instr)
 (NIR only) subtract the OFF set of files from the On set of files
cpl_frame * xsh_subtract_dark (cpl_frame *frame, cpl_frame *dark, const char *filename, xsh_instrument *instr)
 subtract the master dark frame from PRE frame
cpl_frame * xsh_subtract_background (cpl_frame *frame, cpl_frame *edges_order_tab_frame, xsh_background_param *background_par, xsh_instrument *instr, const char *prefix, cpl_frame **grid_frame, cpl_frame **backg_frame)
 Subtract the background from PRE frame.

Detailed Description

Contains functions to subtract various frames.


Define Documentation

#define DEGX   2

Definition at line 697 of file xsh_subtract.c.

Referenced by xsh_background_poly().

#define DEGY   2

Definition at line 698 of file xsh_subtract.c.

Referenced by xsh_background_poly().

#define KAPPA   4.

Definition at line 699 of file xsh_subtract.c.

Referenced by xsh_background_poly().


Function Documentation

static cpl_error_code subtract_background ( cpl_image *  image,
cpl_image *  background_im,
const polynomial background_pol 
) [static]

Subtract the previously defined background.

Parameters:
image Image to be background subtracted
background_im Background image, may be NULL. If non-NULL, this is updated to contain the flux values that were actually subtracted.
background_pol Background polynomial, may be NULL
Returns:
CPL_ERROR_NONE iff OK.

Exactly one of background_im and background_pol must be non-NULL.

Definition at line 644 of file xsh_subtract.c.

References assure, nx, ny, passure, x, xsh_max_double(), xsh_polynomial_evaluate_2d(), xsh_tostring_cpl_type(), and y.

Referenced by xsh_background_poly().

static cpl_image * xsh_background_poly ( cpl_image *  image,
xsh_grid grid 
) [static]
cpl_frame* xsh_subtract_background ( cpl_frame *  frame,
cpl_frame *  edges_order_tab_frame,
xsh_background_param background_par,
xsh_instrument instr,
const char *  prefix,
cpl_frame **  grid_frame,
cpl_frame **  backg_frame 
)

Subtract the background from PRE frame.

Parameters:
[in] frame The frame from we subtract the background
[in] edges_order_tab_frame The table where the orders positions are
[in] background_par The background_img parameters structure
[in] instr The instrument containing the arm , mode and lamp in use
[in] prefix 
[out] grid_frame grid sampling point frame
[out] backg_frame background frame
Returns:
The subtracted frame

Definition at line 278 of file xsh_subtract.c.

References xsh_pre::binx, xsh_pre::biny, check, xsh_pre::data, xsh_pre::data_header, xsh_order::edglopoly, xsh_order::edguppoly, endy, xsh_order::endy, xsh_order_list::list, xsh_background_param::method, xsh_background_param::min_frac_grid, xsh_pre::nx, nx, xsh_pre::ny, xsh_background_param::radius_x, xsh_background_param::radius_y, xsh_background_param::sampley, xsh_order_list::size, xsh_background_param::smooth_x, xsh_background_param::smooth_y, xsh_order::starty, starty, x, XSH_ARM_NIR, XSH_ARM_VIS, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, xsh_background_poly(), xsh_frame_product(), XSH_FREE, xsh_free_frame(), xsh_free_image(), xsh_free_propertylist(), xsh_free_table(), xsh_grid2table(), xsh_grid_add(), xsh_grid_create(), xsh_grid_free(), xsh_grid_get_index(), xsh_grid_sort(), xsh_image_fit_spline(), xsh_image_smooth_mean_x(), xsh_image_smooth_mean_y(), xsh_instrument_get_arm(), XSH_MALLOC, xsh_msg, xsh_msg_dbg_high, xsh_msg_dbg_low, XSH_NAME_PREFIX_LAMP_MODE_ARM, xsh_order_list_eval(), xsh_order_list_free(), xsh_order_list_load(), xsh_order_list_set_bin_x(), xsh_order_list_set_bin_y(), xsh_pfits_set_pcatg(), xsh_pre_data_window_sample_flux_pa(), xsh_pre_free(), xsh_pre_load(), xsh_pre_save(), and y.

Referenced by main(), xsh_geom_ifu(), xsh_mflat_recipe_main(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_offset(), and xsh_scired_slit_stare().

cpl_frame* xsh_subtract_bias ( cpl_frame *  frame,
cpl_frame *  bias,
xsh_instrument instr,
const char *  type,
const int  pre_overscan_corr 
)

Subtract the master bias frame from PRE frame.

Parameters:
frame The frame from we subtracted the master bias
bias The master bias frame
instr The xsh instrument
type frame type used to define bias subtracted frame filename
pre_overscan_corr switch on/off pre-overscan correction
Returns:
the subtracted frame

Definition at line 91 of file xsh_subtract.c.

References binx, biny, check, xsh_pre::data, xsh_pre::data_header, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_instrument_arm_tostring(), xsh_pfits_get_binx(), xsh_pfits_get_biny(), xsh_pfits_set_pcatg(), xsh_pre_free(), xsh_pre_load(), xsh_pre_save(), xsh_pre_subtract(), and xsh_pre_subtract_scalar().

Referenced by main(), xsh_2dmap(), xsh_cfg_recover_last_step(), xsh_check_subtract_bias(), xsh_flexcomp(), xsh_geom_ifu(), xsh_mdark(), xsh_mflat_recipe_main(), xsh_orderpos(), xsh_predict(), xsh_scired_ifu_stare(), and xsh_wavecal().

cpl_frame* xsh_subtract_dark ( cpl_frame *  frame,
cpl_frame *  dark,
const char *  filename,
xsh_instrument instr 
)

subtract the master dark frame from PRE frame

Parameters:
frame frame to be sutracted
dark the master dark frame
filename the result frame filename
instr instrument containing the arm , mode and lamp in use
Returns:
the subtracted frame

Definition at line 213 of file xsh_subtract.c.

References assure, check, xsh_pre::exptime, exptime, XSH_ARM_NIR, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_instrument_get_arm(), xsh_pre_free(), xsh_pre_load(), xsh_pre_multiply_scalar(), xsh_pre_save(), and xsh_pre_subtract().

Referenced by main(), xsh_2dmap(), xsh_cfg_recover_last_step(), xsh_check_subtract_dark(), xsh_flexcomp(), xsh_geom_ifu(), xsh_mflat_recipe_main(), xsh_orderpos(), xsh_predict(), xsh_scired_ifu_stare(), and xsh_subtract_nir_on_off().

cpl_frameset* xsh_subtract_nir_on_off ( cpl_frameset *  on,
cpl_frameset *  off,
xsh_instrument instr 
)

(NIR only) subtract the OFF set of files from the On set of files

Parameters:
on the ON set of files
off the OFF set of files
instr instrument containing the arm , mode and lamp in use
Returns:
the ON subtract OFF set of files

Definition at line 161 of file xsh_subtract.c.

References check, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_free_frameset(), XSH_NEW_FRAMESET, and xsh_subtract_dark().

Referenced by xsh_2dmap(), xsh_cfg_recover_last_step(), xsh_mflat_recipe_main(), xsh_predict(), and xsh_wavecal().


Generated on 9 Mar 2011 for X-shooter Pipeline Reference Manual by  doxygen 1.6.1