Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/hst/observatory/crds/documents/recreate_load_file.pdf
Дата изменения: Unknown
Дата индексирования: Sun Mar 2 09:03:36 2014
Кодировка:
recreate load le
Rick Whitman November 27, 1996

Usage
The tool is invoked byentering recreate load le on the command line followed by one argument which is a reference le name. For example:
recreate_load_file a3d1145dy.cy0

There are also twoenvironmentvariables that must be de ned in order for the tool to perform some database actions using OpenSTDB. These environment variables are: CDBS SERVER - set to the database server name (in uppercase) CDBS DB - set to the CDBS database name (in lowercase) The output will be a single load le named the same as the input reference le name but with the extension \.lod". For example:
a3d1145dy.lod

This le can be used simply as a reference or can be edited to update the comments. Then it can be used with the comments sql gen to update the comments in the database. The tool will also output a line indicating the input le currently being processed and then the name of the output le produced to stdout.
Processing file A3D1145DY.CY0... Load file: a3d1145dy.lod has been generated

It will also write messages indicating errors, if they occur, to stdout. Upon detection of an error the task is terminated.

Algorithm/Module Description
The tool consists of a single le with several functions. It also calls functions from the loadutils library and the OpenSTDB library. The following steps are performed:


The GetInst function is called to determine which instrument the reference le is associated with. This is accomplished by getting the last character in the le name before the \." or \ ". This character is then used to query the instrument abbreviations table in the database and return the instrument name. The le-level and row-level table names are determined from the instrumentname. The GetPutFileLevel function is called to query the le-level table for the values associated with the reference le and output them to the load le. The GetPutRowLevel function is called to query the row-level table for the values associated with the reference le and output them to the load le.
{

{ {

This function rst calls the GetModes function to determine which modes are used in this particular reference le type. It does this by querying the cdbs mode database table with the given instrument and reference le type. Then the row-level table for the instrument is queried for the keyword values associated with the reference le. For each row-level row retrieved, the GetChangeLevel function is called to determine the CHANGE LEVEL value for the load le. This is done by querying the row-level table for the equivalence class associated with the comparison le. Those values are then compared to the equivalence class values for the le being processed to determine a level of SEVERE, MODERATE or TRIVIAL.

Testing
The test script recreate load le.sh is available to test the recreate load le tool. The test script is invoked by entering its name. It is assumed that you are running the script from the cdbs/test/script directory and that yourdata isin the cdbs/test/data directory and that the cdbs/test/data/tmp directory exists. The script uses following les: u-init-y.lod - this le is an example of an initial unexpanded fos load le. It loads data for the le: u-init-y.cy0 u-next-y.lod - this is an unexpanded fos load which uses u-init-y as its reference le. This will allow for testing the determination of the CHANGE LEVEL. e-init-y.lod - this le is an example of an initial expanded fos load le. It loads data for the le: e-init-y.cy0 2


e-next-y.lod - this is an expanded fos load which uses e-init-y as its reference le. This will allow for testing the determination of the CHANGE LEVEL. Note that these les are not intended to be accurate examples of CDBS load les but are only intended to demonstrate the various program paths. The following steps will take place during the test:
cdbs sql gen

will be run on all of the les to generate SQL for loading the database. The SQL will then be executed to do the inserts. recreate load le will be run for each of the reference les to regenerate the load les in the cdbs/test/data/tmp directory. The new load le in the cdbs/test/data/tmp directory will be di erenced with the original load les in the cdbs/test/data directory. There should be no di erences.

3