next up previous 107
Next: Frame headers
Up: Adding new instruments
Previous: Adding new instruments

Frames

An ORAC::Frame class is responsible for filename conventions and handling of sub-frames. The most common methods that need to be sub-classed are:

new()

The object constructor should be modified to set the default behaviour for rawfixedpart(), (the part of the filename that does not change with UT date of observation number), rawsuffix(), (the file suffix of the raw data file), rawformat() (the input format of the data: FITS, NDF etc.) and format() (the data format required by the algorithm engines).

The base constructor (SUPER::new()) should be invoked to instantiate the object.

calc_orac_headers()

This method is used to translate instrument specific headers to those required by the pipeline. Currently this method must insert the following keywords into the frame header.

ORACUT

This should be the UT date of the observation in YYYYMMDD format.

ORACTIME

This should be the UT date and time of the observation in YYYYMMDD.frac format (i.e. UT date plus fraction of day). This is used by the calibration system to ensure that a guaranteed time stamp can be used for comparison in index files.

file_from_bits()

Given a UT date and an observation number, return the name of the raw data file. This is used by the pipeline to look for the file on disk.

flag_from_bits()

Given a UT date and an observation number, return the name of the flag file. This is used by the pipeline to search for a completion flag on disk associated with the current observation file. Only required if it is intended for the pipeline to be used in conjunction with the -loop flag option.

findgroup()

Translates the header values into a group name and updates the frame.

findrecipe()

Translates the header values into a recipe name and updates the frame.

template()

Modifies the current filename so that it matches the filename that you would have had at an earlier point in the reduction when the supplied template was valid. This is used for jumping to earlier steps in the reduction when performing group operations. Currently this method is generally implemented by replacing the suffix with the supplied value. It could also be implemented by accessing the list of prior file names with the intermediates() method.

inout()

Given a suffix and sub-frame number provide a recommended name for the output file. Does not update the frame object. In general, this can either simply append the suffix or replace the last suffix. The latter is normal practice.

In addition to those listed above, some methods need to know something about the file format and should be modified (most UKIRT and JCMT instruments inherit from the ORAC::Frame::NDF class rather than ORAC::Frame since that class knows how to read from NDF files). The automatic format conversion will have occurred before these methods need to be run (for example if the input format is FITS but the processing format is NDF, then the methods should be written assuming NDF files). These methods are as follows.

readhdr()

Reads the file header and stores the resulting hash reference in the object. Also forces the ORAC headers to be calculated.

erase()

A method to delete the file currently associated with the frame. This is effectively and unlink() but for NDF files the .sdf is appended. The base class implementation can be used in most cases.

file_exists()

Checks to see if the data file exists. There is a special case for NDF format since the .sdf extension is not present in the file name.

stripfname()

Strips the extension from the filename. The base class does nothing to the filename.

Finally, any extra methods not present in the base class but required by an instrument should also be added. These can cover translation of wavelengths to sub-frame filename, for example (used by the SCUBA class).





next up previous 107
Next: Frame headers
Up: Adding new instruments
Previous: Adding new instruments

ORAC-DR -- Programmer's Guide
Starlink User Note 233
Tim Jenness, Frossie Economou, Brad Cavanagh
Joint Astronomy Centre, Hilo, Hawaii
June 2004
E-mail:ussc@star.rl.ac.uk

Copyright © 2004 Particle Physics and Astronomy Research Council