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.
The site class itself mirrors some properties of the OpenQuake
SiteCollectionobject, and indeed the site model will be exported to the OpenQuake
SiteCollectionobject for running the shakemaps. This approach was adopted in favour of direct inheritance and extension of the
SiteCollectionobject, 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
SiteModelhere 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.
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.