def _make_source(self):
     points = [Point(lon, lat, depth) for lon, lat, depth in
               zip(self.CORNER_LONS, self.CORNER_LATS, self.CORNER_DEPTHS)]
     source = CharacteristicFaultSource(
         source_id=self.SOURCE_ID,
         name=self.NAME,
         tectonic_region_type=self.TRT,
         mfd=EvenlyDiscretizedMFD(self.MIN_MAG, self.BIN_WIDTH, self.RATES),
         temporal_occurrence_model=self.TOM,
         surface=PlanarSurface(self.STRIKE, self.DIP,
                               points[0], points[1], points[3], points[2]),
         rake=self.RAKE
     )
     assert_pickleable(source)
     return source
Exemplo n.º 2
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",
    EvenlyDiscretizedMFD(7.0, 0.1, [1.0]),
    PoissonTOM(1.0),
    SIMPLE_FAULT_SURFACE,
    0.0)


class RateGridTestCase(unittest.TestCase):
    """
    General test class for Rate Grid calculation
    """

    def setUp(self):
        """
        Set up limits
        """
        self.limits = [14.9, 15.1, 0.1, 14.9, 15.1, 0.1, 0., 20., 10.]
Exemplo n.º 3
0
 def setUp(self):
     """
     Builds a simple dipping/bending fault source with a characteristic
     source model. Compares the curves for four sites, two on the hanging
     wall and two on the footwall.
     The source model is taken from the PEER Tests
     """
     point_order_dipping_east = [
         Point(-64.78365, -0.45236),
         Point(-64.80164, -0.45236),
         Point(-64.90498, -0.36564),
         Point(-65.0000, -0.16188),
         Point(-65.0000, 0.0000)
     ]
     trace_dip_east = Line(point_order_dipping_east)
     site_1 = Site(Point(-64.98651, -0.15738), 760.0, True, 48.0, 0.607)
     site_2 = Site(Point(-64.77466, -0.45686), 760.0, True, 48.0, 0.607)
     site_3 = Site(Point(-64.92747, -0.38363), 760.0, True, 48.0, 0.607)
     site_4 = Site(Point(-65.05396, -0.17088), 760.0, True, 48.0, 0.607)
     self.sites = SiteCollection([site_1, site_2, site_3, site_4])
     self.imtls = {
         "PGA": [
             0.001, 0.01, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
             0.5, 0.55, 0.6, 0.7, 0.8, 0.9, 1.0
         ]
     }
     fault_surface1 = SimpleFaultSurface.from_fault_data(
         trace_dip_east, 0.0, 12.0, 60., 0.5)
     mfd1 = EvenlyDiscretizedMFD(6.75, 0.01, [0.01])
     tom = PoissonTOM(1.0)
     self.sources = [
         CharacteristicFaultSource(
             "PEER_CHAR_FLT_EAST",
             "Peer Bending Fault Dipping East - Characteristic",
             "Active Shallow Crust", mfd1, tom, fault_surface1, 90.0)
     ]
     # We will check all the GMPEs
     self.gsim_set = {
         "ASK": [
             AbrahamsonEtAl2014NSHMPMean(),
             (0.185, AbrahamsonEtAl2014NSHMPLower()),
             (0.63, AbrahamsonEtAl2014()),
             (0.185, AbrahamsonEtAl2014NSHMPUpper())
         ],
         "BSSA": [
             BooreEtAl2014NSHMPMean(), (0.185, BooreEtAl2014NSHMPLower()),
             (0.63, BooreEtAl2014()), (0.185, BooreEtAl2014NSHMPUpper())
         ],
         "CB": [
             CampbellBozorgnia2014NSHMPMean(),
             (0.185, CampbellBozorgnia2014NSHMPLower()),
             (0.63, CampbellBozorgnia2014()),
             (0.185, CampbellBozorgnia2014NSHMPUpper())
         ],
         "CY": [
             ChiouYoungs2014NSHMPMean(),
             (0.185, ChiouYoungs2014NSHMPLower()),
             (0.63, ChiouYoungs2014()), (0.185, ChiouYoungs2014NSHMPUpper())
         ],
         "ID": [
             Idriss2014NSHMPMean(), (0.185, Idriss2014NSHMPLower()),
             (0.63, Idriss2014()), (0.185, Idriss2014NSHMPUpper())
         ]
     }