28.5 COMPARE_HYP, compare hypocenters of two cat-files

This program compares hypocenters. The hypcenters can be either from one file ( option 1) with several hyopocenters for each event and the hupocenters to compare are selected by agency code. The intention with this option is to comapare hypocenters from different agencies stored in same s-file. An example is a download from ISC.

Or (option 2) the program compares two Nordic event files with the same events in both. The intention with this second option is to be able to see the effect of locating the same data set using a different model and or different magnitude scales.

Options 2

The input requires two files: The first file is the reference and the second file is the modified reference file. The compared content is origin time, rms, hypocenter and magnitudes. For each parameter, the average difference with standard deviations is calculated. The difference is calculated as the value in the reference minus the value in the modified file. In order to compare the files, they must have the same number of events and it is assumed that the events are the same and come in the same order, however the only thing checked is that the files contain the same number of events. If an event has no data (no hypocenter), the event is skipped. The the list of skipped events is given in a file compare_hyp.skip. The number of magnitudes for each event does not have to be the same so not all events need to have magnitudes. Only magnitudes available in both data sets are compared and listed. The magnitudes are always listed in order Ml, Mc, Mb, MB, Ms, MS, Mw. For the magnitudes there is no check if the agency is the same. If a magnitude appears 2 times, the last one will be used. Note that magnitude in position 3 on header line will not be overwritten when relocating unless it has the agency identical to the agency in the STATION0.HYP file, this can create problems when comparing so make sure the agency in that position corresponds to the agency used when locating.

SO IF ALL MAGNITUDES DO NOt HAVE THE SAME AGENCY, THE COMPARISON WILL NOT BE ACCURATE SINCE MAGNITUDES FORM DIFFERENT AGENCIES COULD BE COMPARED.

There is no check if epicenter is fixed since normally this is what will be compared. Since the depth very often is fixed, fixed depths are not used for comparison.

The output is a file called compare_hyp.out. It lists each event with the data from the reference event and the difference with the relocated event. Events with a difference of more than user defined values for the parameters, have their differences marked with a star, see example below. Events with less than a given number of stations are skipped. Events with no RMS are skipped. Events with flag set for no location are skipped. The skipped events are listed in file compare_hyp.skip. An example run is shown below. The default minimum differences used indicating with a star are 5 km in lat-lon and depth, 1 s in origin time, 0.5 s in rms and 0.2 magnitude units.

Example run

c:\seismo\wor>compare\_hyp
 Give input file 1, the reference, or single input file
eev.out
 Give input file 2, the file to compare
 If blank (enter) only one file is used
