Skip to content

Adds tools for preparing flatfiles and calculating GMM residuals

Graeme Weatherill requested to merge feature/GM_residuals into main

The next set of features for the PSHA testing toolkit contains functions to manage flatfiles of ground motion observations, merge them with earthquake catalogues to retreive the harmonised magnitudes, run clean-up and preprocessing, before finally comparing them against GMMs using OpenQuake and calculating the between effects residuals. For the illustrative workflows we will use the ITACA flatfile (https://itaca.mi.ingv.it/ItacaNet_32/#/products/itacaext_flatfile) and the HORUS Earthquake Catalogue (http://horus.bo.ingv.it/), so specific subclasses and/or functions are added specifically for these data sets

Among the features added are:

  1. Class to handle flatfiles, including loading and cleanup (i.e. removal or in-filling of missing metadata). This is sub-classed to a specific parser for the ITACA/ESM flatfile format (pshatest.flatfile_handler.FlatfileFormatter)
  2. Functionality to define how to fill in missing metadata (pshatest.scenario_validator.ScenarioValidator)
  3. Tools for handling earthquake catalogues (including those with multiple origins and magnitudes) and to merge magnitude-harmonised earthquake catalogues with the flatfile in order to obtain a harmonised magnitude measure for the GM analysis
  4. Functionality to calculate mixed-effects residuals for the flatfile. This requires R2Py using an R installation with lme4 and lmerTest, which may need additional steps in the installation process (pshatest.gmm_residual_analysis.Residuals)
Edited by Graeme Weatherill

Merge request reports