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. In case the data base has not been used, there will no be information in REA.LOG. It can be updated with program CHECK_BASE, see next section.


 base
  Number of data bases          10
      TEST_ RUND_ JMI__ NSS__ PV___ ISC__ /HOME TERJE TEST1 TST__
 1990     1
 1993     1
 1994     2
 1995     2
 1996    13                      11          13
 1997     2
 1998     2                       5
 1999     2
 2000  1102
 2001  5259
 2002  4459                           857
 2003  4695    72    72    72         837
 2004  5753                          1052
 2005  5692
 2006  5098                       3
 2007  4537
 2008  6545                       4
 2009  3654
 2010  4370                       7
 2011  5081
 2012  5991
 2013  5901                       4               481         279
 2014  6923
 2015  7906
 2016  9203
 2018   850
 2019                          4119
 2021     9                       2           2
 2022  6073                                   8        2915
 2023  4039

  More info on one base, give name, else return to stop
TEST
         Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
 1990                                                             1
 1993                                              1
 1994                               1                   1
 1995                                         1              1
 1996                               8    5
 1997                                         1         1
 1998                                         2
 1999                          1                   1
 2000    499    3       600
 2001    488  401  545  579  358  378  419  450  387  427  408  419
 2002    372  369  490  413  412  378  309  377  232  383  414  310
 2003    380  372  460  381  359  403  436  385  380  375  464  300
 2004    447  360  554  766  616  448  470  389  397  425  416  465
 2005    460  388  488  387  462  389  601  539  434  548  455  541
 2006    357  320  394  440  419  346  389  524  469  628  444  368
 2007    391  416  407  327  286  302  340  451  352  263  481  521
 2008    402 1055 1032  925  667  386  364  373  389  343  323  286
 2009    246  269  291  339  262  280  218  349  385  419  294  302
 2010    316  390  448  487  303  365  320  401  325  311  358  346
 2011    604  440  856  357  413  311  344  516  404  304  264  268
 2012    336  342  458  448  449  410  573  728  733  610  451  453
 2013    406  412  465  582  547  481  504  541  505  503  444  511
 2014    544  540  540  624  734  655  662  555  451  429  649  540
 2015    514  412  596  683  665  697  900  781  665  726  714  553
 2016    761  633  765  809  681  661  682  903  878  908  896  626
 2018    850
 2021                                                             9
 2022    358  142  331   62  182  310  199  788 1107  794  941  859
 2023     50  191  875  975  609  645  445  249

  More info on one base, give name, else return to stop

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.

Find events with wrong period for amplitudes, check for Mb, Mb, Ms and MS.

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.

In addtion, a statistics is made of number of different phases. The total number P and S type phases are counted.

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:


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

  Number of data bases          63
 AGA__ ARRAY BERGE BER__ BRGZE BRGZN BRGZZ BUYAE BUYAN BUYAZ BYZNE BYZNN BYZNZ
 CJMI_ CNSS_ CRUND CTTTT DELET EASYE EASYN EASYZ GARDE GARDN GARDZ HPKC_ ISC__
 JMI__ LICO_ LIGL_ LIGR_ LMKC_ LMK__ LVC__ NEW__ NRTHE NRTHN NRTHZ NSS__ NWG11
 OILHE OILHN OILHZ PDEWE PDE__ PIERE PIERN PIERZ PV___ RTQ__ RUND_ SCRPE SCRPN
 SCRPZ SHTHE SHTHN SHTHZ TERJE TER__ TEST1 TEST_ TRK__ TRON_ TST__

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

  Start time
2016
  End time, return for end of month
