shakelib.gmice.gmice

class shakelib.gmice.gmice.GMICE[source]

Bases: abc.ABC

Base class called to implement ground motion intensity conversion equations (GMICE).

Inherited by AK07, Wald99, WGRW12.

static getDistanceType()[source]
supports(imt)[source]

Determine whether input IMT is supported by GMICE instance.

Parameters:

imt (str) – Valid IMT string - ‘MMI’, ‘PGV’, ‘PGA’, ‘SA(0.3)’, etc.

Returns:

True if gmice is defined for input IMT (and period), False

if not.

Return type:

bool

getMinMax()[source]

Get the minimum and maximum MMI values produced by this GMICE.

Returns:

Tuple of min and max values of GMICE.

getName()[source]

Get the name of this GMICE.

Returns:

String containing name of GMICE.

getScale()[source]

Get the name of the PostScript file containing this GMICE’s scale.

Returns:

Name of GMICE scale file.

getPreferredMI(df, dists=None, mag=None)[source]

Function to compute macroseismic intensity from the preferred ground-motion intensity. The function uses PGV by default, but this may be overridden by individual classes.

Parameters:
  • df (dict) – Dictionaary containing all of the available ground motions.

  • dists (ndarray) – Numpy array of distances from rupture (km).

  • mag (float) – Earthquake magnitude.

Returns:

ndarray of Modified Mercalli Intensity and ndarray of dMMI / dln(amp) (i.e., the slope of the relationship at the point in question).

getPreferredSD()[source]

Return an array of standard deviations for the preferred ground-motion to MMI conversion. Return None is the preferred IMT is not in the list of available IMTs for the GMICE.

Returns:

Array of GM to MI sigmas (in MMI units).

Return type:

(numpy array)

abstract getMIfromGM(amps, imt, dists=None, mag=None)[source]

Function to compute macroseismic intensity from ground-motion intensity. Supported ground-motion IMTs are PGA, PGV and PSA at 0.3, 1.0, and 2.0 sec periods.

Parameters:
  • amps (ndarray) – Ground motion amplitude; natural log units; g for PGA and PSA, cm/s for PGV.

  • imt (OpenQuake IMT) – Type the input amps (must be one of PGA, PGV, or SA). Supported SA periods are 0.3, 1.0, and 3.0 sec. [link] <http://docs.openquake.org/oq-hazardlib/master/imt.html>

  • dists (ndarray) – Numpy array of distances from rupture (km).

  • mag (float) – Earthquake magnitude.

Returns:

ndarray of Modified Mercalli Intensity and ndarray of dMMI / dln(amp) (i.e., the slope of the relationship at the point in question).

abstract getGMfromMI(mmi, imt, dists=None, mag=None)[source]

Function to tcompute ground-motion intensity from macroseismic intensity. Supported IMTs are PGA, PGV and PSA for 0.3, 1.0, and 3.0 sec periods.

Parameters:
  • mmi (ndarray) – Macroseismic intensity.

  • imt (OpenQuake IMT) – IMT of the requested ground-motions intensities (must be one of PGA, PGV, or SA). [link] <http://docs.openquake.org/oq-hazardlib/master/imt.html>

  • dists (ndarray) – Rupture distances (km) to the corresponding MMIs.

  • mag (float) – Earthquake magnitude.

Returns:

Ndarray of ground motion intensity in natural log of g for PGA and PSA, and natural log cm/s for PGV; ndarray of dln(amp) / dMMI (i.e., the slope of the relationship at the point in question).

abstract getGM2MIsd()[source]

Return a dictionary of standard deviations for the ground-motion to MMI conversion. The keys are the ground motion types.

Returns:

Dictionary of GM to MI sigmas (in MMI units).

abstract getMI2GMsd()[source]

Return a dictionary of standard deviations for the MMI to ground-motion conversion. The keys are the ground motion types.

Returns:

Dictionary of MI to GM sigmas (ln(PGM) units).