Master flat reduction

Functions

static void uves_mflat_qclog (const cpl_imagelist *raw_images, cpl_table *qclog)
 Process a single chip.
static cpl_error_code uves_msflats (cpl_frameset *set, const cpl_parameterlist *parameters, const char *recipe_id, const char *starttime)
 Computes coherent master sflats.
static void uves_mflat_one (cpl_frameset *frames, const cpl_parameterlist *parameters, bool flames, const char *recipe_id, const char *starttime, const char *prefix)
 Get the command line options and execute the data reduction.
static cpl_error_code uves_mflat_at_ypos (cpl_frameset *set, const cpl_parameterlist *parameters, const char *recipe_id, const char *starttime, const cpl_frameset *raw, const cpl_frameset *cdb, const int ref_x1enc, const int ref_x2enc, const int set_no)
 Computes coherent master sflats.
static void uves_reduce_mflat (cpl_frameset *frames, const cpl_parameterlist *parameters, bool flames, const char *recipe_id, const char *starttime, const char *prefix)
 Get the command line options and execute the data reduction.
int uves_mflat_define_parameters_body (cpl_parameterlist *parameters, const char *recipe_id)
 Setup the recipe options.
static cpl_image * uves_mflat_process_chip (const cpl_imagelist *raw_images, uves_propertylist **raw_headers, uves_propertylist *master_flat_header, const cpl_image *master_bias, const cpl_image *master_dark, const uves_propertylist *mdark_header, const cpl_table *ordertable, const polynomial *order_locations, bool flames, const cpl_parameterlist *parameters, enum uves_chip chip, const char *recipe_id, bool DEBUG, cpl_image **background)
 Process a single chip.
void uves_mflat_exe_body (cpl_frameset *frames, const cpl_parameterlist *parameters, const char *starttime, const char *recipe_id)
 Get the command line options and execute the data reduction.

Variables

const char *const uves_mflat_desc

Function Documentation

static void uves_mflat_qclog ( const cpl_imagelist *  raw_images,
cpl_table *  qclog 
) [static]

Process a single chip.

Parameters:
raw_images the input images
qclog QC parameters are written here

Definition at line 1072 of file uves_reduce_mflat.c.

References check_nomsg, uves_qclog_add_int(), and uves_qclog_add_string().

Referenced by uves_reduce_mflat().

static cpl_error_code uves_msflats ( cpl_frameset *  set,
const cpl_parameterlist *  parameters,
const char *  recipe_id,
const char *  starttime 
) [static]

Computes coherent master sflats.

Parameters:
set The input frameset
Returns:
CPL_ERROR_NONE iff ok

Definition at line 439 of file uves_reduce_mflat.c.

References check, uves_frameset_extract(), uves_mflat_at_ypos(), and uves_msg.

Referenced by uves_mflat_exe_body().

static void uves_mflat_one ( cpl_frameset *  frames,
const cpl_parameterlist *  parameters,
bool  flames,
const char *  recipe_id,
const char *  starttime,
const char *  prefix 
) [static]

Get the command line options and execute the data reduction.

Parameters:
frames the frames list
parameters the parameters list flames FLAMES mode?
Returns:
CPL_ERROR_NONE if everything is ok

After computing the master flat frame, the pixel average, standard deviation and median values are also computed and written in appropriate keywords in the output image header.

Definition at line 582 of file uves_reduce_mflat.c.

References check_nomsg, and uves_reduce_mflat().

Referenced by uves_mflat_at_ypos(), and uves_mflat_exe_body().

static cpl_error_code uves_mflat_at_ypos ( cpl_frameset *  set,
const cpl_parameterlist *  parameters,
const char *  recipe_id,
const char *  starttime,
const cpl_frameset *  raw,
const cpl_frameset *  cdb,
const int  ref_x1enc,
const int  ref_x2enc,
const int  set_no 
) [static]

Computes coherent master sflats.

Parameters:
set The input frameset
Returns:
CPL_ERROR_NONE iff ok

Definition at line 512 of file uves_reduce_mflat.c.

References check, check_nomsg, uves_mflat_one(), uves_msg_debug, uves_pfits_get_slit3_x1encoder(), uves_pfits_get_slit3_x2encoder(), and uves_propertylist_load().

Referenced by uves_msflats().

static void uves_reduce_mflat ( cpl_frameset *  frames,
const cpl_parameterlist *  parameters,
bool  flames,
const char *  recipe_id,
const char *  starttime,
const char *  prefix 
) [static]

Get the command line options and execute the data reduction.

Parameters:
frames the frames list
parameters the parameters list
flames Called by FLAMES recipe?
recipe_id the recipe name (will be written to FITS headers)
starttime time when calling recipe started
prefix tag prefix as x in 'xFLAT'
Returns:
CPL_ERROR_NONE if everything is ok

Definition at line 611 of file uves_reduce_mflat.c.

