Stand-Alone Calibration Routines

DES DM provides a number of routines and procedures to generate master bias and flat field frames (and a few others). Typical names are mkbiascor, mkflatcor etc.
Here we collect whatever information is available about these routines. Check back frequently as this is work in progress.

Preparing the Image (DECam_crosstalk)

One of the first steps in the DES DM pipeline is to split the MEF file into 62 (70) extensions. Most of not all of the calibration procedures work on files with just a single extension.
DES DM provides the routine DECam_crosstalk for this purpose. Make sure you run this first when using the stand-alone procedures.


From the dc6 processing notes

mkbiascor <input list> <output biascor image> <options>
  -avsigclip <Sigma>
  -median (default)
  -variancetype <SIGMA, WEIGHT>
  -image_compare <template>
  -verbose <0-3>
  -overscantype <0-4 default=0>

example: $DES_HOME/OPS/bin/mkbiascor $droot/ACT/red/20110802115311_20110726/aux/bias_images_0027.list $droot/ACT/red/20110802115311_20110726/biascor/biascor_01.fits 
-variancetype WEIGHT -median -verbose 3

Manual (Draft)

Robert has started to write a manual for these routines. Here is the current version


Basic syntax:

 mkbiascor <input_list> <output_biascor_image> <options>

This routine combines a number of bias image frames from a single CCD. Images to be combined are provided through a list (text file) with full paths to each frame.
The combination option used is provided by a command line switch.  The current options available are:

 -median (default)
 -avminmaxclip <Nclip>
 -avsigclip <NSigma>

The median and average combine options perform a simple pixel-by-pixel median or average for all of the input images.  
The avminmaxclip and avsigclip variants also provide and average on a pixel-by-pixel basis but first attempt to reject outlier values.  
The avminmaxclip option works on a pixel by pixel basis but rejects the Nclip high and Nclip low values prior to calculating the average.  
The avgsigclip option determines the local variance and then rejects pixels outside the range of ± (NSigma * variance) before proceeding to 
calculate the average of the remaining values.

 -variancetype <SIGMA,WEIGHT>

The variancetype option is used to indicate the type of statistic to report in the WEIGHT image plane of the output (combined) image.  
The current options are SIGMA and WEIGHT which are evaluated relative to the value output in the image plane.  
The SIGMA options writes a variance type value (sqrt(sum((value-combined)**2))/N), while the WEIGHT options writes the value as 1/(variance**2).

 -image_compare <template>

The image_compare option compares the resulting combined bias with a previously calculated image (presumably a bias) and reports the number of
pixels with significant deviation.  (THIS NEEDS TO BE VERIFIED)

 -overscantype (0-4)

This option has been depricated by the inclusion of improved overscan evaluation/removal tools within DECam_crosstalk.  
It is currently allowed to provide backward compatibility but only a value of 0 will provide a valid result.  
Currently, -overscantype 0 performs a line-by-line median of the overscan region prior to subtracting the values on a line-by-line basis from the image.  
Note if the DESOSCN keyword is present in an image header then overscan correction will not be performed even if the command line option is given.

 -verbose (0-3)

Sets the verbosity level for actions being taken as the routine progresses.

Other "known" quirks.
 - if a single input image is given this program will provide a warning
   (once for each pixel) but will output the image as a bias image.

 - There is a wait/sleep command present in all routine that write images.
   The result is that if you write to a directory other than the current
   directory the subroutine attempts to verify the presence of the target
   directory and if not present builds the path.  If errors are detected
   the routine sleeps prior to a second attempt (and does so for each
   level of subdirectory that must be checked and/or created).