20160110
  Check data base (c=enter) or only update statistics for program base(u)

 2016  1 Reading events from base TEST_  761
  2016  1 1 0029  8.6 L  67.854  20.249  0.0  BER  6 0.6 1.0LBER                1
  2016  1 1  037 41.0 LP                      BER  2                            1
  2016  1 1  042 33.0 LP                      BER  2                            1
  2016  1 1 0200 33.7 D -48.302 143.185 33.0F*NAO  1                     5.9BNAO1
  2016  1 1  720 23.0 LP                      BER  2                            1
  2016  1 1 1001 17.6 LP 67.701  26.831  0.0F BER  6 0.4 1.3LBER                1
  2016  1 1 1027  2.0 LP                      BER  2                            1
  2016  1 1 1116 48.4 D  35.977  70.129205.0F BER 11 0.3                 4.5bEMS1
  2016  1 1 1139 20.0 LP                      BER  2                            1
  2016  1 1 1208 15.9 LQ 76.084   7.206 10.0F BER  3 0.2 3.5NBER 3.1WBER        1
  2016  1 1 1216 31.0 LP                      BER  2                            1
  2016  1 1 1502 15.8 D -29.190-177.050 35.0FFBER 22 1.1                 5.8WEMS1
  2016  1 1 1651 48.0 LP                      BER  2                            1
  2016  1 1 1908 23.5JLQ 71.468  -8.623  0.6  BER  4 0.0 2.3LBER                1
  2016  1 1 2024  7.8 LP 66.407  14.774  0.0F BER  5 0.4 0.8LBER                1
  2016  1 1 2045 39.4 LE 66.392  14.831  0.0F BER  5 0.5 1.0LBER                1
  2016  1 1 2313 21.0 LP                      BER  2                            1
  2016  1 1 2315 52.0 LP                      BER  2                            1
  2016  1 1 2317 52.0 LP                      BER  2                            1
  2016  1 1 2317 52.0 LP                      BER  2                            1
  2016  1 1 2319 16.2 L  67.843  15.051  0.0  BER 17 0.6 1.3LBER 4.4WBER        1
  2016  1 2  034 10.0 LP                      BER  2                            1
  2016  1 2  034 10.0 LP                      BER  2                            1
  2016  1 2  038 48.0 LP                      BER  2                            1
  2016  1 2 0422 23.9 D  45.012 128.347586.0F BER 37 0.4                 5.8WEMS1
  2016  1 2  449 58.0 LP                      BER  2                            1
  2016  1 2 0607 30.1 LQ 66.317  13.138  3.5  BER  7 0.4 0.4LBER 2.3WBER        1
  2016  1 2 0730  7.9 LQ 78.964  13.998 15.0  BER  4 0.6 0.6LBER                1
  2016  1 2 0759 21.1 LQ 66.518  13.249  9.7  BER  4 0.1 0.2LBER                1
  2016  1 2 0837 28.9 D  37.148  70.001178.0F BER 35 0.4                 5.2WEMS1
  2016  1 2 1138 57.0 LP                      BER  2                            1
  2016  1 2 1138 57.0 LP                      BER  2                            1
  2016  1 2 1552 23.0 LP                      BER  2                            1
  2016  1 2 1726 37.0 LP                      BER  2                            1
  2016  1 2 1745 12.0 LP                      BER  2                            1
  2016  1 2 19 7  5.0 LP                      BER  2                            1
  2016  1 2 1939 37.6 LQ 76.978  18.996 12.1  BER  4 0.3 1.3LBER                1
  2016  1 2 20 9 12.0 LP                      BER  2                            1
  2016  1 3 0037  5.9 D  44.134 147.964 60.0F BER 10 0.4                 4.7bEMS1
  2016  1 3  037 48.0 LP                      BER  2                            1
  2016  1 3  042 31.0 LP                      BER  2                            1
  2016  1 3  1 8 51.0 LP                      BER  2                            1
  2016  1 3 0201 44.9 LQ 71.478  -3.878 10.0F BER 58 1.2 4.7NBER         4.6LNAO1
  2016  1 3 0224  5.2 LP 66.434  14.816  0.0F BER  6 0.6 0.9LBER                1
  2016  1 3  839 11.0 LP                      BER  2                            1
  2016  1 3 1033 24.0 LP                      BER  2                            1
  2016  1 3 11 0 34.0 LP                      BER  2                            1
  2016  1 3 1138  6.6JLQ 71.440  -8.421  1.6  BER  4 0.0 2.1LBER                1
  2016  1 3 1442  2.4 LQ 61.464   4.264  9.8  BER  4 0.3 0.8LBER                1
  2016  1 3 1450 34.8 LQ 66.506  13.481  7.1  BER  8 0.3 0.6LBER                1
  2016  1 3 1511 46.0 LP                      BER  2                            1
  2016  1 3 1701  6.1 LQ 79.944   4.077 29.0  BER  5 0.4 2.9NBER                1
  2016  1 3 1722 26.0 LP                      BER  2                            1
  2016  1 3 2033 36.0 LP                      BER  2                            1
  2016  1 3 2305 22.7 D  25.135  93.222 40.0F BER 31 1.7 6.7SBER 7.0BBER 6.8WEMS1
  2016  1 4  030 24.0 LP                      BER  2                            1
  2016  1 4  034 10.0 LP                      BER  2                            1
  2016  1 4  034 10.0 LP                      BER  2                            1
  2016  1 4 0641  8.6 LE 59.871  10.664  0.0F BER  8 0.6 1.2LBER                1
  2016  1 4 0641 8    LE                 0.0  OTH                               1
               *****
  ************** errros in file ****************
  2016  1 4  934 14.0 LP                      BER  2                            1
  2016  1 4 1011  1.3 LP 64.798  30.169  0.0F BER  6 0.3                 2.5LNAO1
