STScI logoSTSDAS Help Pages
mapkeyword ctio mapkeyword

NAME · USAGE · PARAMETERS · DESCRIPTION · EXAMPLES · BUGS · SEE_ALSO

NAME

mapkeyword -- Replace image header keyword values with other values.

USAGE

mapkeyword input keyword table

PARAMETERS

input
Images to process.
keyword
Image header keyword name to be edited. This must be a valid keyword name, either in lower or uppercase.
table
Mapping table file. This is a two column text file containing the keyword values and the mappings for those values.
verify = yes
Prompt the user for vefification before changing the keyword value ?. The possible answers to the prompts are: yes (do it and continue prompting), no (don't do it and continue prompting), YES (do it and continue without prompting), and NO (abort).
show = yes
Echo the operations as they are performed ?. This parameter has no effect if the user is being prompted for verification.
noop = no
Echo operations without performing them ?. This is usefull for checking what the task would do, without actualy doing it.
check = yes
Check for keyword values, present in the table, that were never used ?. If this parameter is set to yes , then the task will report which keyword values, present in the table, were not found in the image headers. This is usefull to detect misspelling errors in the keyword values.

DESCRIPTION

The task first reads the mapping table, specified in the table parameter, and stores the keyword values and their mapping values into a table in meory. This table is used later when the image headers are being edited.
Then, for each image in the input list, the task reads the value of the header keyword, specified in the keyword parameter, from the image header and replaces its value with the mapping value from the table in memory. If the keyword is not found in the image header then a warning message is issued, and and the task continues processing the next image in the input list. If the keyword value read from the image header is not present in the mapping table, then a waning message is issued. The keyword value is left unchanged in this case.

EXAMPLES

Change the filter number into a name. The following mapping table would be used for the UBV system:


ct> type filetable
1 U
2 B
3 V

ct> mapkeyword image*.imh FILTERS filetable verify- show+ noop- check-
Image [image1.imh], Keyword [FILTERS]: [1] -> [U]
Image [image2.imh], Keyword [FILTERS]: [2] -> [B]
Image [image3.imh], Keyword [FILTERS]: [3] -> [V]
Image [image4.imh], Keyword [FILTERS]: [2] -> [B]
ct>

BUGS

When a single word keyword value is converted to a multiple word value, the keyword value is enclosed between single quotes, in order to make it a single token. The problem arises when one tries to convert a quoted value into a single word value, and then back to a multiple word value. Since in the first conversion quotes are not removed, one will end with a value enclosed by two single quotes and each side. Unfortunately the IMIO routines will interpret this as a NULL string value, because of the two leading quotes.

SEE ALSO

images.hedit, images.hselect


Source Code · Search Form · STSDAS

Maintained by the Science Software Group at STScI
This file last updated on 28 Jun 1991