Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/~mperrin/software/gpidata/_sources/developers/recipe_xml_devel.txt
Дата изменения: Tue Dec 31 08:57:10 2013
Дата индексирования: Sun Mar 2 17:06:15 2014
Кодировка:

Поисковые слова: п п п п п п п п п п п п п п п
Appendix: Recipe XML File ('DRF') Format
#####################################################

In normal usage, Recipe XML files are typically created using the GUI, but they
may be edited by hand. We describe here the file format, called a "Data Reduction File (DRF)" in terminology adapted from the Keck OSIRIS pipeline.

.. note::
The DRF file format is extremely similar to and descended from, but **not** exactly identical to,
the format of Keck OSIRIS DRFs. The following explanatory text is derived and adapted from
from the OSIRIS manual by Larkin et al., with modifications for GPI.

In general, an XML document is a simple ASCII file composed of markup tags. For GPI Recipe files,
the most common tag is used to specify the operation of a particular primitive such as::



In this example, the tag is enclosed in a `<` and `/>` to indicate the start and
end of the tag. Alternatively, we could have used a `<` and a `>` around the tag
contents, but then the complete tag would require an additional
to
specify the end of the tag. This would look like::



The module is the element start tag and specifies the type of tag, in this case
a module (primitive) call. Then Name , CalibrationFile, and Skip specify 'attributes' of the tag. It is up to
the pipeline to interpret these attributes. In many cases, tags can be nested,
and in fact a DRF is really just one `` tag with many sub-tags. Generally
white space such as spaces and carriage returns are ignored.

To add a comment to an xml file surround the text in a `` such as in this example::



Recipe DRF XML tags
=====================
Now we"ll begin looking at DRF specific XML tags. All DRFs must start with a header specifying the flavor of xml to use::


This is then followed by a DRF tag which can include
a Name attribe and/or a ReductionType attribute. Name provides a descriptive name for use in the Data Parser and Recipe Editor GUIs, but does not have any quantitiative effect on the data processing. Similarly, ReductionType provides a way to divide recipes into different sets for convenience, but does not directly impact the data processing.

So an example DRF tag might look like::







The typical DRF is then composed of a series of items specifying the order of the reduction steps as well as any calibration files and parameters that are needed. The name of the module must be specified using the Name attribute. These names are not negotiable and the exact name must be used. Examples::

?



.. note::
The XML element "module" is taken to be synonymous with "primitive", for back compatibility reasons. There is no difference between these two names in terms of pipeline functionality. The terms will be used interchangeably in the following.


Datasets can also have an associated OutputDir attribute. This can be used to specific a particular directory into which data will be written.
Optionally instead this can be the string 'AUTOMATIC', in which case the output directory will be chosen automatically as a
YYMMDD-labeled subdirectory of the $GPI_REDUCED_DATA_DIR.

Common parameters
======================

Each primitive can have an arbitrary list of parameters, just like keywords in IDL. However, due to the required way the XML file is parsed, all attributes must be strings enclosed in quotes. This is true even for simple integer values.

If the step needs a calibration file (i.e., Subtract Dark Frame, Extract Spectra) the attribute will look like::

CalibrationFile='/directory/SPEC/calib/calibration_file.fits'

If you decide to re-run a DRF and would like to skip a particular module, the easiest way is with the Skip attribute. Set it to т1" in order to skip the file, and set it back to т0" to execute the file. The default is т0" and is not required. ::

Skip="1"

Many modules allow the output data to be piped to a GPItv window for immediate display. Just set the gpitv argument equal to the session number of the window to display in. ::

gpitv="3"

Others allow the user to save the results of this step (distinct from saving the final output at the end of the whole list of steps) ::

save="1"

Other attributes are specific to each module or used by a subset of modules and are described elsewhere.

Example DRF
=============
::