.
.
.
.
.
  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 duplicate phase:        index_dup_phase.out
  File with events and duplicate phases               dup_phase.out
  Index file with events with other errors in S-file: index_bad_s.out
  Index file with events with bad period for mags.  : index_bad_period.out
  File with events with bad period for magnitudes   : bad_period.out
  File with number of different phases                phase_types.out

P            920
S            440
IAML         381
Sg            63
Pn            42
Pg            37
Sn            28
IVMs_BB       23
              21
IVmB_BB       18
SPEC          17
PKPbc         15
PKPdf          4
PKPab          3
sP             1
PKPa           1
PKPd           1
 Total number of P and S type phases, respectively        1023         549

At the end, all the different pahses are listed. Notice that there were 21 blank phases.

File check_base.out lists the errors:


Error found in file: /home/s2000/seismo/REA/TEST_/2016/01/04-0641-08L.S201601
 2016  1 4 0641 8    LE                 0.0  OTH                               1
               *****
 2016  1 4 0641  8.6 LE 59.871  10.664  0.0F BER  8 0.6 1.2L



 Error found in file: /home/s2000/seismo/REA/TEST_/2016/01/05-1626-18L.S201601
 2016  1 5 1626 18   LE                 0.0  OTH                               1
               *****
 2016  1 5 1626 18.9 LE 59.861  10.547  0.0F BER  6 0.4 1.0L



 Error found in file: /home/s2000/seismo/REA/TEST_/2016/01/09-0711-16L.S201601
 2016  1 9 0711 16   LE                 0.0  OTH                               1
               *****
 2016  1 9 0711 16.5 LE 59.859  10.578  0.0F BER  6 0.4 1.1L

All the files staring with index, give index files for events with errors.

The file dup_phase.out lists duplicate phases:


/home/s2000/seismo/REA/TEST_/2016/01/06-2003-42L.S201601
LOF   H N   Sg           LOF   H E   Sg

/home/s2000/seismo/REA/TEST_/2016/01/07-2221-35L.S201601
NBB17 H N   S            NBB17 H E   S

/home/s2000/seismo/REA/TEST_/2016/01/09-1041-00L.S201601
NBB40 H N   S            NBB40 H E   S

The program can thus check many different kinds of errros in the data and in addion make some statistics of phases used.