Пример #1
0
    def _make_source(self, mfd, aspect_ratio, fault_trace, dip):
        sf = super(ComplexFaultSourceRupEnclPolyTestCase,
                   self)._make_source(mfd, aspect_ratio, fault_trace, dip)
        # create an equivalent top and bottom edges
        vdist_top = sf.upper_seismogenic_depth
        vdist_bottom = sf.lower_seismogenic_depth

        hdist_top = vdist_top / numpy.tan(numpy.radians(dip))
        hdist_bottom = vdist_bottom / numpy.tan(numpy.radians(dip))

        strike = fault_trace[0].azimuth(fault_trace[-1])
        azimuth = (strike + 90.0) % 360

        top_edge = []
        bottom_edge = []
        for point in fault_trace.points:
            top_edge.append(point.point_at(hdist_top, vdist_top, azimuth))
            bottom_edge.append(
                point.point_at(hdist_bottom, vdist_bottom, azimuth))
        edges = [Line(top_edge), Line(bottom_edge)]

        return ComplexFaultSource(sf.source_id, sf.name,
                                  sf.tectonic_region_type, sf.mfd,
                                  sf.rupture_mesh_spacing,
                                  sf.magnitude_scaling_relationship,
                                  sf.rupture_aspect_ratio,
                                  sf.temporal_occurrence_model, edges, sf.rake)
Пример #2
0
 def _make_source(self, edges):
     source_id = name = 'test-source'
     trt = "Subduction Interface"
     tom = PoissonTOM(50.0)
     magnitude_scaling_relationship = PeerMSR()
     cfs = ComplexFaultSource(source_id, name, trt, self.mfd, self.spacing,
                              magnitude_scaling_relationship, self.aspect,
                              tom, edges, self.rake)
     return cfs
Пример #3
0
 def create_oqhazardlib_source(self, tom, mesh_spacing, use_defaults=False):
     """
     Creates an instance of the source model as :class:
     openquake.hazardlib.source.complex_fault.ComplexFaultSource
     """
     if not self.mfd:
         raise ValueError("Cannot write to hazardlib without MFD")
     return ComplexFaultSource(
         self.id, self.name, self.trt, self.mfd, mesh_spacing,
         conv.mag_scale_rel_to_hazardlib(self.mag_scale_rel, use_defaults),
         conv.render_aspect_ratio(self.rupt_aspect_ratio, use_defaults),
         tom, self.fault_edges, self.rake)
Пример #4
0
 def _make_source(self, mfd, aspect_ratio, rupture_mesh_spacing, edges):
     source_id = name = 'test-source'
     trt = self.TRT
     rake = self.RAKE
     magnitude_scaling_relationship = PeerMSR()
     rupture_aspect_ratio = aspect_ratio
     edges = [Line([Point(*coords) for coords in edge]) for edge in edges]
     cfs = ComplexFaultSource(source_id, name, trt, mfd,
                              rupture_mesh_spacing,
                              magnitude_scaling_relationship,
                              rupture_aspect_ratio, edges, rake)
     assert_pickleable(cfs)
     return cfs
Пример #5
0
 def create_oqhazardlib_source(self, tom, mesh_spacing, use_defaults=False):
     """
     Creates an instance of the source model as :class:
     openquake.hazardlib.source.complex_fault.ComplexFaultSource
     """
     return ComplexFaultSource(
         self.id,
         self.name,
         self.trt,
         conv.mfd_to_hazardlib(self.mfd),
         mesh_spacing,
         conv.mag_scale_rel_to_hazardlib(self.mag_scale_rel, use_defaults),
         conv.render_aspect_ratio(self.rupt_aspect_ratio, use_defaults),
         tom,
         self.fault_edges,
         self.rake)
Пример #6
0
    def _make_source(self, *args, **kwargs):
        source = super()._make_source(*args, **kwargs)
        surface = SimpleFaultSurface.from_fault_data(
            source.fault_trace, source.upper_seismogenic_depth,
            source.lower_seismogenic_depth, source.dip,
            source.rupture_mesh_spacing)
        mesh = surface.mesh
        top_edge = Line(list(mesh[0:1]))
        bottom_edge = Line(list(mesh[-1:]))

        cfs = ComplexFaultSource(source.source_id, source.name,
                                 source.tectonic_region_type, source.mfd,
                                 source.rupture_mesh_spacing,
                                 source.magnitude_scaling_relationship,
                                 source.rupture_aspect_ratio,
                                 source.temporal_occurrence_model,
                                 [top_edge, bottom_edge], source.rake)
        assert_pickleable(cfs)
        return cfs
Пример #7
0
                                 PoissonTOM(1.0),
                                 0.0,
                                 20.0,
                                 SIMPLE_TRACE,
                                 90.,
                                 0.0)

COMPLEX_EDGES = [SIMPLE_TRACE,
                 Line([Point(14.975, 15.0, 20.0),
                       Point(15.025, 15.0, 20.0)])]

COMPLEX_FAULT = ComplexFaultSource("CFLT000", "Complex Fault Source",
                                   "Active Shallow Crust",
                                   EvenlyDiscretizedMFD(7.0, 0.1, [1.0]),
                                   1.0,
                                   PeerMSR(),
                                   1.0,
                                   PoissonTOM(1.0),
                                   COMPLEX_EDGES,
                                   0.0)

SIMPLE_FAULT_SURFACE = SimpleFaultSurface.from_fault_data(SIMPLE_TRACE,
                                                          0.0,
                                                          20.0,
                                                          90.0,
                                                          1.0)

CHARACTERISTIC_FAULT = CharacteristicFaultSource(
    "CHRFLT000",
    "Characteristic 000",
    "Active Shallow Crust",