| keypar | tables | keypar |
keypar -- Copy a header keyword to an IRAF parameter.
keypar input keyword
This task reads a header keyword from an image or table file. The keyword is written to the IRAF parameter value as a character string. If the header keyword is boolean, the value of value will either be "yes" or "no". If the header keyword is not found, value will be set to a null string. String parameters, such as value, can be converted to numeric data types with the built in functions real() and int().
1. Print the number of groups (i.e., the GCOUNT keyword) in the image file image.hhh:
tt> keypar image.hhh gcount tt> print(keypar.value)
2. Print the range of the data in the second group of the same image by reading the values of the DATAMIN and DATAMAX keywords:
tt> keypar image.hhh[2] datamin tt> x = real(keypar.value) tt> keypar image.hhh[2] datamax tt> y = real(keypar.value) tt> print(y-x)
3. Print the component name (i.e., the COMPNAME header keyword) for the table thruput.tab:
tt> keypar thruput.tab compname tt> print(keypar.value)
4. Check for the existence of the exposure time in an image header:
tt> keypar image.hhh exptime silent+
tt> if (keypar.found) {
>>> print keypar.value
>>> } else {
>>> print INDEF
>>> }
This task was written by Bernie Simon. SEE ALSO keytab, parkey, partab, tabkey, tabpar