openquake.hmtk package#
Subpackages#
- openquake.hmtk.comparison package
- openquake.hmtk.faults package- Subpackages- openquake.hmtk.faults.mfd package- Submodules
- openquake.hmtk.faults.mfd.anderson_luco_arbitrary module
- openquake.hmtk.faults.mfd.anderson_luco_area_mmax module
- openquake.hmtk.faults.mfd.base module
- openquake.hmtk.faults.mfd.characteristic module
- openquake.hmtk.faults.mfd.youngs_coppersmith module
- Module contents
 
 
- openquake.hmtk.faults.mfd package
- Submodules
- openquake.hmtk.faults.active_fault_model module
- openquake.hmtk.faults.fault_geometries module
- openquake.hmtk.faults.fault_models module
- openquake.hmtk.faults.tectonic_regionalisation module
- Module contents
 
- Subpackages
- openquake.hmtk.parsers package- Subpackages- openquake.hmtk.parsers.catalogue package
- openquake.hmtk.parsers.faults package
- openquake.hmtk.parsers.source_model package- Submodules
- openquake.hmtk.parsers.source_model.base module
- openquake.hmtk.parsers.source_model.nrml04_parser module- float_()
- get_taglist()
- int_()
- linestring_node_to_line()
- node_to_area_geometry()
- node_to_complex_fault_geometry()
- node_to_evenly_discretized()
- node_to_hdd()
- node_to_mfd()
- node_to_nodal_planes()
- node_to_point_geometry()
- node_to_scalerel()
- node_to_simple_fault_geometry()
- node_to_truncated_gr()
- nrmlSourceModelParser
- parse_area_source_node()
- parse_complex_fault_node()
- parse_point_source_node()
- parse_simple_fault_node()
- string_()
 
- Module contents
 
- openquake.hmtk.parsers.strain package
 
- Module contents
 
- Subpackages
- 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.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- Catalogue- Catalogue.FLOAT_ATTRIBUTE_LIST
- Catalogue.INT_ATTRIBUTE_LIST
- Catalogue.SORTED_ATTRIBUTE_LIST
- Catalogue.STRING_ATTRIBUTE_LIST
- Catalogue.TOTAL_ATTRIBUTE_LIST
- Catalogue.add_event()
- Catalogue.catalogue_mt_filter()
- Catalogue.concatenate()
- Catalogue.get_bounding_box()
- Catalogue.get_decimal_time()
- Catalogue.get_depth_distribution()
- Catalogue.get_depth_pmf()
- Catalogue.get_magnitude_depth_distribution()
- Catalogue.get_magnitude_time_distribution()
- Catalogue.get_number_events()
- Catalogue.get_observed_mmax_sigma()
- Catalogue.hypocentres_as_mesh()
- Catalogue.hypocentres_to_cartesian()
- Catalogue.load_from_array()
- Catalogue.load_to_array()
- Catalogue.make_from_dict()
- Catalogue.purge_catalogue()
- Catalogue.select_catalogue_events()
- Catalogue.sort_catalogue_chronologically()
- Catalogue.update_end_year()
- Catalogue.update_start_year()
- Catalogue.write_catalogue()
 
 
- openquake.hmtk.seismicity.gcmt_catalogue module
- openquake.hmtk.seismicity.gcmt_utils module
- openquake.hmtk.seismicity.selector module- CatalogueSelector- CatalogueSelector.cartesian_square_centred_on_point()
- CatalogueSelector.circular_distance_from_point()
- CatalogueSelector.create_cluster_set()
- CatalogueSelector.select_catalogue()
- CatalogueSelector.within_bounding_box()
- CatalogueSelector.within_depth_range()
- CatalogueSelector.within_joyner_boore_distance()
- CatalogueSelector.within_magnitude_range()
- CatalogueSelector.within_polygon()
- CatalogueSelector.within_rupture_distance()
- CatalogueSelector.within_time_period()
 
 
- 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: - 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: - 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 – - AreaGeometryinstance.
- mag_scale_rel (str) – Magnitude Scaling Relationship. 
- rupt_aspect_ratio (float) – Rupture Aspect Ratio. 
- mfd – Magnitude Frequency Distribution. An instance of - IncrementalMFDor- TGRMFD.
- nodal_plane_dist (list) – list of - NodalPlaneobjects which make up a Nodal Plane Distribution.
- hypo_depth_dist (list) – list of - HypocentralDepthinstances 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: - 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 - IncrementalMFDor- TGRMFD.
- rake (float) – Rake angle. 
- surface – A - SimpleFaultGeometry,- ComplexFaultGeometry, or a list of- PlanarSurfaceobjects.
 
 
- 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: - 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 – - ComplexFaultGeometryobject.
 
 
- 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: - 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 – - ComplexFaultGeometryobject.
- mag_scale_rel (str) – Magnitude Scaling Relationship. 
- rupt_aspect_ratio (float) – Rupture Aspect Ratio. 
- mfd – Magnitude Frequency Distribution. An instance of - IncrementalMFDor- TGRMFD.
- 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). 
 
 - property 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). 
 
 - property 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. 
 
 - property 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 - Pointobjects.
 
 
- 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: - 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 – - PointGeometryinstance.
- mag_scale_rel (str) – Magnitude Scaling Relationship. 
- rupt_aspect_ratio (float) – Rupture Aspect Ratio. 
- mfd – Magnitude Frequency Distribution. An instance of - IncrementalMFDor- TGRMFD.
- nodal_plane_dist (list) – list of - NodalPlaneobjects which make up a Nodal Plane Distribution.
- hypo_depth_dist (list) – list of - HypocentralDepthinstances 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. - property 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 – - SimpleFaultGeometryobject.
 
 
- 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: - 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 – - SimpleFaultGeometryobject.
- mag_scale_rel (str) – Magnitude Scaling Relationship. 
- rupt_aspect_ratio (float) – Rupture Aspect Ratio. 
- mfd – Magnitude Frequency Distribution. An instance of - IncrementalMFDor- TGRMFD.
- 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. 
 
 - property 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=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=float, b_value=1E-6 
 
 
