5.3.2 Data base tools, content and checks

Content of data bases, program BASE:

In the REA directory, a binary file called REA.LOG contains information about number of events in all data bases. Initially the file has no information, but each time programs EEV, HYP, UPD, CHECK_BASE or COLLECT are executed, the information is updated for the months accessed. The information can be displayed with program BASE, which first shows available data bases and the user, can then select one to get info for particular months. Make sure to use right case for data base names, always in upper case on Unix systems.

Check for data base related errors, program CHECK_BASE

The data base depends on error free S-files and that there is a correspondence between the S-file name and the event ID. This should normally be ok, however errors can occur during editing or there can be program crashed producing errors. The program reads the data base and checks for:

Missing ID lines: If ID line is missing, it can be put in with command us, doing an UPDATE, using UPD or command us in EEV.

No correspondence between ID line and S-file name: A serious error has occurred. Thsi can only be checked if using a daat base and not with a CAT file. Try to find out what is correct, the ID or the file name. An UPDATEi, UPD or us in EEV cures the problem, however data might be lost.

Missing type 1 of first line for event: Note that many programs reading from the data base will automatically correctt for this. So if a collect.out file is made, the 1 might be missing in the data base, but not in collect.out.

Error in S-file: All parameters are checked and files with non standard parameters are indicated. The error can be a number in a wrong position. The errors should be corrected.

Dulicate phase names: The phases are compared and events where two phases of type P or S that have the first two letters identical, will be flagged if from the same station. The 2.letter will be converted to upper case, e.g. Pg and PG will be considered the same phase.

For all the above cases, an index file is generated with bad S-files and EEV can the be used directly with the index file to access the bad S-files. THIS ONLY WORKS WITH ONE DATA BASE AT A TIME.

The program can also run on a single CAT file like collect.out. Since a CAT does not belong to a data base, it might no be possible to make an index file. The program will attempt to make an index file using the base name given as input to program and the ID lines for each event. If no ID line the origin time will be used. If data comes from another agency, this will mostly not work since the user might not have that data base. In that case, split the CAT file to some data base (also local) do the check_base on that.

It is recommended to run check_base in case of system crash or as a security, just before an UPDATE.

Example run:

Give file name or data base name, file name must have a .
Enter to search for all data bases

  Number of data bases          13

  Base name(s), * is all, ,, is local, else, one pr line, return for no more

  Start time
  End time, return for end of month

  Check data base (c) or only update statistics for program base(u)
  2018  1 Reading events from base TIR__  85
  2018  1 1 1356 26.8 L  39.965  19.726 5.10  TIR    .24 3.4LTIR         3.4LTIR1
  2018  1 1 2216 13.7 L  41.099  22.719 24.9  TIR    .37 3.5LTIR         3.5LTIR1
  2018  131 21 2 34.2 L  40.077  20.406 26.3  TIR    .20 1.7LTIR 2.7CTIR 1.7LTIR1

  Number of events without id-lines:                     0
  Number of events with wrong id   :                     0
  Number of events with missing type 1:                  0
  Number of events with other errors in file:            0

  Output file name is:                                check_base.out
  Index file with events with no id lines:            index_no_id.out
  Index file with events with wrong id line:          index_bad_id.out
  Index file with events with wrong type 1:           index_no_type_one.out
  Index file with events with other errors in S-file: index_bad_s.out