def test_mutually_exclusive_ruptures(self): # Test the calculation of hazard curves using mutually exclusive # ruptures for a single source gsim_by_trt = [SadighEtAl1997()] rupture = _create_rupture(10., 6.) data = [(rupture, PMF([(0.7, 0), (0.3, 1)])), (rupture, PMF([(0.6, 0), (0.4, 1)]))] print(data[0][0]) data[0][0].weight = 0.5 data[1][0].weight = 0.5 print(data[0][0].weight) src = NonParametricSeismicSource('0', 'test', TRT.ACTIVE_SHALLOW_CRUST, data) src.src_group_id = 0 src.mutex_weight = 1 group = SourceGroup(src.tectonic_region_type, [src], 'test', 'mutex', 'mutex') param = dict(imtls=self.imtls, filter_distance='rjb', src_interdep=group.src_interdep, rup_interdep=group.rup_interdep, grp_probability=group.grp_probability) crv = classical(group, self.sites, gsim_by_trt, param)['pmap'][0] npt.assert_almost_equal(numpy.array([0.35000, 0.32497, 0.10398]), crv[0].array[:, 0], decimal=4)
def test_mutually_exclusive_ruptures(self): # Test the calculation of hazard curves using mutually exclusive # ruptures for a single source gsim_by_trt = [SadighEtAl1997()] rupture = _create_rupture(10., 6.) data = [(rupture, PMF([(0.7, 0), (0.3, 1)])), (rupture, PMF([(0.6, 0), (0.4, 1)]))] data[0][0].weight = 0.5 data[1][0].weight = 0.5 src = NonParametricSeismicSource('0', 'test', "Active Shallow Crust", data) src.id = 0 src.grp_id = 0 src.trt_smr = 0 src.mutex_weight = 1 group = SourceGroup(src.tectonic_region_type, [src], 'test', 'mutex', 'mutex') param = dict(imtls=self.imtls, src_interdep=group.src_interdep, rup_interdep=group.rup_interdep, grp_probability=group.grp_probability) cmaker = ContextMaker(src.tectonic_region_type, gsim_by_trt, param) crv = classical(group, self.sites, cmaker)['pmap'][0] npt.assert_almost_equal(numpy.array([0.35000, 0.32497, 0.10398]), crv.array[:, 0], decimal=4)
def test_mutually_exclusive_ruptures(self): # Test the calculation of hazard curves using mutually exclusive # ruptures for a single source gsim_by_trt = [SadighEtAl1997()] rupture = _create_rupture(10., 6.) data = [(rupture, PMF([(0.7, 0), (0.3, 1)])), (rupture, PMF([(0.6, 0), (0.4, 1)]))] print(data[0][0]) data[0][0].weight = 0.5 data[1][0].weight = 0.5 print(data[0][0].weight) src = NonParametricSeismicSource('0', 'test', TRT.ACTIVE_SHALLOW_CRUST, data) src.src_group_id = 0 src.mutex_weight = 1 group = SourceGroup( src.tectonic_region_type, [src], 'test', 'mutex', 'mutex') param = dict(imtls=self.imtls, filter_distance='rjb', src_interdep=group.src_interdep, rup_interdep=group.rup_interdep, grp_probability=group.grp_probability) crv = classical(group, self.sites, gsim_by_trt, param)['pmap'][0] npt.assert_almost_equal(numpy.array([0.35000, 0.32497, 0.10398]), crv[0].array[:, 0], decimal=4)