Getarc is a monolithic perl program for gathering data from multiple instruments and combining them into a single archive with a common time base. The original data must be stored in a format consistent with the Format Specification for Data Exchange, created by Steven Gaines and Stephen Hipskind of NASA Ames Research Center. The output is generated as a MATLAB .mat file.
Getarc was designed with the following goals in mind:
The first goal is key, because one of the times when getarc is most useful is during a mission when no one has time to futz with keeping an archive up-to-date. Getarc can check for updates autonomously several times a day, download exactly those files which have changed, update the archive and mail out notification to a mailing list identifying which files have been updated.
The second goal is related to the first, since without it, any such benign change would require significant intervention. The fact is, these sorts of changes do occur on a regular basis, but the file format contains sufficient documentation to allow a well-designed utility to compensate for them.
getarc [date ...] |
The date arguments are optional. The default is to process all dates present in the FTP or localhost archive. Date arguments may include wildcards.
getarc reads the files getarc.rc and getarc.cfg in the current directory to determine how to proceed.
AcceptIf $Files{"O3$Date"}
getarc.cfg is the file in which the individual instruments and variables are defined. It consists of one or more instrument definitions. Each instrument definition consists of a header line followed by zero or more data definition or SCRIPT lines. Comment lines beginning with '#' can appear at any point in the file.
An instrument header line begins with two non-space characters at the left margin optionally followed by a space and a descriptive title for the instrument. e.g.:
TW Harvard Total Water
A data definition line begins with one or more spaces, then a variable name, a colon (':'), and then a pattern that should match the variable's description in the source file. The pattern is matched using perl regular expressions. This means that if you want to match special characters such as parentheses, you need to escape them with a backslash: e.g.:
TW: Total Water \(ppmv\)
If the experimenter tends to forget case, you can use character classes to match all the likely alternates:
TW: [Tt]otal [Ww]ater \(ppmv\)
[Note that these data definition lines all start with spaces!]
There are many more features of perl regular expressions. Ask your local perl guru for more information.
A script line is listed along with the data definitions for an instrument. Like a data definition, it begins with spaces, then the keyword 'SCRIPT'. The remainder of the line is treated as perl code that should be evaluated whenever this instrument's source files need to be processed.
SCRIPT { require "PT.pl"; Process_PT( $Date, $InstDef{$Inst}, \%ArcCol, $Delta, $Instday, $Filename ); }
Scripts are given total responsibility for the processing of a given instrument's source file. That is to say, when you specify a script, getarc will no longer attempt to locate your variables in the source file or merge data from the source file into the archive. This is because some scripts may need to make changes before merging while others may need to make changes after.
Scripts can make use of several handy getarc variables and subroutines, but not all of the getarc variables a script might want access to are global. You must make up for that by making sure that your SCRIPT line passes all the variables you need.
Writing getarc scripts requires considerable knowledge of the getarc internals, none of which are well-documented. Your best bet is to talk to your local getarc guru to see the best way to begin and refer to examples of scripts currently in use.
Some of the getarc variables and functions which will be useful within a script:
Return to Manuals Guide.
Written by
Norton T. Allen
Return to Manuals Guide
last updated: Mon Apr 14 12:37:29 2003 | webmaster@huarp.harvard.edu |
Copyright 2003 by the President and Fellows of Harvard College |