shakelib.multigmpe

class shakelib.multigmpe.MultiGMPE[source]

Bases: openquake.hazardlib.gsim.base.GMPE

Implements a GMPE that is the combination of multiple GMPEs.

To do

  • Allow site to be based on a model that isn’t a GMPE (e.g., Borcherdt).
DEFINED_FOR_TECTONIC_REGION_TYPE = None
DEFINED_FOR_INTENSITY_MEASURE_TYPES = None
DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = None
DEFINED_FOR_STANDARD_DEVIATION_TYPES = None
REQUIRES_SITES_PARAMETERS = None
REQUIRES_RUPTURE_PARAMETERS = None
REQUIRES_DISTANCES = None
get_mean_and_stddevs(sites, rup, dists, imt, stddev_types)[source]

See superclass method.

classmethod from_config(conf, filter_imt=None, verbose=False)[source]

Construct a MultiGMPE from a config file.

Parameters:
  • conf (dict) – Dictionary of config options.
  • filter_imt (IMT) – An optional IMT to filter/reweight the GMPE list.
  • verbose (bool) – Print verbose output for debugging.
Returns:

MultiGMPE object.

classmethod from_list(gmpes, weights, imc='Greater of two horizontal', default_gmpes_for_site=None, default_gmpes_for_site_weights=None, reference_vs30=760)[source]

Construct a MultiGMPE instance from lists of GMPEs and weights.

Parameters:
  • gmpes (list) – List of OpenQuake GMPE instances.
  • weights (list) – List of weights; must sum to 1.0.
  • imc – Requested intensity measure component. Must be one listed here. The amplitudes returned by the GMPEs will be converted to this IMT. Default is ‘GREATER_OF_TWO_HORIZONTAL’, which is used by ShakeMap. See discussion in this section of the ShakeMap manual.
  • default_gmpes_for_site (list) –

    Optional list of OpenQuake GMPE instance to use as a site term for any of the GMPEs that do not have a site term.

    Notes

    • We do not check for consistency in the reference rock defintion, so the user nees to be aware of this issue and holds responsibiilty for ensuring compatibility.
    • We check whether or not a GMPE has a site term by c hecking the REQUIRES_SITES_PARAMETERS slot for vs30.
  • default_gmpes_for_site_weights – Weights for default_gmpes_for_site. Must sum to one and be same length as default_gmpes_for_site. If None, then weights are set to be equal.
  • reference_vs30 – Reference rock Vs30 in m/s. We do not check that this matches the reference rock in the GMPEs so this is the responsibility of the user.
get_site_factors(sites, rup, dists, imt, default=False)[source]

Method for computing site amplification factors from the defalut GMPE to be applied to GMPEs which do not have a site term.

NOTE Amps are calculated in natural log units and so the ln(amp) is returned.

Parameters:
  • sites (SitesContext) – Instance of SitesContext.
  • rup (RuptureContext) – Instance of RuptureContext.
  • dists (DistancesContext) – Instance of DistancesContext.
  • imt – An instance openquake.hazardlib.imt.
  • default (bool) – Boolean of whether or not to return the amplificaiton factors for the gmpes or default_gmpes_for_site. This argument is primarily only intended to be used internally for when we just need to access the default amplifications to apply to those GMPEs that do not have site terms.
Returns:

Site amplifications in natural log units.

static set_sites_depth_parameters(sites, gmpe)[source]

Need to select the appropriate z1pt0 value for different GMPEs. Note that these are required site parameters, so even though OQ has these equations built into the class in most cases. I have submitted an issue to OQ requesting subclasses of these methods that do not require the depth parameters in the SitesContext to make this easier.

Parameters:
  • sites – 1 An OQ sites context.
  • gmpe – An OQ GMPE instance.
Returns:

An OQ sites context with the depth parameters set for the requested GMPE.

shakelib.multigmpe.filter_gmpe_list(gmpes, wts, imt)[source]

Method to remove GMPEs from the GMPE list that are not applicable to a specific IMT. Rescales the weights to sum to one.

Parameters:
  • gmpes (list) – List of GMPE instances.
  • wts (list) – List of floats indicating the weight of the GMPEs.
  • imt (IMT) – OQ IMT to filter GMPE list for.
Returns:

List of GMPE instances and list of weights.

Return type:

tuple

shakelib.multigmpe.get_gmpe_sa_periods(gmpe)[source]

Method to extract the SA periods defined by a GMPE.

Parameters:gmpe (GMPE) – A GMPE instance.
Retunrs:
list: List of periods.
shakelib.multigmpe.get_gmpe_coef_table(gmpe)[source]

Method for finding the (or “a”) GMPE table.

Notes

  • The reason for the complexity here is that there can be multiple coefficient tables, and some of them may not have the sa_coeffs attribute, which is the main reason for getting the table.
  • We are also assuming that if there are more than one coefficient table, the range of periods will be the same across all of the tables.
Parameters:gmpe (GMPE) – An OQ GMPE instance.
Returns:The associated coefficient table.