openquake.hmtk.parsers.source_model package

Submodules

openquake.hmtk.parsers.source_model.base module

Module openquake.hmtk.parsers.source_model.base defines an abstract base class for SourceModelParser.

class openquake.hmtk.parsers.source_model.base.BaseSourceModelParser(input_file)[source]

Bases: object

A base class for a Source Model Parser

abstract read_file(identifier, mfd_spacing=0.1, simple_mesh_spacing=1.0, complex_mesh_spacing=4.0, area_discretization=10.0)[source]

Return an instance of the class mtkSourceModel

openquake.hmtk.parsers.source_model.nrml04_parser module

Parser for input in a NRML format, with partial validation

openquake.hmtk.parsers.source_model.nrml04_parser.float_(value)[source]

Returns float of a value, or None

openquake.hmtk.parsers.source_model.nrml04_parser.get_taglist(node)[source]

Return a list of tags (with NRML namespace removed) representing the order of the nodes within a node

openquake.hmtk.parsers.source_model.nrml04_parser.int_(value)[source]

Returns int or None

openquake.hmtk.parsers.source_model.nrml04_parser.linestring_node_to_line(node, with_depth=False)[source]

Returns an instance of a Linestring node to :class: openquake.hazardlib.geo.line.Line

openquake.hmtk.parsers.source_model.nrml04_parser.node_to_area_geometry(node)[source]

Reads an area geometry node and returns the polygon, upper depth and lower depth

openquake.hmtk.parsers.source_model.nrml04_parser.node_to_complex_fault_geometry(node)[source]

Reads a complex fault geometry node and returns an

openquake.hmtk.parsers.source_model.nrml04_parser.node_to_evenly_discretized(node)[source]

Parses the evenly discretized mfd node to an instance of the :class: openquake.hazardlib.mfd.evenly_discretized.EvenlyDiscretizedMFD, or to None if not all parameters are available

openquake.hmtk.parsers.source_model.nrml04_parser.node_to_hdd(node)[source]

Parses the node to a hpyocentral depth distribution PMF

openquake.hmtk.parsers.source_model.nrml04_parser.node_to_mfd(node, taglist)[source]

Reads the node to return a magnitude frequency distribution

openquake.hmtk.parsers.source_model.nrml04_parser.node_to_nodal_planes(node)[source]

Parses the nodal plane distribution to a PMF

openquake.hmtk.parsers.source_model.nrml04_parser.node_to_point_geometry(node)[source]

Reads the node and returns the point geometry, upper depth and lower depth

openquake.hmtk.parsers.source_model.nrml04_parser.node_to_scalerel(node)[source]

Parses a node to an instance of a supported scaling relation class

openquake.hmtk.parsers.source_model.nrml04_parser.node_to_simple_fault_geometry(node)[source]

Reads a simple fault geometry node and returns an OpenQuake representation

Returns

trace - Trace of fault as instance

openquake.hmtk.parsers.source_model.nrml04_parser.node_to_truncated_gr(node, bin_width=0.1)[source]

Parses truncated GR node to an instance of the :class: openquake.hazardlib.mfd.truncated_gr.TruncatedGRMFD

class openquake.hmtk.parsers.source_model.nrml04_parser.nrmlSourceModelParser(input_file)[source]

Bases: openquake.hmtk.parsers.source_model.base.BaseSourceModelParser

Parser for a source model in NRML format, permitting partial validation such that not all fields need to be specified for the file to be parsed

read_file(identifier, mfd_spacing=0.1, simple_mesh_spacing=1.0, complex_mesh_spacing=4.0, area_discretization=10.0)[source]

Reads in the source model in returns an instance of the :class: openquake.hmtk.sourcs.source_model.mtkSourceModel

openquake.hmtk.parsers.source_model.nrml04_parser.parse_area_source_node(node, mfd_spacing=0.1)[source]

Returns an “areaSource” node into an instance of the :class: openquake.hmtk.sources.area.mtkAreaSource

openquake.hmtk.parsers.source_model.nrml04_parser.parse_complex_fault_node(node, mfd_spacing=0.1, mesh_spacing=4.0)[source]

Parses a “complexFaultSource” node and returns an instance of the :class: openquake.hmtk.sources.complex_fault.mtkComplexFaultSource

openquake.hmtk.parsers.source_model.nrml04_parser.parse_point_source_node(node, mfd_spacing=0.1)[source]

Returns an “areaSource” node into an instance of the :class: openquake.hmtk.sources.area.mtkAreaSource

openquake.hmtk.parsers.source_model.nrml04_parser.parse_simple_fault_node(node, mfd_spacing=0.1, mesh_spacing=1.0)[source]

Parses a “simpleFaultSource” node and returns an instance of the :class: openquake.hmtk.sources.simple_fault.mtkSimpleFaultSource

openquake.hmtk.parsers.source_model.nrml04_parser.string_(string)[source]

Returns string or None

Module contents

Package openquake.hmtk.parsers.source_model contains base classes and implementations of source model parsers.