Subtraction of Frames (xsh_subtract)
[DRL Functions]

Functions

static cpl_image * xsh_image_generate_background (const int sx, const int sy, const polynomial *background_pol)
 Subtract the previously defined background.
static cpl_image * xsh_background_poly (xsh_pre *image, cpl_table **grid_tbl, xsh_background_param *back_par)
cpl_frame * xsh_subtract_bias (cpl_frame *frame, cpl_frame *bias, xsh_instrument *instr, const char *type, const int pre_overscan_corr, const int save_tmp)
 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
static void xsh_fill_bkg_mask_range (const int y, const int nx, const int xmin, const int xmax, const int x_hbox, const int decode_bp, int *qual, int *pmask, int *size)
static xsh_gridxsh_crea_grid_from_mask (xsh_pre *pre, xsh_order_list *orderlist, const int x_hbox, xsh_instrument *instr, const char *prefix)
 Generates sampling grid using sampling boxes distributed along inter-order background regions.
static xsh_gridxsh_crea_grid_from_samples (xsh_pre *pre, xsh_order_list *orderlist, xsh_background_param *background_par, xsh_instrument *instr)
 Generates sampling grid using sampling boxes distributed along inter-order background regions.
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, const int save_bkg, const int save_grid, const int save_sub_bkg)
 Subtract the inter-order background from PRE frame.

Variables

int xsh_bkg_yskip_lo_uvb [XSH_ORDERS_UVB]
int xsh_bkg_yskip_up_uvb [XSH_ORDERS_UVB]
int xsh_bkg_yskip_lo_vis [XSH_ORDERS_VIS]
int xsh_bkg_yskip_up_vis [XSH_ORDERS_VIS]
int xsh_bkg_yskip_lo_nir [XSH_ORDERS_NIR]
int xsh_bkg_yskip_up_nir [XSH_ORDERS_NIR]

Detailed Description

Contains functions to subtract various frames.


Function Documentation

static cpl_image * xsh_background_poly ( xsh_pre image,
cpl_table **  grid_tbl,
xsh_background_param back_par 
) [static]
static xsh_grid* xsh_crea_grid_from_mask ( xsh_pre pre,
xsh_order_list orderlist,
const int  x_hbox,
xsh_instrument instr,
const char *  prefix 
) [static]

Generates sampling grid using sampling boxes distributed along inter-order background regions.

Parameters:
[in] pre The frame from we subtract the background in PRE format
[in] orderlist The order-list structure 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
Returns:
The grid structure with inter-order background sampled points

Definition at line 348 of file xsh_subtract.c.

References check, xsh_pre::data, xsh_instrument::decode_bp, xsh_order::edglopoly, xsh_order::edguppoly, xsh_order::endy, endy, xsh_pre::errs, xsh_order_list::list, xsh_pre::nx, nx, xsh_pre::ny, ny, xsh_pre::qual, xsh_order_list::size, size, xsh_order::starty, starty, x, XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, xsh_bkg_yskip_lo_nir, xsh_bkg_yskip_lo_uvb, xsh_bkg_yskip_up_nir, xsh_bkg_yskip_up_uvb, xsh_fill_bkg_mask_range(), xsh_free_image(), xsh_grid_add(), xsh_grid_create(), xsh_grid_sort(), xsh_instrument_get_arm(), xsh_msg, xsh_order_list_eval(), and y.

Referenced by xsh_subtract_background().

static xsh_grid* xsh_crea_grid_from_samples ( xsh_pre pre,
xsh_order_list orderlist,
xsh_background_param background_par,
xsh_instrument instr 
) [static]

Generates sampling grid using sampling boxes distributed along inter-order background regions.

Parameters:
[in] pre The frame from we subtract the background in PRE format
[in] orderlist The order-list structure 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
Returns:
The grid structure with inter-order background sampled points

Definition at line 695 of file xsh_subtract.c.

References assure, check, xsh_order::edglopoly, xsh_order::edguppoly, endy, xsh_order::endy, xsh_order_list::list, xsh_pre::nx, xsh_pre::ny, ny, xsh_background_param::radius_x, xsh_background_param::radius_y, xsh_background_param::sampley, xsh_order_list::size, xsh_order::starty, starty, x, XSH_ARM_NIR, XSH_ARM_VIS, XSH_ASSURE_NOT_ILLEGAL, xsh_grid_add(), xsh_grid_create(), xsh_grid_get_index(), xsh_grid_sort(), xsh_instrument_get_arm(), XSH_MALLOC, xsh_msg, xsh_msg_dbg_high, xsh_msg_dbg_low, xsh_order_list_eval(), xsh_pre_data_window_median_flux_pa(), and y.