hyp.out
 2016  721 1517 46.7 D  41.340  44.040  5.0F SC3 20 1.5 4.2LSC3 5.7BSC3 4.3bSC3
 2016  721 1628 47.7 D -23.860-175.560 10.0F SC3 43 1.9 6.0LSC3 5.8BSC3 5.3bSC3
 2016  721 23 9  3.5 D  40.780-124.070 10.0F SC3 33 2.0 4.9LSC3 4.9BSC3 4.7bSC3
 2016  722  040 26.3 D  39.360  25.970  7.0  SC3 34 1.4 3.1LSC3 3.0SSC3
 2016  722 1131 49.5 D  19.900 120.900 10.0FSSC3 17 1.8 5.1BSC3 4.7bSC3
 2016  722 2140 10.2 D  42.400  35.210 23.0  SC3 49 1.0 4.4LSC3 3.9SSC3 4.6BSC3
 2016  722 2344 57.8 D  36.940  26.680  8.0  SC3 15 1.0 2.7LSC3
 2016  723  1 0 20.0 D  47.680 147.050395.0  SC3214 1.0 6.9LSC3 5.7BSC3 5.7bSC3
 2016  723  226 20.3 D  -7.410 128.920132.0  SC3 19 1.1 5.4LSC3 5.3BSC3 5.0bSC3
 2016  723  252 12.1 D  30.140 142.110 61.0  SC3 14 0.7 4.9LSC3 4.9BSC3 4.8bSC3
 2016  723  741 45.1 D  -6.710 101.270 10.0F SC3 83 1.5 6.0LSC3 5.8BSC3 5.3bSC3
  End of s-file
 2016  721 1517 46.5 D  41.342  44.053  5.0F SC3 20 1.6 4.2LSC3 4.6bSC3
 2016  721 1628 47.6 D -23.873-175.548 10.0F SC3 43 1.8 6.1LSC3 5.2bSC3 5.9BSC3
 2016  721 2309  3.2 D  40.770-124.070 10.0F SC3 33 2.0 4.9LSC3 5.0bSC3 5.1BSC3
 2016  722 0040 27.1 D  39.365  25.988  7.3  SC3 25 1.4 3.0LSC3
 2016  722 1131 49.4 D  19.911 120.895 10.0FSSC3 17 1.7 4.7bSC3 5.3BSC3
 2016  722 2140 11.9 D  42.343  35.206 22.2  SC3 42 1.3 4.4LSC3-4.1SSC3
 2016  722 2344 58.5 D  36.951  26.683 10.5  SC3 13 0.9 2.7LSC3
 2016  723 0100 19.3 D  47.772 147.040385.8  SC3214 0.8 7.3LSC3 5.4bSC3 5.6BSC3
 2016  723 0226 20.3 D  -7.409 128.924135.3  SC3 19 1.1 5.6LSC3 4.8bSC3 5.0BSC3
 2016  723 0252 12.1 D  30.140 142.097 61.9  SC3 14 0.7 5.1LSC3 4.4bSC3 4.9BSC3
 2016  723 0741 45.1 D  -6.701 101.262 10.0F SC3 83 1.5 6.1LSC3 5.2bSC3 5.9BSC3
  End of s-file

 Min difference to mark, lat-lon, depth, origin, rms, mag
 Defaults (enter) are 5km, 5km, 1s, 0.5s, 0.2s

 Min number of stations to compare, def 0

           Origin time RMS     Lat      Lon Depth          Ml   Mb   MB  
   Average diff    0.4 0.0  -0.005   -0.001   0.5        -0.1  0.1 -0.0
   Standard dev    1.0 0.1   0.033    0.010   4.5         0.1  0.3  0.2
   Number of values     10               11     6          10    8    7


 Output file name is compare_hyp.out
 Output of events deviating is compare_hyp_dev.out
 Output of events ok is compare_hyp_ok.out

The last two files can be used to plot bad and good events repectively.

In textttcompare_hyp.out, all the input headers are listed for the two files and at the end a summary of the differences is given. In the example above, note that there were 11 events. Five events had fixed depth so only 6 were used for depth comparison. For RMS, only 10 out of the 11 has an RMS. Also note that not all events had all the magnitude types. This example is comparing locations done with SeisComp3 and SEISAN.

