UVES Pipeline Reference Manual  5.4.0
Functions | Variables
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_mode, 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 = "MASTER_DFLAT_xxxx, MASTER_TFLAT_xxxx or MASTER_SCREEN_FLAT_xxxx)."

Detailed Description


Function Documentation

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

Process a single chip.

Parameters:
raw_imagesthe input images
qclogQC parameters are written here

Definition at line 1071 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:
setThe input frameset
Returns:
CPL_ERROR_NONE iff ok

Definition at line 438 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:
framesthe frames list
parametersthe 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 581 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:
setThe input frameset
Returns:
CPL_ERROR_NONE iff ok

Definition at line 511 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:
framesthe frames list
parametersthe parameters list
flamesCalled by FLAMES recipe?
recipe_idthe recipe name (will be written to FITS headers)
starttimetime when calling recipe started
prefixtag prefix as x in 'xFLAT'
Returns:
CPL_ERROR_NONE if everything is ok

Definition at line 610 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:
parametersthe parameterlist to fill
recipe_idname 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_mode,
cpl_image **  background 
)
static

Process a single chip.

Parameters:
raw_imagesThe input images
raw_headersAn array containing the input image headers. The ordering must be the same as the ordering of images in the input image list
master_flat_headerThis header is updated with the normalized exposure time
master_biasThe master bias image for this chip, or NULL
master_darkIf non-null this master dark frame is subtracted
mdark_headerThe header of the master dark frame (used only if master_dark is non-null).
ordertableThe order table for this chip. Used for background subtraction.
order_locationsPolynomial defining the order locations. Used for background subtraction.
flamesFLAMES reduction? In this case the background image is not computed/subtracted
parametersThe recipe parameter list
chipCCD chip
recipe_idname of calling recipe
debug_modeSave 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:
parametersthe parameters list
framesthe 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 408 of file uves_reduce_mflat.c.

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