openquake.hmtk.comparison package

Submodules

openquake.hmtk.comparison.rate_grids module

Python tools for calculating activity rates on a grid from a source model

class openquake.hmtk.comparison.rate_grids.RateGrid(limits, sources, area_discretisation=10.0)[source]

Bases: object

Class for calculation of activity rate grids

Parameters
  • xspc (float) – Longitude spacing of grid

  • yspc (float) – Latitude spacing of grid

  • zspc (float) – Depth spacing (km) of grid

  • xlim (np.ndarray) – Longitude cell bounds

  • ylim (np.ndarray) – Latitude cell bounds

  • zlim (np.ndarray) – Depth cell bounds

  • nx (int) – Number of longitude cells

  • ny (int) – Number of latitude cells

  • nz (int) – Number of depth cells

  • source_model (list) – Seismic source mode

  • rates (np.ndarray) – Activity rates

  • area_discretisation (float) – Discretisation step (km) of area sources

classmethod from_model_files(limits, input_model, investigation_time=1.0, simple_mesh_spacing=1.0, complex_mesh_spacing=5.0, mfd_width=0.1, area_discretisation=10.0)[source]

Reads the hazard model from a file

Parameters
  • limits (list) –

    Grid configuration [west, east, xspc, south, north, yspc,

    upper, lower, zspc]

  • input_model (str) – Path to input source model

  • investigation_time (float) – Investigation time of Poisson model

  • simple_mesh_spacing (float) – Rupture mesh spacing of simple fault (km)

  • complex_mesh_spacing (float) – Rupture mesh spacing of complex fault (km)

  • mfd_width (float) – Spacing (in magnitude units) of MFD

  • area_discretisation (float) – Spacing of discretisation of area source (km)

get_rates(mmin, mmax=inf)[source]

Returns the cumulative rates greater than Mmin

Parameters

mmin (float) – Minimum magnitude

number_sources()[source]

Returns the number of sources

class openquake.hmtk.comparison.rate_grids.RatePolygon(limits, sources, area_discretisation=10.0)[source]

Bases: openquake.hmtk.comparison.rate_grids.RateGrid

Calculates the rate of events within a polygon

Parameters
  • limits – Polygon as instance of :class: openquake.hazardlib.geo.polygon.Polygon

  • upper_depth (float) – Upper seismic depth of the polygon (km)

  • lower_depth (float) – Lower seismic depth of the polygon (km)

  • source_model (list) – List of seismic sources

  • rates (float) – Activity rate of polygon

  • area_discretisation (float) – Discretisation spacing (km) of the area source

Module contents