Note

For a description of the style convention and how JSON structures are documented see section JSON Data Structures.

Named JSON structures are indicated as {JSON}.

FITS Keyword Rules

KeywordRules {JSON}

Note

Oftentimes the keyword rules are optional and will if unspecified a default behaviour is provided where the user keywords (see Keyword Classification) are copied.

To disable copying completely an empty list should be used.

(List[Union[KeywordRuleFilter, KeywordRuleTransform]])

Specifies which keywords from this source will merged to final Data Product primary HDU. If no rules are specified, all keywords are included by default.

Each rule can be thought of a function that accepts a list of keywords and returns a list of keywords. A list of rules is can be thought of functions that are chained. Expressed in pseudo code with two filter functions first and second it may look like:

result = second(first(keywords))

or:

result = keywords | first() | second()

By specifying a combination of the supported filter and transform rules daqDpmMerge support common operations like

Each rule is executed in order with the input from the previous output. The input of the first rule are all non-structure FITS keywords.

KeywordRuleFilter {JSON}

Can determine which keywords to copy during merging.

(object)

Specifies a filter rule with include and exclude patterns. Any keyword that is not explicitly included will not be copied.

Example:

{
  "type": "filter",
  "selectionPatterns": [
    "+e INS *",
    "-e INS TEMP[12] *",
    "+v VALUEKW"
  ]
}
type (“filter”)

This is a union discriminator and must have the literal string value "filter".

selectionPatterns (KeywordSelectionPatterns)

List of pattern rules that build up a list of keywords by successively adding or subtracting keywords from a list that finally will be included.

See KeywordSelectionPatterns {JSON}.

KeywordRuleTransform {JSON}

Allows the transformation the logical keyword name of a selection of keywords.

This can for example be used to change the ESO Hierarch Keyword category to prevent name collision.

(object)

Transforms keyword names.

Example:

{
  "type": "transform",
  "selectionPatterns": [
    "+e INS *"
  ],
  "regex": "^INS ",
  "format": "INS2 "
}
type (“transform”)

This is a union discriminator and must have the literal string value "transform".

selectionPatterns (KeywordSelectionPatterns)

Selects which keywords to transform, see KeywordSelectionPatterns {JSON}. Keywords that do not match this selection are kept as-is.

regex (str)

Regular expression matching a string to replace.

format (str)

String replacing the matched regular expression.

KeywordSelectionPatterns {JSON}

(List[str])

List of pattern rules that build up a list of keywords by successively adding or subtracting keywords from a list that finally will be included.

Each rule has the following syntax:

<rule> ::= <operator><scope> ' ' <pattern>
<operator> ::= '+' | '-'
<scope> ::= 'v' | 'e' | 'c'
<pattern> ::= <ascii-text> | <wildcard> | <pattern>
<ascii-text> ::= [#x20 - #x7e] /* ' ' - '~' */
<wildcard> ::= '*' | '?' | '[' <ascii-text> ']'
<operator>

Specifies the operator to apply for matching keywords.

+

Additive operator that cause keywords matching pattern in source to be added to the keyword list.

-

Subtractive operator that cause keywords matching rule to removed from keyword list.

<scope>

Specifies the scope of the pattern matching by limiting to the specified keyword type. The pattern matching is performed against the Logical Keyword Name.

v

Denotes Value Keywords.

e

Denotes ESO Hierarch Keywords.

c

Denotes Commentary Keywords.

<wildcard>

Shell wildcard pattern (for additional details, see man fnmatch(3)).

*

Matches any string.

?

Matches any single character.

[

Starts a character class matching any character enclosed in expression [...]. The matching can be negated with [!...] so that it matches any character not in the enclosed expression.

<ascii-text>

Legal FITS ASCII characters. Characters “*”, “?” and “[” must be escaped with “" to prevent the special wildcard meaning. See manpage glob().

Example that includes the “VALUEKW” keyword as well as ESO hierarchical keywords in the INS category, excluding the INS TEMP1 * and INS TEMP2 * keywords:

["+v VALUEKW", "+e INS *", "-e INS TEMP[12] *"]

Example that includes all “COMMENT” keywords.

["+c COMMENT"]