static void xsh_fill_bkg_mask_range ( const int  y,
const int  nx,
const int  xmin,
const int  xmax,
const int  x_hbox,
const int  decode_bp,
int *  qual,
int *  pmask,
int *  size 
) [static]

Definition at line 300 of file xsh_subtract.c.

References x.

Referenced by xsh_crea_grid_from_mask().

static cpl_image * xsh_image_generate_background ( const int  sx,
const int  sy,
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 1114 of file xsh_subtract.c.

References x, xsh_polynomial_evaluate_2d(), XSH_PRE_DATA_TYPE, and y.

Referenced by xsh_background_poly().

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,
const int  save_bkg,
const int  save_grid,
const int  save_sub_bkg 
)

Subtract the inter-order 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 946 of file xsh_subtract.c.

References xsh_pre::binx, xsh_pre::biny, check, xsh_pre::data, xsh_pre::data_header, xsh_background_param::edges_margin, xsh_add_temporary_file(), XSH_ARM_UVB, XSH_ASSURE_NOT_NULL_MSG, xsh_background_poly(), xsh_crea_grid_from_mask(), xsh_frame_product(), XSH_FREE, xsh_free_frame(), xsh_free_image(), xsh_free_propertylist(), xsh_free_table(), xsh_grid2table(), xsh_grid_free(), xsh_instrument_get_arm(), xsh_instrument_get_binx(), xsh_instrument_get_biny(), xsh_msg, XSH_NAME_PREFIX_LAMP_MODE_ARM, 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_pfits_set_wcs(), xsh_pre_free(), xsh_pre_load(), and xsh_pre_save().

Referenced by main(), xsh_absorp(), xsh_geom_ifu(), xsh_mflat(), xsh_respon_slit_stare(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), 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,
const int  save_tmp 
)

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
save_tmp switch on/off tmp product saving
Returns:
the subtracted frame

Definition at line 120 of file xsh_subtract.c.

References check, xsh_pre::data, xsh_pre::data_header, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_instrument_arm_tostring(), 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_get_master_dark_opt(), xsh_mflat_combine_flats(), xsh_orderpos(), xsh_predict(), 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 247 of file xsh_subtract.c.

References assure, check, xsh_pre::data_header, xsh_pre::exptime, exptime, XSH_ARM_NIR, XSH_ASSURE_NOT_ILLEGAL_MSG, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_instrument_get_arm(), xsh_pfits_get_dit(), 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_mflat_combine_flats(), 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 194 of file xsh_subtract.c.

References check, xsh_add_temporary_file(), 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_combine_flats(), xsh_predict(), and xsh_wavecal().


Variable Documentation

int xsh_bkg_yskip_lo_nir[XSH_ORDERS_NIR]
Initial value:
{0,0,0,0,
                                           0,50,50,80,
                                           70,50,50,50,
                                           50,50,50,50}

Definition at line 76 of file xsh_subtract.c.

Referenced by xsh_crea_grid_from_mask().

int xsh_bkg_yskip_lo_uvb[XSH_ORDERS_UVB]
Initial value:
{0,0,0,0,
                                          0,0,0,0,
                                          0,0,0,0}

Definition at line 58 of file xsh_subtract.c.

Referenced by xsh_crea_grid_from_mask().

int xsh_bkg_yskip_lo_vis[XSH_ORDERS_VIS]
Initial value:
{0,0,0,0,0,
                                          0,0,0,0,0,
                                          0,0,0,0,0}

Definition at line 67 of file xsh_subtract.c.

int xsh_bkg_yskip_up_nir[XSH_ORDERS_NIR]
Initial value:
{0,0,0,0,
                                          0,50,100,60,
                                          90,70,50,50,
                                          50,50,50,50}

Definition at line 82 of file xsh_subtract.c.

Referenced by xsh_crea_grid_from_mask().

int xsh_bkg_yskip_up_uvb[XSH_ORDERS_UVB]
Initial value:
{0,0,0,0,
                                          0,0,0,0,
                                          0,0,0,0}

Definition at line 62 of file xsh_subtract.c.

Referenced by xsh_crea_grid_from_mask().

int xsh_bkg_yskip_up_vis[XSH_ORDERS_VIS]
Initial value:
{0,0,0,0,0,
                                          50,50,70,50,50,
                                          50,50,50,50,50}

Definition at line 71 of file xsh_subtract.c.


Generated on 13 Mar 2013 for X-shooter Pipeline Reference Manual by  doxygen 1.6.1