Skip to content

Implements Feature/site model to handle the site configuration

This MR implements the shakyground2.site_model.SiteModel class to manage the construction and manipulation of the site properties needed for the shakemap, as specified in #12 (closed). Allows construction of the site model from a bounding box (with constant site properties) or pandas dataframe, and handles default properties for cases where they are not specified for the user.

Note:

  1. The site class itself mirrors some properties of the OpenQuake SiteCollection object, and indeed the site model will be exported to the OpenQuake SiteCollection object for running the shakemaps. This approach was adopted in favour of direct inheritance and extension of the SiteCollection object, which requires a stricter control on the inputs and manipulates the site model in a manner more specific to the OpenQuake calculation cases than the shakemap case considered here. The SiteModel here acts as an interface to handle the likelier range of inputs encountered for shakemap applications and to provide more control on how these are handled in order to build the site model. Both ways (inheritance and composition) were compared and the composition approach favoured.

  2. This does not address the case in which the input Vs30 data is extracted from the USGS Global Vs30 database. That will be a critical workflow feature, and methods for handling that will be added to this class subsequently, but this requires further consideration. A new issue will be opened on this in due course.

Merge request reports