NOTE: If RMS is 0.0, it is assumed there is no rms and it is not used. Below is shown the output file.

    #      Origin time RMS     Lat      Lon Depth    N     Ml   Mb   MB  
    1 20160721151746.7 1.5  41.340   44.040   5.0   20    4.2  4.3              
                   0.2-0.1  -0.002   -0.013               0.0 -0.3*             
    2 20160721162847.7 1.9 -23.860 -175.560  10.0   43    6.0  5.3  5.8         
                   0.1 0.1   0.013   -0.012              -0.1  0.1 -0.1         
    3 20160721230903.5 2.0  40.780 -124.070  10.0   33    4.9  4.7  4.9         
                   0.3 0.0   0.010    0.000               0.0 -0.3*-0.2         
    4 20160722004026.3 1.4  39.360   25.970   7.0   34    3.1                   
                  -0.8 0.0  -0.005   -0.018  -0.3         0.1                   
    5 20160722113149.5 1.8  19.900  120.900  10.0   17         4.7  5.1         
                   0.1 0.1  -0.011    0.005                    0.0 -0.2*        
    6 20160722214010.2 1.0  42.400   35.210  23.0   49    4.4            
                  -1.7*0.3   0.057*   0.004   0.8         0.0            
    7 20160722234457.8 1.0  36.940   26.680   8.0   15    2.7                   
                  -0.7 0.1  -0.011   -0.003  -2.5         0.0                   
    8 20160723010020.0 1.0  47.680  147.050 395.0  214    6.9  5.7  5.7         
                   0.7 0.2  -0.092*   0.010   9.2*       -0.4* 0.3* 0.1         
    9 20160723022620.3 1.1  -7.410  128.920 132.0   19    5.4  5.0  5.3         
                   0.0 0.0  -0.001   -0.004  -3.3        -0.2  0.2  0.3*        
   10 20160723025212.1 0.7  30.140  142.110  61.0   14    4.9  4.8  4.9         
                   0.0 0.0   0.000    0.013  -0.9        -0.2  0.4* 0.0         
   11 20160723074145.1 1.5  -6.710  101.270  10.0   83    6.0  5.3  5.8         
                   0.0 0.0  -0.009    0.008              -0.1  0.1 -0.1         

           Origin time RMS     Lat      Lon Depth          Ml   Mb   MB   MS    
   Average diff    0.4 0.0  -0.005   -0.001   0.5        -0.1  0.1 -0.0         
   Standard dev    1.0 0.1   0.033    0.010   4.5         0.1  0.3  0.2         
   Number of values                      11     6          10    8    7

For each event, the difference in value is shown. Note that the difference value has a star behind it if it exceeds the user specified values. The event numbers are also listed.

Option 1, a single file

Comparison of hypocenters is done between the hypocenters listed for the same event in the s-file. The hypocenters are selected based on user specified agencies. There is no comparuison of magnitudes. An output file of the events having hypocenters from specified agencies i made. In addion 2 compact file are made of the hypocenters and magnitudes from each of the two agencies making it possible to e.g. plot the hypocenters separately for the two agencies. Only magnitudes from corresponding agencies are selected, they are limited to 3. The output of the comparison in the standard output file as for option 2. is the rsame as for option 2. Below is an example run.

compare_hyp
 Give input file 1, the reference, or single input file
test.out
 Give input file 2, the file to compare
 If blank (enter) only one file is used

 Give reference agency
ISC
 Give agency to compare to
TIR
  1982  3 9 2311 34.9 R  39.825  19.879 12.7  ISC 67 1.8 4.5bISC 4.3SISC 4.5sISC1
  1983  3 3  931 16.2 R  40.155  19.797 9.00F ISC 97 2.1 4.5bISC 4.4SISC 4.5bISC1
  1995  524  340 27.8 RQ 39.711  20.437 7.00  ISC 36 1.7 3.6bISC 3.5bNEI 3.6bISC1
  1999  112  726 11.0 RQ 40.024  20.528 10.0  ISC108 1.7 4.1bISC 4.0bNEI 4.1bISC1
  1999  3 9  341  5.1 R  39.195  20.812 9.50  ISC 59 1.8 3.6bISC 3.8bNEI 3.6bISC1
  1999  3 9  523  3.1 R  39.171  20.846 31.8  ISC 65 1.7 3.7bISC 4.0bNEI 3.7sISC1
  1999  412 1716 28.0 R  40.413  21.450 13.2  ISC 86 1.8 3.7bISC 3.9LPDG 3.7bISC1
  1999  424  723 18.9 RQ 41.448  19.536 20.4  ISC118 2.4 4.2bISC 4.0bNEI 4.2bISC1
.
.
.
           Origin time   RMS     Lat      Lon Depth
   Average diff   -0.6   1.1  -0.089    0.053  -0.5
   Standard dev    4.8   0.5   0.299    0.272  11.0
   Number of values       75              106    99

 Output file name is compare_hyp.out
 File with events with both agencies is compare_hyp_both.out
 File with only events from ISC is ISC.out
 File with only events from TIR is TIR.out