The uves_cal_mflat recipe

uves_cal_mflat

Synopsis

Creates the master flat field frame

Description

This recipe creates a master flat frame by 1) subtracting the master bias frame from each flat field frame, 2) dividing each flat field frame by the

exposure time for that frame, 3) taking the median of all bias subtracted, normalized raw flat frames, 4) optionally subtracting the master dark

frame, and 5) subtracting

the background to get the bias subtracted,

optionally dark subtracted, normalized, background subtracted master flat-field frame. Symbolically,

masterflat = median( (flat_i - masterbias)/exptime_i ) - masterdark/exptime
  • background.

The input flat field frames must have same tag which must match (I|D|S|T|SCREEN|)FLAT_(BLUE|RED), for example TFLAT_BLUE or FLAT_RED. Also, a master bias (MASTER_BIAS_xxxx) and ordertable (ORDER_TABLE_xxxx) must be provided for each chip (xxxx = BLUE, REDL, REDU). A master dark frame (MASTER_(P)DARK_xxxx) may optionally be provided. On blue input the recipe computes one master flat field frame; on red input the recipe produces a master flat field frame for each chip (MASTER_FLAT_xxxx, MASTER_IFLAT_xxxx, MASTER_DFLAT_xxxx, MASTER_TFLAT_xxxx or MASTER_SCREEN_FLAT_xxxx).

Constructor

cpl.Recipe("uves_cal_mflat")

Create an object for the recipe uves_cal_mflat.

import cpl
uves_cal_mflat = cpl.Recipe("uves_cal_mflat")

Parameters

uves_cal_mflat.param.backsub.mmethod

Background measuring method. If equal to ‘median’ the background is sampled using the median of a subwindow. If ‘minimum’, the subwindow minimum value is used. If ‘no’, no background subtraction is done. (str; default: ‘median’) [default=”median”].

uves_cal_mflat.param.backsub.npoints

This is the number of columns in interorder space used to sample the background. (int; default: 82) [default=82].

uves_cal_mflat.param.backsub.radiusy

The height (in pixels) of the background sampling window is (2*radiusy + 1). This parameter is not corrected for binning. (int; default: 2) [default=2].

uves_cal_mflat.param.backsub.sdegree

Degree of interpolating splines. Currently only degree = 1 is supported (int; default: 1) [default=1].

uves_cal_mflat.param.backsub.smoothx

If spline interpolation is used to measure the background, the x-radius of the post-smoothing window is (smoothx * image_width). Here, ‘image_width’ is the image width after binning. If negative, the default values are used: (25.0/4096) for blue flat-field frames, (50.0/4096) for red flat-field frames, (300.0/4096) for blue science frames and (300.0/4096) for red science frames. (float; default: -1.0) [default=-1.0].

uves_cal_mflat.param.backsub.smoothy

If spline interpolation is used to measure the background, the y-radius of the post-smoothing window is (smoothy * image_height). Here, ‘image_height’ is the image height after binning. If negative, the default values are used: (100.0/2048) for blue flat-field frames, (300.0/2048) for red flat-field frames, (200.0/2048) for blue science frames and (500.0/2048) for red science frames. (float; default: -1.0) [default=-1.0].

uves_cal_mflat.param.debug

Whether or not to save intermediate results to local directory (bool; default: False) [default=False].

uves_cal_mflat.param.norm_method

Method used to build master frame (str; default: ‘explevel’) [default=”explevel”].

uves_cal_mflat.param.plotter

Any plots produced by the recipe are redirected to the command specified by this parameter. The plotting command must contain the substring ‘gnuplot’ and must be able to parse gnuplot syntax on its standard input. Valid examples of such a command may include ‘gnuplot -persist’ and ‘cat > mygnuplot$$.gp’. A finer control of the plotting options can be obtained by writing an executable script, e.g. my_gnuplot.pl, that executes gnuplot after setting the desired gnuplot options (e.g. set terminal pslatex color). To turn off plotting, set this parameter to ‘no’ (str; default: ‘no’) [default=”no”].

uves_cal_mflat.param.process_chip

For RED arm data process the redl, redu, or both chip(s) (str; default: ‘both’) [default=”both”].

The following code snippet shows the default settings for the available parameters.

import cpl
uves_cal_mflat = cpl.Recipe("uves_cal_mflat")

uves_cal_mflat.param.backsub.mmethod = "median"
uves_cal_mflat.param.backsub.npoints = 82
uves_cal_mflat.param.backsub.radiusy = 2
uves_cal_mflat.param.backsub.sdegree = 1
uves_cal_mflat.param.backsub.smoothx = -1.0
uves_cal_mflat.param.backsub.smoothy = -1.0
uves_cal_mflat.param.debug = False
uves_cal_mflat.param.norm_method = "explevel"
uves_cal_mflat.param.plotter = "no"
uves_cal_mflat.param.process_chip = "both"

You may also set or overwrite some or all parameters by the recipe parameter param, as shown in the following example:

import cpl
uves_cal_mflat = cpl.Recipe("uves_cal_mflat")
[...]
res = uves_cal_mflat( ..., param = {"backsub.mmethod":"median", "backsub.npoints":82})

See also

cpl.Recipe for more information about the recipe object.

Bug reports

Please report any problems to Jonas M. Larsen. Alternatively, you may send a report to the ESO User Support Department.