References check, check_nomsg, uves_chip_get_first(), uves_chip_get_index(), uves_chip_get_next(), uves_chip_tostring_upper(), uves_mflat_process_chip(), uves_mflat_qclog(), uves_msg, uves_msg_low, uves_msg_warning, uves_pfits_get_chipid(), uves_polynomial_delete(), uves_qclog_delete(), uves_qclog_init(), and uves_string_toupper().

Referenced by uves_mflat_one().

int uves_mflat_define_parameters_body ( cpl_parameterlist *  parameters,
const char *  recipe_id 
)

Setup the recipe options.

Parameters:
parameters the parameterlist to fill
recipe_id name of calling recipe
Returns:
0 if everything is ok

Definition at line 126 of file uves_reduce_mflat.c.

References check_nomsg.

static cpl_image* uves_mflat_process_chip ( const cpl_imagelist *  raw_images,
uves_propertylist **  raw_headers,
uves_propertylist master_flat_header,
const cpl_image *  master_bias,
const cpl_image *  master_dark,
const uves_propertylist mdark_header,
const cpl_table *  ordertable,
const polynomial order_locations,
bool  flames,
const cpl_parameterlist *  parameters,
enum uves_chip  chip,
const char *  recipe_id,
bool  DEBUG,
cpl_image **  background 
) [static]

Process a single chip.

Parameters:
raw_images The input images
raw_headers An array containing the input image headers. The ordering must be the same as the ordering of images in the input image list
master_flat_header This header is updated with the normalized exposure time
master_bias The master bias image for this chip, or NULL
master_dark If non-null this master dark frame is subtracted
mdark_header The header of the master dark frame (used only if master_dark is non-null).
ordertable The order table for this chip. Used for background subtraction.
order_locations Polynomial defining the order locations. Used for background subtraction.
flames FLAMES reduction? In this case the background image is not computed/subtracted
parameters The recipe parameter list
chip CCD chip
recipe_id name of calling recipe
DEBUG Save intermediate results to disk?
background (output) The background image which was subtracted
Returns:
The master flat image

This function

  • subtracts from each input image the provided master bias,
  • rescales each input image to unit exposure time by dividing by the exposure time read from the image header.
  • computes the master flat image by taking the pixel-by-pixel median of all input frames,
  • optionally subtracts the normalized master dark frame, and
  • subtracts the background (see uves_backsub_spline()) .

masterflat = median( (flat_i - masterbias)/exptime_i ) - masterdark/exptime_mdark - background

Dark subtraction is optional and is done only if the parameter master_dark is non-NULL.

Definition at line 221 of file uves_reduce_mflat.c.

References check, check_nomsg, uves_flat_create_normalized_master(), uves_flat_create_normalized_master2(), uves_msg, uves_pfits_get_exptime(), uves_pfits_get_gain(), uves_pfits_set_exptime(), uves_propertylist_append_c_double(), uves_string_toupper(), and uves_subtract_bias().

Referenced by uves_reduce_mflat().

void uves_mflat_exe_body ( cpl_frameset *  frames,
const cpl_parameterlist *  parameters,
const char *  starttime,
const char *  recipe_id 
)

Get the command line options and execute the data reduction.

Parameters:
parameters the parameters list
frames the frames list
Returns:
CPL_ERROR_NONE if everything is ok

After computing the master flat frame, the pixel average, standard deviation and median values are also computed and written in appropriate keywords in the output image header.

Definition at line 409 of file uves_reduce_mflat.c.

References check, uves_mflat_one(), and uves_msflats().


Variable Documentation

const char* const uves_mflat_desc
Initial value:
"This recipe creates a master flat frame by 1) subtracting the master bias\n"
"frame from each flat field frame, 2) dividing each flat field frame by the\n"
" exposure time for that frame, 3) taking the median of all bias subtracted,\n"
" normalized raw\n flat frames, 4) optionally subtracting the master dark \n"
"frame, and 5) subtracting\n the background to get the bias subtracted, \n"
"optionally dark subtracted, normalized, background subtracted master \n"
"flat-field frame. Symbolically,\n"
" masterflat = median( (flat_i - masterbias)/exptime_i ) - masterdark/exptime\n"
"            - background.\n"
"\n"
"The input flat field frames must have same tag which must match\n"
"(I|D|S|T|SCREEN|)FLAT_(BLUE|RED), for example TFLAT_BLUE or FLAT_RED. Also, a\n"
"master bias (MASTER_BIAS_xxxx) and ordertable (ORDER_TABLE_xxxx) must be\n"
"provided for each chip (xxxx = BLUE, REDL, REDU). A master dark frame\n"
"(MASTER_(P)DARK_xxxx) may optionally be provided. On blue input the recipe\n"
"computes one master flat field frame; on red input the recipe produces a\n"
"master flat field frame for each chip (MASTER_FLAT_xxxx, MASTER_IFLAT_xxxx,\n"
"MASTER_DFLAT_xxxx, MASTER_TFLAT_xxxx or MASTER_SCREEN_FLAT_xxxx)."

Definition at line 97 of file uves_reduce_mflat.c.


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