GEMScienceTools / oq-mbtk

OpenQuake Model Building Toolkit, a suite of tools for building components and analysing models for PSHA.
https://gemsciencetools.github.io/oq-mbtk/index.html
GNU Affero General Public License v3.0
16 stars 8 forks source link

Testing the merge of two .csv catalogues #254

Closed mmpagani closed 1 year ago

mmpagani commented 1 year ago

This PR adds a test on the code that merges two catalogues contained in two .csv files. The first catalogue read sets the initial set of 'prime' events. The second catalogue adds some additional origins and some prime events. We check that the new prime events and the additional solutions agree with the parameters of each event in the sample comcat catalogue. Below I show the DataFrame in the otab.h5 file. The only 'prime' events in the COMCAT sample are the first and last ones since their coordinates occur to be rather different than the ones of the eqks in the ISC GEM sample (all located around Japan).

(Pdb++) odf[['eventID', 'Agency', 'year', 'month', 'day', 'hour', 'minute', 'second', 'longitude', 'latitude', 'depth', 'prime']]
      eventID  Agency  year  month  day  hour  minute  second   longitude   latitude      depth  prime
0    16298689  ISCGEM  2011      3   10     8       8    19.0  143.388000  38.647999  16.900000      1
1    16298689  COMCAT  2011      3   10     8       8    20.0  143.270004  38.603001  17.400000      0
2    16461280  ISCGEM  2011      3   11     0      14    49.0 -117.528000 -53.306999  10.000000      1
3    16461282  ISCGEM  2011      3   11     5      46    23.0  142.546005  38.285000  20.000000      1
4    16461282  COMCAT  2011      3   11     5      46    24.0  142.373001  38.297001  29.000000      0
5   602653817  ISCGEM  2011      3   11     5      54    31.0  141.324997  37.569000  35.000000      1
6   602653817  COMCAT  2011      3   11     5      54    31.0  141.184006  37.712002  32.299999      0
7    16403886  ISCGEM  2011      3   11     5      59    35.0  141.742996  37.042999  35.000000      1
8    16403886  COMCAT  2011      3   11     5      59    31.0  141.763000  37.054001   8.400000      0
9  usp000hvng  COMCAT  2011      3   11     0      14    48.0 -117.836998 -53.209999  10.000000      1