openquake.hmtk package¶
Subpackages¶
- openquake.hmtk.comparison package
- openquake.hmtk.faults package
- openquake.hmtk.parsers package
- openquake.hmtk.plotting package
- Subpackages
- openquake.hmtk.plotting.faults package
- openquake.hmtk.plotting.seismicity package
- Subpackages
- Submodules
- openquake.hmtk.plotting.seismicity.catalogue_plots module
- Module contents
- Submodules
- openquake.hmtk.plotting.beachball module
- openquake.hmtk.plotting.mapping module
- openquake.hmtk.plotting.plotting_utils module
- Module contents
- Subpackages
- openquake.hmtk.seismicity package
- Subpackages
- openquake.hmtk.seismicity.completeness package
- openquake.hmtk.seismicity.declusterer package
- openquake.hmtk.seismicity.max_magnitude package
- Submodules
- openquake.hmtk.seismicity.max_magnitude.base module
- openquake.hmtk.seismicity.max_magnitude.cumulative_moment_release module
- openquake.hmtk.seismicity.max_magnitude.kijko_nonparametric_gaussian module
- openquake.hmtk.seismicity.max_magnitude.kijko_sellevol_bayes module
- openquake.hmtk.seismicity.max_magnitude.kijko_sellevol_fixed_b module
- Module contents
- openquake.hmtk.seismicity.occurrence package
- Submodules
- openquake.hmtk.seismicity.occurrence.aki_maximum_likelihood module
- openquake.hmtk.seismicity.occurrence.b_maximum_likelihood module
- openquake.hmtk.seismicity.occurrence.base module
- openquake.hmtk.seismicity.occurrence.kijko_smit module
- openquake.hmtk.seismicity.occurrence.penalized_mle module
- openquake.hmtk.seismicity.occurrence.utils module
- openquake.hmtk.seismicity.occurrence.weichert module
- Module contents
- openquake.hmtk.seismicity.smoothing package
- Submodules
- openquake.hmtk.seismicity.catalogue module
- openquake.hmtk.seismicity.gcmt_catalogue module
- openquake.hmtk.seismicity.gcmt_utils module
- openquake.hmtk.seismicity.selector module
- openquake.hmtk.seismicity.utils module
- Module contents
- Subpackages
- openquake.hmtk.sources package
- Submodules
- openquake.hmtk.sources.area_source module
- openquake.hmtk.sources.complex_fault_source module
- openquake.hmtk.sources.point_source module
- openquake.hmtk.sources.simple_fault_source module
- openquake.hmtk.sources.source_conversion_utils module
- openquake.hmtk.sources.source_model module
- Module contents
- openquake.hmtk.strain package
Submodules¶
openquake.hmtk.models module¶
Simple objects models to represent elements of NRML artifacts. These models are intended to be produced by NRML XML parsers and consumed by NRML XML serializers.
-
class
openquake.hmtk.models.
AreaGeometry
(wkt=None, upper_seismo_depth=None, lower_seismo_depth=None)[source]¶ Bases:
openquake.hmtk.models.PointGeometry
Basic object representation of a geometry for a
PointSource
.Parameters: - wkt (str) – WKT representing the area geometry (a POLYGON).
- upper_seismo_depth (float) – Upper seismogenic depth.
- lower_seismo_depth (float) – Lower siesmogenic depth.
-
class
openquake.hmtk.models.
AreaSource
(id=None, name=None, trt=None, geometry=None, mag_scale_rel=None, rupt_aspect_ratio=None, mfd=None, nodal_plane_dist=None, hypo_depth_dist=None)[source]¶ Bases:
openquake.hmtk.models.PointSource
Basic object representation of an Area Source.
Parameters: - id (str) – Source identifier, unique within a given model.
- name (str) – Human-readable name for the source.
- trt (str) – Tectonic Region Type.
- geometry –
AreaGeometry
instance. - mag_scale_rel (str) – Magnitude Scaling Relationship.
- rupt_aspect_ratio (float) – Rupture Aspect Ratio.
- mfd – Magnitude Frequency Distribution. An instance of
IncrementalMFD
orTGRMFD
. - nodal_plane_dist (list) – list of
NodalPlane
objects which make up a Nodal Plane Distribution. - hypo_depth_dist (list) – list of
HypocentralDepth
instances which make up a Hypocentral Depth Distribution.
-
class
openquake.hmtk.models.
CharacteristicSource
(id=None, name=None, trt=None, mfd=None, rake=None, surface=None)[source]¶ Bases:
openquake.hmtk.models.SeismicSource
Basic object representation of a characteristic fault source.
Parameters: - id (str) – Source identifier, unique within a given model.
- name (str) – Human-readable name for the source.
- trt (str) – Tectonic Region Type.
- mfd – Magnitude Frequency Distribution. An instance of
IncrementalMFD
orTGRMFD
. - rake (float) – Rake angle.
- surface – A
SimpleFaultGeometry
,ComplexFaultGeometry
, or a list ofPlanarSurface
objects.
-
class
openquake.hmtk.models.
ComplexFaultGeometry
(top_edge_wkt=None, bottom_edge_wkt=None, int_edges=None)[source]¶ Bases:
object
Basic object representation of a geometry for a
ComplexFaultSource
.Parameters: - top_edge_wkt (str) – WKT representing the fault top edge (a LINESTRING).
- bottom_edge_wkt (str) – WKT representing the fault bottom edge (a LINESTRING).
- int_edges (list) –
Intermediate fault edges, between the top edge and bottom edge. A list of str objects representing the WKT for each intermediate fault edge (each is a LINESTRING).
This parameter is optional.
-
class
openquake.hmtk.models.
ComplexFaultRuptureModel
(id=None, magnitude=None, rake=None, hypocenter=None, geometry=None)[source]¶ Bases:
openquake.hmtk.models.SimpleFaultRuptureModel
Basic object representation of a Complex Fault Rupture.
Parameters: - id (str) – Rupture identifier, unique within a given model.
- magnitude (float) – Magnitude.
- rake (float) – Rake angle.
- hypocenter (list) – Floats representing lon, lat and depth.
- geometry –
ComplexFaultGeometry
object.
-
class
openquake.hmtk.models.
ComplexFaultSource
(id=None, name=None, trt=None, geometry=None, mag_scale_rel=None, rupt_aspect_ratio=None, mfd=None, rake=None)[source]¶ Bases:
openquake.hmtk.models.SimpleFaultSource
Basic object representation of a Complex Fault Source.
Parameters: - id (str) – Source identifier, unique within a given model.
- name (str) – Human-readable name for the source.
- trt (str) – Tectonic Region Type.
- geometry –
ComplexFaultGeometry
object. - mag_scale_rel (str) – Magnitude Scaling Relationship.
- rupt_aspect_ratio (float) – Rupture Aspect Ratio.
- mfd – Magnitude Frequency Distribution. An instance of
IncrementalMFD
orTGRMFD
. - rake (float) – Rake angle.
-
class
openquake.hmtk.models.
HazardCurveData
(location, poes)¶ Bases:
tuple
-
location
¶ Alias for field number 0
-
poes
¶ Alias for field number 1
-
-
class
openquake.hmtk.models.
HazardCurveModel
(**metadata)[source]¶ Bases:
object
Simple container for hazard curve objects. The accepted arguments are:
* investigation_time * imt * imls * statistics * quantile_value * sa_period * sa_damping * data_iter (optional), an iterable returning pairs with the form (poes_array, location).
-
class
openquake.hmtk.models.
HypocentralDepth
(probability=None, depth=None)[source]¶ Bases:
object
Basic object representation of a single node in a Hypocentral Depth Distribution.
Parameters: - probability – Probability for this node in a Hypocentral Depth Distribution, as a float.
- depth (float) – Depth (in km).
-
attrib
¶ An dict of XML element attribute for this HypocentralDepth.
-
class
openquake.hmtk.models.
IncrementalMFD
(min_mag=None, bin_width=None, occur_rates=None)[source]¶ Bases:
object
Basic object representation of an Incremental Magnitude Frequency Distribtion.
Parameters: - min_mag (float) – The lowest possible magnitude for this MFD.
- bin_width (float) – Width of a single histogram bin.
- occur_rates (list) – list of occurrence rates (float values).
-
attrib
¶ A dict of XML element attributes for this MFD.
-
class
openquake.hmtk.models.
Location
(x, y)¶ Bases:
tuple
-
x
¶ Alias for field number 0
-
y
¶ Alias for field number 1
-
-
class
openquake.hmtk.models.
NodalPlane
(probability=None, strike=None, dip=None, rake=None)[source]¶ Bases:
object
Basic object representation of a single node in a Nodal Plane Distribution.
Parameters: - probability – Probability for this node in a Nodal Plane Distribution, as a float.
- strike (float) – Strike angle.
- dip (float) – Dip angle.
- rake (float) – Rake angle.
-
attrib
¶ A dict of XML element attributes for this NodalPlane.
-
class
openquake.hmtk.models.
PlanarSurface
(strike=None, dip=None, top_left=None, top_right=None, bottom_left=None, bottom_right=None)[source]¶ Bases:
object
Parameters: - strike – Strike angle.
- dip – Dip angle.
- top_left,top_right,bottom_left,bottom_right – Corner points of the planar surface, represented by
Point
objects.
-
class
openquake.hmtk.models.
Point
(longitude=None, latitude=None, depth=None)[source]¶ Bases:
object
A simple representation of longitude, latitude, and depth.
Parameters: - longitude – Longitude
- latitude – Latitude
- depth – Depth
-
class
openquake.hmtk.models.
PointGeometry
(wkt=None, upper_seismo_depth=None, lower_seismo_depth=None)[source]¶ Bases:
object
Basic object representation of a geometry for a
PointSource
.Parameters: - wkt (str) – WKT representing the point geometry (a POINT).
- upper_seismo_depth (float) – Upper seismogenic depth.
- lower_seismo_depth (float) – Lower siesmogenic depth.
-
class
openquake.hmtk.models.
PointSource
(id=None, name=None, trt=None, geometry=None, mag_scale_rel=None, rupt_aspect_ratio=None, mfd=None, nodal_plane_dist=None, hypo_depth_dist=None)[source]¶ Bases:
openquake.hmtk.models.SeismicSource
Basic object representation of a Point Source.
Parameters: - id (str) – Source identifier, unique within a given model.
- name (str) – Human-readable name for the source.
- trt (str) – Tectonic Region Type.
- geometry –
PointGeometry
instance. - mag_scale_rel (str) – Magnitude Scaling Relationship.
- rupt_aspect_ratio (float) – Rupture Aspect Ratio.
- mfd – Magnitude Frequency Distribution. An instance of
IncrementalMFD
orTGRMFD
. - nodal_plane_dist (list) – list of
NodalPlane
objects which make up a Nodal Plane Distribution. - hypo_depth_dist (list) – list of
HypocentralDepth
instances which make up a Hypocentral Depth Distribution.
-
class
openquake.hmtk.models.
SeismicSource
(id=None, name=None, trt=None)[source]¶ Bases:
object
General base class for seismic sources.
-
attrib
¶ General XML element attributes for a seismic source, as a dict.
-
-
class
openquake.hmtk.models.
SimpleFaultGeometry
(id=None, name=None, wkt=None, dip=None, upper_seismo_depth=None, lower_seismo_depth=None)[source]¶ Bases:
object
Basic object representation of a geometry for a
SimpleFaultSource
.Parameters: - wkt (str) – WKT representing the fault trace of a simple fault (a LINESTRING).
- upper_seismo_depth (float) – Upper seismogenic depth.
- lower_seismo_depth (float) – Lower siesmogenic depth.
-
class
openquake.hmtk.models.
SimpleFaultRuptureModel
(id=None, magnitude=None, rake=None, hypocenter=None, geometry=None)[source]¶ Bases:
object
Basic object representation of a Simple Fault Rupture.
Parameters: - id (str) – Rupture identifier, unique within a given model.
- magnitude (float) – Magnitude.
- rake (float) – Rake angle.
- hypocenter (list) – Floats representing lon, lat and depth.
- geometry –
SimpleFaultGeometry
object.
-
class
openquake.hmtk.models.
SimpleFaultSource
(id=None, name=None, trt=None, geometry=None, mag_scale_rel=None, rupt_aspect_ratio=None, mfd=None, rake=None)[source]¶ Bases:
openquake.hmtk.models.SeismicSource
Basic object representation of a Simple Fault Source.
Parameters: - id (str) – Source identifier, unique within a given model.
- name (str) – Human-readable name for the source.
- trt (str) – Tectonic Region Type.
- geometry –
SimpleFaultGeometry
object. - mag_scale_rel (str) – Magnitude Scaling Relationship.
- rupt_aspect_ratio (float) – Rupture Aspect Ratio.
- mfd – Magnitude Frequency Distribution. An instance of
IncrementalMFD
orTGRMFD
. - rake (float) – Rake angle.
-
class
openquake.hmtk.models.
SiteModel
(vs30=None, vs30_type=None, z1pt0=None, z2pt5=None, wkt=None)[source]¶ Bases:
object
Basic object representation of a single node in a model of site-specific parameters.
Parameters: - vs30 (float) – Average shear wave velocity for top 30 m. Units m/s.
- vs30_type (str) – ‘measured’ or ‘inferred’. Identifies if vs30 value has been measured or inferred.
- z1pt0 (float) – Depth to shear wave velocity of 1.0 km/s. Units m.
- z2pt5 (float) – Depth to shear wave velocity of 2.5 km/s. Units km.
- wkt – Well-known text (POINT) represeting the location of these parameters.
-
class
openquake.hmtk.models.
SourceModel
(name=None, sources=None)[source]¶ Bases:
object
Simple container for source objects, plus metadata.
Parameters: - name (str) – Name of the source model.
- sources – Iterable of seismic source objects (
PointSource
,AreaSource
,SimpleFaultSource
,ComplexFaultSource
).
-
class
openquake.hmtk.models.
TGRMFD
(a_val=None, b_val=None, min_mag=None, max_mag=None)[source]¶ Bases:
object
Basic object representation of a Truncated Gutenberg-Richter Magnitude Frequency Distribution.
Parameters: - a_val (float) – 10 ** a_val is the number of of earthquakes per year with magnitude greater than or equal to 0.
- b_val (float) – Decay rate of the exponential distribution.
- min_mag (float) – The lowest possible magnitude for this MFD.
- max_mag (float) – The highest possible magnitude for this MFD.
-
attrib
¶ An dict of XML element attributes for this MFD.
openquake.hmtk.registry module¶
-
class
openquake.hmtk.registry.
CatalogueFunctionRegistry
[source]¶ Bases:
dict
A collection of methods/functions working on catalogues.
The registry also holds information about the type of the input arguments
-
add
(method_name, completeness=False, **fields)[source]¶ Class decorator.
Decorate method_name by adding a call to set_defaults and check_config. Then, save into the registry a callable function with the same signature of the original method.
Parameters: - method_name (str) – the method to decorate
- completeness (bool) – True if the method accepts in input an optional parameter for the completeness table
- fields – a dictionary of field spec corresponding to the keys expected to be present in the config dictionary for the decorated method, e.g. time_bin=numpy.float, b_value=1E-6
-
add_function
(completeness=False, **fields)[source]¶ Function decorator.
Decorate a function by adding a call to set_defaults and check_config. Then, save into the registry a callable function with the same signature of the original method
Parameters: fields – a dictionary of field spec, e.g. time_bin=numpy.float, b_value=1E-6
-