Performs the debiassing and initial preparation of CCD data DEBIAS
The debiassing section operates in two basic modes – with and without a bias frame. If a bias frame is supplied then it is subtracted from the data arrays of the input images. The subtraction can either be direct, or by offsetting the values of the bias by the mean value in the bias-strip region(s). When determining the mean in the bias strips a function of the distance from the edges is used, this reduces the effect of any contamination. If you are offsetting to the bias strip mean then the bias frame should be averaged to zero (MAKEBIAS does this).
The second debiassing method which DEBIAS supports is the subtraction of interpolated values. The interpolation is performed between the bias strips. If only one strip is given the interpolation is really an extrapolation and is limited to constant values either for each line or for the frame as a whole. Interpolation between bias strips can be as for a single strip or may be a straight line fit for each line, or a fit of a plane to the bias strips (see parameter SMODE). The interpolation uses weighting operations as for bias frame subtraction. Bad values can also be rejected from the strips by sigma clipping, or the noise can be reduced by smoothing the values.
Additional DEBIAS functionality includes the (optional) production of variance estimates for the input CCD data. It does this by assuming Poissonian statistics for the bias-subtracted data, together with a contribution for the readout noise. The masking of bad data areas is achieved using the transfer of quality information from an image, or by using an ASCII Regions Definition (ARD) file. The expansion of the data values into counts and the extraction of the useful area of the CCD are also performed.
If a global value for this parameter has been set using CCDSETUP then this will be used. If USESET is true then a value specific to the Set Index of each image will be sought. [1.0]
If USESET is true and you are using bias calibration data from a file, BIAS should be a group expression referring to one master bias frame matching each of the Set Index attributes represented in the IN list; again the name of the file produced by MAKEBIAS will normally be suitable. [Global master bias or !]
If global values for these bounds have been set using CCDSETUP then those values will be used. If USESET is true then a value specific to the Set Index of each image will be sought.
"
BOX"
. [15,15] "
clean-up"
mode for the bias
strips. This parameter may take values of "
BOX"
, "
SIGMA"
or "
WEIGHT"
. If CMODE="
BOX"
then
the bias strips are smoothed with a box filter before being processed. If CMODE="
SIGMA"
then the
bias strips are sigma clipped before being processed. If CMODE="
WEIGHT"
then only the
weighting as indicated by the WMODE parameter is used to attempt to decrease the effects of
erroneous pixel values. [BOX] "
fat"
or "
skinny"
zero. It represents the amount
of charge left behind in a pixel on a readout transfer. This value is subtracted from the
data.
If a global value for this parameter has been set using CCDSETUP then this will be used. If USESET is true then a value specific to the Set Index of each image will be sought. [0.0]
"
X"
or "
Y"
. X
indicates that the readout direction is horizontal , Y indicates that the readout direction
is vertical. The BOUNDS parameter values are assumed to be values along the readout
direction.
If a global value for this parameter has been set using CCDSETUP then this will be used. If USESET is true then a value specific to the Set Index of each image will be sought. [X]
[Default is TRUE if input data is not an unsigned data type otherwise FALSE.]
Normally the extent should be set so that the bias strips are excluded from the output data, this is essential for flatfields whose normalisation could be adversely biased.
If global values for these bounds have been set using CCDSETUP then those values will be used. If USESET is true then a value specific to the Set Index of each image will be sought.
"
LINE"
or "
PLANE"
. This is used together with the SMODE parameter to define the interpolation
method, ie. FMODE="
LINE"
& SMODE="
LINEAR"
, fits each row or column of the bias strips by a
straight line; FMODE="
PLANE"
& SMODE="
CONSTANT"
derives a single constant for the bias
value; "
PLANE"
& SMODE="
LINEAR"
fits a plane to the bias-strip data. [LINE] If a global value has been set up using CCDSETUP this value will be used. [FALSE]
The image names should be separated by commas and may include wildcards.
The calibration master frames (parameters BIAS and possibly MASK) are never deleted.
The default for this parameter is TRUE and this cannot be overridden except by assignment on the command line or in response to a forced prompt. [TRUE]
If the logging system has been initialised using CCDSETUP, then the value specified there will be
used. Otherwise, the default is "
CCDPACK.LOG"
. [CCDPACK.LOG]
TERMINAL – Send output to the terminal only
LOGFILE – Send output to the logfile only (see the LOGFILE parameter)
BOTH – Send output to both the terminal and the logfile
NEITHER – Produce no output at all
If the logging system has been initialised using CCDSETUP then the value specified there will be
used. Otherwise, the default is "
BOTH"
. [BOTH]
If an image is given then any regions of BAD values (set through explicit BAD values or by BADBITS in the quality component) will be transferred to the output image.
If an ARD file is given then its regions will be interpreted and transferred to the output image. ARD is described in its own section.
The regions whose quality is to be set are probably hot spots, line defects etc. which contain little or no useful information. This parameters may be returned as ! indicating that no mask is to be applied.
If a global value for this parameter has been set using CCDSETUP then this will be used. If USESET is true then a value specific to the Set Index of each image will be sought.
The name of this file may be specified using indirection through a file. [!]
"
SIGMA"
. The actual clipping occurs at
NSIGMARNOISE.
If no variances are being generated then the RNOISE value is estimated from the data values in the
strips. [4.0] "
"
which means call each of the output images the same name as the corresponding input images.
So:
IN
OUT
signifies that all the images in the current directory should be used and the output images should have the same names.
Other types of modification can also occur, such as:
OUT tmp_
which means call the output images the same as the input images but put tmp_ in front of the names. Replacement of a specified string with another in the output file names can also be used:
OUT tmp_debiasflattened
this replaces the string debias with flattened in any of the output names tmp_.
This option should be used when a unacceptable loss of accuracy may occur, or when the data range can no longer be represented in the range of the present data type. The latter effect may occur when expanding input ADU values into electrons, if the ADC factor is large and the input data have types of _WORD,_UWORD,_BYTE or _UBYTE.
If a global value for this parameter has been set using CCDSETUP then this will be used. [TRUE]
If a global value has been set using CCDSETUP then this will be used. If USESET is true then a value specific to the Set Index of each image will be sought. [Dynamic default or 1.0]
If a global value has been set using CCDSETUP then this will be used. If USESET is true then a value specific to the Set Index of each image will be sought. [1.0D6]
"
flagged"
) values in the data component. This is the usual method of indicating the
presence of pixels with no value. If FALSE then the quality information will be transferred into the
quality component, all output quality pixels will have their BADBITS set. (Note that if the input image
already has a quality component the BADBITS will be set by a logical OR of the current
bits with the BADBITS value). [TRUE] "
CONSTANT"
or "
LINEAR"
. If only
one bias strip is given this may only take the value "
CONSTANT"
. This is used together
with the FMODE parameter to define the interpolation method, i.e. FMODE="
LINE"
,
SMODE="
LINEAR"
, fits each row or column of the bias strips by a straight line; FMODE="
PLANE"
,
SMODE="
CONSTANT"
derives a single constant for the bias value; FMODE="
PLANE"
,
SMODE="
LINEAR"
fits a plane to the bias-strip data. [CONSTANT] "
imported"
using the programs
PRESENT or IMPORT. Typically it is used when processing using CCDPACK’s "
automated"
methods (in this case the input images should contain all the information necessary to process
them).
The parameters that this effects are:
ADC
BOUNDS
DEFERRED
DIRECTION
EXTENT
RNOISE
SATURATION
ZERO
Values obtained from the CCDPACK extension are identified in the output log by the presence of a trailing asterisk (). [FALSE]
If a global value for this parameter has been set using CCDSETUP then that value will be used. [FALSE]
"
LINEAR"
, "
EXP"
, or "
NONE"
. "
LINEAR"
and "
EXP"
-onential produce weights which are
maximum in the centre of each bias strip and which fall off towards the edges. "
LINEAR"
weighting
gives zero weighting for the edge lines and so is the more robust. [LINEAR] ’
[2,10,400,415]’
adc=1.1 rnoise=8 ’
[2,10,401,416]’
adc=2.5 rnoise=10 ’
[2,10,401,416]’
smode=linear adc=5 fmode=plane direct=y
wmode=exp cmode=sigma rnoise=10 nsigma=4 ’
’
out=’
_debias’
bounds=’
[3,16,912,940]’
adc=1 rnoise=4 bias=bias/master_bias "
_debias"
string. If the input images have variance components and no variances are to be generated then they are processed.
Pixel indices. The bounds supplied to DEBIAS should be given as pixel indices. These usually start at 1,1 for the pixel at the lower left-hand corner of the data-array component (this may not be true if the images have been sectioned, in which case the lower left hand pixel will have pixel indices equal to the data component origin values). Pixel indices are different from pixel coordinates in that they are non-continuous, i.e. can only have integer values, and start at 1,1 not 0,0. To change from pixel coordinates add 0.5 and round to the nearest integer.
BOX
CIRCLE
COLUMN
ELLIPSE
LINE
PIXEL
POLYGON
RECT
ROTBOX
ROW
ARD descriptions can be created using the KAPPA application ARDGEN, or you can of course create
your own by hand. An example of the contents of an ARD file follows: #
# ARD description file for bad regions of my CCD.
COLUMN( 41, 177, 212 ) # Three bad columns
PIXEL( 201, 143, 153, 167 ) # Two Bad pixels
BOX( 188, 313, 5, 5 ) # One Hot spot centred at 188,313
ELLIPSE( 99, 120, 21.2, 5.4, 45.0 )
# Polygons defining badly vignetted corners
POLYGON( 2.2, 96.4, 12.1, 81.5, 26.9, 63.7, 47.7, 41.9,
61.5, 24.1, 84.3, 0.0 , 0.0, 0.0 )
POLYGON( 6.2, 294.3, 27.9, 321.0, 52.6, 348.7, 74.4, 371.5,
80.0, 384.0, 0.0, 384.0 )
#
"
current"
value
is the value assigned on the last run of the application. If the application has not been run then the
"
intrinsic"
defaults, as shown in the parameter help, apply. The exceptions to this rule are:
TITLE – always "
Output from DEBIAS"
KEEPIN – always TRUE
Retaining parameter values has the advantage of allowing you to define the default behaviour of the application but does mean that additional care needs to be taken when using the application on new datasets/different devices, or after a break of sometime. The intrinsic default behaviour of the application may be restored by using the RESET keyword on the command line.
Certain parameters (ADC, BIAS, BOUNDS, DEFERRED, DIRECTION, EXTENT, GENVAR, LOGFILE, LOGTO, MASK, PRESERVE, RNOISE, SATURATE, SATURATION, SETSAT and USESET) have global values. These global values will always take precedence, except when an assignment is made on the command line. If USESET is true, then global values of some of thse parameters (ADC, BOUNDS, DEFERRED, DIRECTION, EXTENT, MASK, RNOISE, SATURATION) specific to the Set Index of each image will be used if available. In general global values may be set and reset using the CCDSETUP and CCDCLEAR commands, however, the BIAS parameter may only be set by a run of the application MAKEBIAS.
If the parameter USEEXT is TRUE then the following parameters are not used: ADC, BOUNDS, DEFERRED, DIRECTION, EXTENT, RNOISE, SATURATION and ZERO. Values are obtained from the input image extensions instead.
This task supports all components of an NDF. If requested [default] a variance is produced from the bias subtracted values. The task processes BAD pixels. The UNITS of the output NDF are set to ADUs or electrons depending on whether data expansion has occurred or not. Processing is supported for all HDS (non-complex) numeric types.