next up previous 264
Next: AST_MAPPUTU - Add an entry to a KeyMap with an undefined value
Up: AST Routine Descriptions
Previous: AST_MAPPUT1X - Add a vector value to a KeyMap


AST_MAPPUTELEM$<$X$>$ - Put a value into an element of a vector value in a KeyMap

Description:
This is a set of functions for storing a value in a single element of a vector value in a KeyMap. You should replace $<$X$>$ in the generic function name AST_MAPPUTELEM$<$X$>$ by an appropriate 1-character type code (see the "Data Type Codes" section below for the code appropriate to each supported data type). The supplied value is converted from the data type indicated by $<$X$>$ to the data type of the KeyMap entry before being stored (an error is reported if it is not possible to convert the value to the required data type).
Invocation:
CALL AST_MAPPUTELEM$<$X$>$( THIS, KEY, ELEM, VALUE, STATUS )
Arguments:
THIS = INTEGER (Given)
Pointer to the KeyMap.
KEY = CHARACTER $*$ ( $*$ ) (Given)
The character string identifying the value to be retrieved. Trailing spaces are ignored. The supplied string is converted to upper case before use if the KeyCase attribute is currently set to zero.
ELEM = INTEGER (Given)
The index of the vector element to modify, starting at one.
VALUE = $<$X$>$type (Given)
The value to store.
STATUS = INTEGER (Given and Returned)
The global status.
Class Applicability:
KeyMap
If the ELEM index is outside the range of the vector, the length of the vector will be increased by one element and the supplied value will be stored at the end of the vector in the new element.
Table
If the ELEM index is outside the range of the vector, an error will be reported. The number of elements in each cell of a column is specified when the column is created using AST_ADDCOLUMN.
Notes:
  • If the entry originally holds a scalar value, it will be treated like a vector entry of length 1.

  • If the specified key cannot be found in the given KeyMap, or is found but has an undefined value, a new vector entry with the given name, and data type implied by $<$X$>$, is created and the supplied value is stored in its first entry.
Data Type Codes
To select the appropriate routine, you should replace $<$X$>$ in the generic routine name AST_MAPPUTELEM$<$X$>$ with a 1-character data type code, so as to match the data type $<$X$>$type of the data you are processing, as follows:
  • D: DOUBLE PRECISION

  • R: REAL

  • I: INTEGER

  • C: CHARACTER

  • A: INTEGER used to identify an AstObject

  • S: INTEGER$*$2 (short integer)

  • B: BYTE (unsigned)

For example, AST_MAPPUTELEMD would be used to put a DOUBLE PRECISION value, while AST_MAPPUTELEMI would be used to put an INTEGER value, etc.


next up previous 264
Next: AST_MAPPUTU - Add an entry to a KeyMap with an undefined value
Up: AST Routine Descriptions
Previous: AST_MAPPUT1X - Add a vector value to a KeyMap

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 210
R.F. Warren-Smith & D.S. Berry
24th May 2011
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2009 Science \& Technology Facilities Council