ames/ingest.conf

This file controls the conversion to CPD2 data done by data.wdca.ames.convert. It is located in $DB/etc/$STATION/ames/ingest.$STATION.conf or in the default location $DB/etc/ames/ingest.conf. If the station specific file does not exist then the default one is used. After any changes to this file the cache for edited data should be invalidated.

Format

Lines beginning with '#' are treated as comments. The format consists of a CSV separated list of key and values. Keys are case insensitive. The file is further broken down into a number of nested definitions, the outermost scope defines a single output CPD2 variable. “Virtual” variables may also be defined to be imported into other variables. The import sets all the values contained in the virtual variable in the real one.

To be used a real variable must have all its match conditions met. Both virtual and real variables share the same allowed objects in their scope.

Variable Scope Definition

A variable scope begins at the outermost scope with “Variable” or “VirtualVariable” and ends with “End”. Within a variable the following keys/scopes are allowed:

  • Name - The base CPD2 name, allows for parameter substitution (see below).
  • Format - The CPD2 format, allows for parameter substitution (see below).
  • MVC - The CPD2 format, allows for parameter substitution (see below).
  • Match - Begins a variable matching scope.
  • Import - All values are treated as virtual variables to be imported into the current variable.
  • Description - Begins a description trigger scope.
  • Header - Begins a header trigger scope.
  • NormalComment - Begins a normal comment trigger scope, the first field is the name of the comment type to check as a regular expression.
  • SpecialComment - Begins a special comment trigger scope.
  • End - End the scope.

The following parameter substitutions are available:

  • $WAVELENGTH - The wavelength code or number, if available.
  • $CUT - The cut size flag, either “0” for 10um, “1” for 1um or empty if not cut split.

Variable Matching Scope

Defines triggers to require a variable to match to be used. All triggers defined must match. The following keys are allowed:

  • NormalComment - Require a normal comment to match, the first field is the normal comment type and the second is the value. Either field may be a regular expression that will be wrapped like /^$field$/.
  • Header - Require the header name of a variable to match the first field or be equal to “value”. May be a regular expression that will be wrapped like /^$field$/.
  • End - End the scope.

Trigger Match Scope

Defines the value to match and the actions to take for a trigger match. The first field in the scope definition is the value to match as a regular expression. “$1” to “$9” are replaced with the respective captures from that regular expression in the value (the first field). The following actions are available:

  • SetWavelength - Set the wavelength of the variable in nm.
  • SetScale - Set the scale factor of the variable.
  • SetCut - Set the cut (or clear if missing).
  • SetFieldDesc - Set the field description (CPD2 header).
  • End - End the scope.

Description Trigger Scope

Defines the triggers to run on the description of a variable. The following keys are allowed:

  • Match - Begin a trigger match scope (see above).
  • End - End the scope.

Header Trigger Scope

Defines the triggers to run on the header name of a variable. The following keys are allowed:

  • Match - Begin a trigger match scope (see above).
  • End - End the scope.

Normal Comment Trigger Scope

Defines the triggers to run on the a normal comment of the file. The first field in the scope beginning is a regular expression to match against the available normal comments. The following keys are allowed:

  • Match - Begin a trigger match scope (see above).
  • End - End the scope.

Special CommentTrigger Scope

Defines the triggers to run on the file special comments. The following keys are allowed:

  • Match - Begin a trigger match scope (see above).
  • End - End the scope.