Table Of Contents

Previous topic

5. AstroData Configuration Package Development Guide

Next topic

5.2. Creating A Configuration Package

This Page

5.1. Elements

Instrument-mode specific behaviors available through the AstroData class are not implemented in the astrodata package itself, but are instead loaded from configuration packages. In the case of Gemini data the configuration package is a directory named astrodata_Gemini. The path to this configuration package is included in the PYTHONPATH, or in either of the two astrodata environment variables, RECIPEPATH or ADCONFIGPATH.

The astrodata package searches for all directories named astrodata_<anything> in these environment variables. Though the configurations contain executable python, it is not meant to be imported as a regular python module but is loaded by the astrodata package.

5.1.1. The General Configuration Creation Process

  1. Define a tree of AstroDataTypes identifying types of your data.
  2. Create “descriptor” functions which calculate a particular metadata value for nodes of the AstroDataType tree defined, such as gain or filter_name.
  3. Write Python member functions bundled into PrimitivesSet classes, which specifically understand your dataset.
  4. Assemble primitives into sequential lists, which we call processing “recipes”.

Initially you will develop classifications for your data, and functions which will provide standard information, allowing you to use AstroData, e.g. in processing scripts. Then you will put your processing scripts in the form of “primitives” and collect these in “recipes” so they can be used for automated data reduction.

5.1.2. Configuration Elements Which Have To Be Developed

  1. AstroData Types identify classifications of MEF datasets to which other features can be assigned. Types have requirements which must hold for an identified dataset and also information about the place of the type in an overall type hierarchy (e.g. The GMOS type is the parent of GMOS_IMAGE).
  2. AstroData Descriptors are functions which calculate a particular type of metadata which is expected to be available for all datasets throughout the type hierarchy. Examples from the Gemini configuration package are gain and filtername. Different instruments store information about the gain in unique headers, and may even require lookup tables not located in the dataset. Descriptors are type-appropriate functions assigned at runtime to the astrodata instance, allowing type-specific implementations to manage these peculiarities.
  3. Primitives are dataset transformations meant to run in the Recipe System. Primitives are implemented as python generator functions in sets of primitives that apply to a common AstroDataType.
  4. Recipes are lists of primitives stored in plain text which can be executed by the AstroData Recipe System. While primitives work on the Reduction Context explicitly, the reduction context is implicit in recipes so that recipes can arguably be considered to contain “scientifically meaningful” steps with no “software artifacts”.