openquake.hmtk.seismicity.completeness package#

Submodules#

openquake.hmtk.seismicity.completeness.base module#

Module :mod:’openquake.hmtk.seismicity.completeness.base’ defines an abstract base class for :class:’CataloguCompleteness <BaseCatalogueCompleteness>

class openquake.hmtk.seismicity.completeness.base.BaseCatalogueCompleteness[source]#

Bases: object

Abstract base class for implementation of the completeness algorithms

abstract completeness(catalogue, config)[source]#
Parameters:
  • catalogue – Earthquake catalogue as instance of :class: openquake.hmtk.seismicity.catalogue.Catalogue

  • config (dict) – Configuration parameters of the algorithm

openquake.hmtk.seismicity.completeness.comp_stepp_1971 module#

Module openquake.hmtk.seismicity.completeness.comp_stepp_1972 defines the openquake.hmtk implementation of the Stepp (1972) algorithm for analysing the completeness of an earthquake catalogue

class openquake.hmtk.seismicity.completeness.comp_stepp_1971.Stepp1971[source]#

Bases: BaseCatalogueCompleteness

Implements the completeness analysis methodology of Stepp (1972) Stepp, J. C. (1972) Analysis of Completeness of the Earhquake Sample in the Puget Sound Area and Its Effect on Statistical Estimates of Earthquake Hazard, NOAA Environmental Research Laboratories.

The original methodology of J. C. Stepp (1972) implements a graphical method in which the deviation of the observed rate from the expected Poisson rate is assessed by judgement. To implement the selection in an automated fashion this implementation uses optimisation of a 2-segment piecewise linear fit to each magnitude bin, using the segment intersection point to identify the completeness period.

Adaptation implemented by Weatherill, G. A., GEM Model Facility, Pavia

Attribute numpy.ndarray magnitude_bin:

Edges of the magnitude bins

Attribute numpy.ndarray sigma:

Sigma lambda defined by Equation 4 in Stepp (1972)

Attribute numpy.ndarray time_values:

Duration values

Attribute numpy.ndarray model_line:

Expected Poisson rate for each magnitude bin

Attribute numpy.ndarray completeness_table:

Resulting completeness table

completeness(catalogue, config)[source]#

Gets the completeness table.

Parameters:
  • catalogue – Earthquake catalogue as instance of openquake.hmtk.seismicity.catalogue.Catalogue

  • config (dict) – Configuration parameters of the algorithm, containing the following information: ‘magnitude_bin’ Size of magnitude bin (non-negative float) ‘time_bin’ Size (in dec. years) of the time window (non-negative float) ‘increment_lock’ Boolean to indicate whether to ensure completeness magnitudes always decrease with more recent bins

Returns:

2-column table indicating year of completeness and corresponding magnitude numpy.ndarray

get_completeness_points(n_years, sigma, n_mags, n_time)[source]#

Fits a bilinear model to each sigma-n_years combination in order to get the crossover point. The gradient of the first line must always be 1 / sqrt(T), but it is free for the other lines

Parameters:
  • n_years (numpy.ndarray) – Duration of each completeness time window

  • sigma (numpy.ndarray) – Poisson variances of each time-magnitude combination

  • n_mags (int) – Number of magnitude bins

  • n_time (int) – Number of time bins

Returns:

  • comp_time (Completeness duration)

  • gradient_2 (Gradient of second slope of piecewise linear fit)

  • model_line (Expected Poisson rate for data (only used for plot)

simplify(deduplicate=True, mag_range=None, year_range=None)[source]#

Simplify a completeness table result. Intended to work with ‘increment_lock’ enabled.

openquake.hmtk.seismicity.completeness.comp_stepp_1971.get_bilinear_residuals_stepp(input_params, xvals, yvals, slope1_fit)[source]#

Returns the residual sum-of-squares value of a bilinear fit to a data set - with a segment - 1 gradient fixed by an input value (slope_1_fit)

Parameters:
  • input_params (list) –

    Input parameters for the bilinear model [slope2, crossover_point,

    intercept]

  • xvals (numpy.ndarray) – x-values of the data to be fit

  • yvals (numpy.ndarray) – y-values of the data to be fit

  • slope1_fit (float) – Gradient of the first slope

Returns:

Residual sum-of-squares of fit

Module contents#