For shakemap applications a set of ground motion models (and their corresponding weights) needs to be defined for each earthquake. Though these can be defined manually, it also desirable to define a
Regionalization, i.e. a set of geographical regions each with their own associated set of ground motion models. This is explained in #7 (closed)
This MR implements two classes for handling regionalizations at any scale:
Regionalizationclass, that loads and stores a given regionalisation and can, for a given earthquake, apply the geographical selection procedure to identify the region to which the earthquake is associated and its corresponding ground motion models.
RegionalizationSetclass, that manages multiple regionalizations, the order of which defines their own hierarchy. For example, a different regionalization may be required for
A) a country,
B) a continent (the spatial domain of which may include part or all of the country
C) a global scale regionalization. The order in which the
Regionalizationobjects are input into the
RegionalizationSetdefines the hierarchy, e.g. if the three regionalizations are input in the order
A B Cthen regionalization A will be applied if the earthquake falls within its domain, then
Cotherwise. If the order were reversed (
C B A) then the global regionalization (
C) would be applied in favour of the local regionalizations (
The geographical regions are managed within the
Regionalization class as a GeoPandas GeoDataFrame, which must include the attributes
UPPER DEPTH and geometry. The ground motion model mapping is manages as a dictionary, the structure of which reflects the json definition explained in #7 (closed).
classmethod is include in both
RegionalizationSet that allows the user to define the regionalization in the form of a
GeoJSON, and the corresponding ground motion model mapping as a standard
json. If a region type is found in the
GeoJSON for which the ground motion model mapping is not defined in then an error is raised.
A set of files defining the "standard GFZ" ground motion model is also included, though further edits to these may be made in future merge requests.
For the geometry configurations tested so far, a reasonable amount of speed is gained by using
Rtree for spatial indexing in order to determine the polygon in which the earthquake falls. This dependency is added to the