STScI Logo

tabkey tables



tabkey -- Copy a table element to a header keyword.


tabkey table column row output keyword


This task copies the value of a table element to a header keyword in either a table or an image. If the table element and the header keyword are of different data types, this task will convert the type. An error will occur if any attempt is made to copy an undefined table element to a header keyword. If the value of the task parameter add is "yes", the task will allow you to add a new keyword to the header, otherwise, adding a new keyword will cause an error.


table [file name]
Name of table containing the element to be copied. The particular element is defined by the column and row parameters.
column [string]
Name of column. (Column names are not case sensitive.)
row [integer, min=1, max=INDEF]
Row number.
output [file name]
Name of the file with the header keyword whose value is to be changed.
keyword [string]
Name of header keyword. (Header keyword names are not case sensitive.)
(add = no) [boolean]
Allow new keywords to be added to the header? If add = no, then only existing header keywords can be modified--an error will occur if a keyword is specified that does not already exist.


1. Copy the first component name (i.e., row 1 of column COMPNAME from the file to the header of the table If the keyword does not already exist, then add it:

tt> tabkey COMPNAME 1 COMPNAME add+

2. Copy the date of the tenth observation (i.e., row 10 of column DATE) from the file to the header keyword DATE in image.hhh. The keyword DATE must already exist:

tt> tabkey DATE 10 image.hhh date



This task was written by Bernie Simon.


keypar, keytab, parkey, partab, tabpar

Source Code · Search Form · STSDAS