The calibration system is essentially based on the concept of index files. An index file is a data file
containing information on all calibration observation reduced by the pipeline. A separate index file is
created for each calibration sub-system (e.g. one for dark observations, one for skydip observations
etc) with the convention is that each index file is stored in ORAC_DATA_OUT
and prefixed with the string
index
(e.g. index.dark
, index.skydip
etc.). It is the responsibility of a primitive (usually
a complete recipe is dedicated to the calibration observation) to file a calibration to an
index file. The index file can be used simply to register a file name (e.g. the name of a dark
file or flatfield) or a calibration result (the current sky opacity or flux conversion factor).
Methods are provided in the ORAC::Index
class for retrieving this information from the index
file9
The index object is responsible for searching the relevant index file and returning the most suitable
calibration. This is achieved by the use of external rules files (stored in ORAC_DATA_CAL
called
rules.CALIBRATION_NAME
) which list which header keywords are relevant and should be checked
against the headers of the current frame. This means that the calibration object itself does not need to
worry about searching the index file or reading the rules files.
An example rules file could look like:
The format is intended to be fairly simple as it should be possible for a non-programmer to edit it. The main points are:
and the last line in the above rules file could be translated to the following if
statement (using
ORACTIME of 19990827.55 for the index entry):
which returns true if the ORACTIME
stored in the index is within half a day of the value stored in
the current frame object (%Hdr is a hash read from the current frame header). The semi-colon is
used to separate the Perl code into two statements. The return value of the eval
is
that of the second statement. This is required for cases that are not simply ‘A == B
’
format.
can be used instead since in this case the test will always return true.
orac-dr gives the user the ability to override the default calibration information as returned by the
pipeline through use of the -calib
commandline option. By adding methods in ORAC::Calib
or in instrument-specific subclasses, it is possible to add various override methods. As
an example of this, see the profile
, profilename
, profileindex
, and profilenoupdate
methods in ORAC::Calib::CGS4
. For further information on adding override methods see
§9.3, and for information on using override methods when reducing data with orac-dr see
SUN/230.
A number of general overrides are available.
9For efficiency, the index file is kept in memory rather than read from disk every time it is to be accessed. This means that orac-dr is not guaranteed to work if two processes are sharing a single ouput data directory as this would cause problems with index file updates [they are not locked].