Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/instruments/observatory/cdbs/image/mkcomptab.ps
Дата изменения: Tue Sep 16 18:41:20 1997
Дата индексирования: Sun Mar 2 06:58:15 2014
Кодировка:

Поисковые слова: meteor
Mkcomptab
Bernie Simon
July 10, 1996
Usage
Mkcomptab is run by entering the name of the task followed by the name of the
output file. For example,
mkcomptab hstcomp.tab
The output file is component lookup table. This table is used by the syn­
phot software and associated a component mnemonic with the name of the
throughput table containing the component throughput. In order to produce
the component lookup table, the software must open each of the throughput
tables mentioned in it. Therefore, this task must be run from a machine where
the full set of synphot throughput tables is accessible.
Data Files
Mkcomptab uses the directory file to translate between iraf logical directory
names and operating system directory names. The name of this file is set by the
macro DIRECTORY NAME in system.h. The directory file has two columns. The
first column contains the name of the iraf logical and the second name contains
the translation to the operating system directory name. Subdirectories within
the second column are separated by slashes regardless of the host operating
system. If the translation does not start with a leading slash, the directory is
treated as a subdirectory of the top level CDBS directory, specified by the macro
CDBSDIR. This allows the same directoy file to be used on different systems as
long as the same subdirectory structure is used.
Environment Variables
Mkcomptab uses three environment variables that control its access to the
database. CDBS SERVER sets the database server the task accesses. CDBS DB
set the database that is used by the task. And CDBS USER sets the user name
used to access the database. If these three environment variables are not found,
the values used by the task default to ROBBIE, cdbs ops, and the user's login
name, repectively.

Algorithm
The main routine in mkcomptab is named task. It calls mkcomptab to cre­
ate a load file containing the component lookup table and write sdastab to
write it out as an SDAS format table. Mkcomptab calls init comptab to create
an empty component lookup table, comptab query to fill the table from the
CDBS database, and update comp to modify the table using information from
the throughput files. Init comptab writes the required header keywords to the
loadfile and then creates empty table columns. Comptab query retrieves the
names of the latest version of each component throughput file from the CDBS
database. Along with the filename it also retrieves the component mnemonic,
the comment, the installation date, and the useafter date. All this information,
except the useafter date, is written to a row in the loadfile. The useafter dates
are used to compute the useafter date of the component lookup table, which is
written to the table header. Update comp looks at each throughput file men­
tioned in the lookup table. If the name of the column storing the throughput
information is some other name than THROUGHPUT, it place the column name in
brackets after the filename in the lookup table. If it is a parameterized through­
put table, the value of the parameter is removed from the column name first.
Update comp calls getthrucol to get the name of the table column containing
the throughput information. It in turn calls getthrulist to get a list of all the
throughput columns in the table. If there is more than one, it calls similar
to choose which throughput column name most closely matches the component
mnemonic. Getthtrulist calls xlate fname to translate the throughput file
name from an iraf logical name to a host operating system name. It then opens
the table and adds all columns except the wavelength and error columns to the
list. If a throughput column is parameterized, it removes the parameter value
before adding it to the list. Xlate fname reads the dictionary file and substi­
tutes for any string in the filename ending with a dollar sign. The substitution
is done repeatedly, so iraf logicals in the directory file can be defined in terms of
other iraf logicals. If the resulting directory name does not begin with a slash,
the directory name is appended to the directory defined by the macro CDBSDIR.
Test Data
Mkcomptab does not need any input files to run. All information is read from
the database and the throughput tables. The argument to mkcomptab is the
name of the output file.
mkcomptab hstcomp.tab
2