GEMScienceTools / gmpe-smtk

Python and OpenQuake-based Toolkit for Analysis of Strong Motions and Interpretation of GMPEs
GNU Affero General Public License v3.0
44 stars 33 forks source link

Adds test code for residuals + inter-event residual storage bug fix #72

Closed g-weatherill closed 6 years ago

g-weatherill commented 6 years ago
  1. Adds on a test module for the Residuals module of the toolkit. Verifies basic database construction, connection and execution of the 5 GMPE-to-Data comparison classes Residuals, Likelihood, LLH, MultivariateLLH, EDR

  2. Slight modification of the inter-event residuals for cases when they are site- or distance-dependent (i.e. ChiouYoungs2008, ChiouYoungs2014 etc.). Previously Numpy's unique function was used to determine if the inter-event residual was site- or distance-independent. This has an unexpected behaviour in certain cases in which some but not all inter-event values are the same in a given event. A simpler logical check is used and it is only in the case that all the inter-event values are the same that a single scalar inter-event residual is stored, otherwise it stores the whole vector of inter-event residuals regardless of duplicates.