Пример #1
0
    def iter_ruptures(self):
        """
        See :meth:
        `openquake.hazardlib.source.base.BaseSeismicSource.iter_ruptures`.

        Uses :func:`_float_ruptures` for finding possible rupture locations
        on the whole fault surface.
        """
        whole_fault_surface = ComplexFaultSurface.from_fault_data(
            self.edges, self.rupture_mesh_spacing)
        whole_fault_mesh = whole_fault_surface.mesh
        cell_center, cell_length, cell_width, cell_area = (
            whole_fault_mesh.get_cell_dimensions())

        for mag, mag_occ_rate in self.get_annual_occurrence_rates():
            rupture_area = self.magnitude_scaling_relationship.get_median_area(
                mag, self.rake)
            rupture_length = numpy.sqrt(
                rupture_area * self.rupture_aspect_ratio)
            rupture_slices = _float_ruptures(
                rupture_area, rupture_length, cell_area, cell_length)
            occurrence_rate = mag_occ_rate / float(len(rupture_slices))
            for rupture_slice in rupture_slices[self.start:self.stop]:
                mesh = whole_fault_mesh[rupture_slice]
                # XXX: use surface centroid as rupture's hypocenter
                # XXX: instead of point with middle index
                hypocenter = mesh.get_middle_point()
                try:
                    surface = ComplexFaultSurface(mesh)
                except ValueError as e:
                    raise ValueError("Invalid source with id=%s. %s" % (
                        self.source_id, str(e)))
                yield ParametricProbabilisticRupture(
                    mag, self.rake, self.tectonic_region_type, hypocenter,
                    surface, occurrence_rate, self.temporal_occurrence_model)
Пример #2
0
 def __init__(self, id, trt, mag=5.0, rake=90.):
     hypocenter = Point(17.788328, -77.219496, 7.8125)
     lons = numpy.array(
         [-78.18106621, -78.18013243, -78.17919864, -78.15399318,
          -78.15305962, -78.15212606])
     lats = numpy.array(
         [15.615, 15.615, 15.615, 15.56553731,
          15.56553731,  15.56553731])
     surface = ComplexFaultSurface(Mesh(lons, lats, None))
     self.rupture = Rupture(mag, rake, trt, hypocenter,
                            surface, ComplexFaultSource)
     self.id = id
Пример #3
0
 def __init__(self, id, trt, mag=5.0, rake=90.):
     self.hypocenter = Point(17.788328, -77.219496, 7.8125)
     lons = numpy.array(
         [-78.18106621, -78.18013243, -78.17919864, -78.15399318,
          -78.15305962, -78.15212606])
     lats = numpy.array(
         [15.615, 15.615, 15.615, 15.56553731,
          15.56553731,  15.56553731])
     self.surface = ComplexFaultSurface(Mesh(lons, lats, None))
     self.mag = mag
     self.rake = rake
     self.id = id
     self.site_indices = None