kpg1Kymp1

Creates an AST KeyMap holding keyword/value pairs read from a GRP group

Description:

This function checks each non-comment, non-blank line in the supplied GRP group. An error is reported if any such lines do not have the form " keyword = value" , where the keyword name can be a hierarchical list of component names separated by dots. The returned KeyMap has an entry for each component name found at the start of any keyword name. The value associated with the entry will either be a primitive value (if the keyword name contained no other components) or another KeyMap (if the keyword name contained other components).

For example, consider a group containing the following lines:

gaussclumps.epsilon = (0.001,0.002) gaussclumps.contrast = 2.3 clumpfind.naxis = 2 clumpfind.deltat = 2.0 method = gaussclumps

The returned KeyMap will contain 3 entries with keys " gaussclumps" , " clumpfind" and " method" . The value associated with the " gaussclumps" entry will be another KeyMap containing keys " epsilon" (a primitive vector entry containing the values 0.001 and 0.002) and " contrast" (a primitive scalar entry with value " 2.3" ). The value associated with the " clumpfind" entry will be another KeyMap containing keys " naxis" and " deltat" , which will have primitive scalar values " 2" and " 2.0" . The value associated with the " method" entry will be the primitive scalar value " gaussclumps" .

Assigning the value " <def >" (case insensitive) to a keyword has the effect of removing the keyword from the KeyMap. For example:

^global.lis method = <def >

reads keyword values from the file " global.lis" , and then ensures that the KeyMap does not contain a value for keyword " method" . The calling application should then usually use a default value for " method" .

Assigning the value " <undef >" (case insensitive) to a keyword has the effect of forcing the value to be undefined. This can be useful in defining defaults where the keymap is locked after being populated.

Invocation

void kpg1Kymp1( const Grp igrp, AstKeyMap keymap, int status )

Arguments

igrp
A GRP identifier for the group of text strings to be analysed.
keymap
A location at which to return a pointer to the new KeyMap, or NULL if an error occurs. A valid pointer to an empty KeyMap will be returned if the supplied group contains nothing but comments and blank lines.
status
Pointer to the global status variable.

Notes: