def test_gmfs(self): f1 = os.path.join(CDIR, 'ghorka_grid.xml') f2 = os.path.join(CDIR, 'ghorka_uncertainty.xml') array = get_shakemap_array(f1, f2) sitecol, shakemap = get_sitecol_shakemap(array, imt_dt.names) n = 4 # number of sites self.assertEqual(len(sitecol), n) gmf_by_imt = mean_gmf(shakemap) aae(gmf_by_imt, [0.0058806, 0.0230781, 0.0432714, 0.0219532])
def test_gmfs(self): f1 = os.path.join(CDIR, 'ghorka_grid.xml') f2 = os.path.join(CDIR, 'ghorka_uncertainty.xml') array = get_shakemap_array(f1, f2) sitecol, shakemap = get_sitecol_shakemap(array, imt_dt.names) n = 4 # number of sites self.assertEqual(len(sitecol), n) gmf_by_imt = mean_gmf(shakemap) aae(gmf_by_imt, [0.0047045, 0.0184625, 0.0346171, 0.0175625])
def test_gmfs(self): f1 = os.path.join(CDIR, 'ghorka_grid.xml') f2 = os.path.join(CDIR, 'ghorka_uncertainty.xml') array = get_shakemap_array(f1, f2) sitecol, shakemap = get_sitecol_shakemap(array, imt_dt.names) n = 4 # number of sites self.assertEqual(len(sitecol), n) gmf_by_imt = mean_gmf(shakemap) aae(gmf_by_imt, [0.0058806, 0.0230781, 0.0432714, 0.0219532])
def test_gmfs(self): f1 = os.path.join(CDIR, 'ghorka_grid.xml') f2 = os.path.join(CDIR, 'ghorka_uncertainty.xml') array = get_shakemap_array(f1, f2) sitecol, shakemap = get_sitecol_shakemap(array, imt_dt.names) n = 4 # number of sites self.assertEqual(len(sitecol), n) gmf_by_imt, _ = mean_std(shakemap, site_effects=True) aae(gmf_by_imt, [[0.005391, 0.0223217, 0.0399937, 0.0183143], [0.0061, 0.025619, 0.0487997, 0.0225788], [0.0060717, 0.0253156, 0.0478506, 0.0219296], [0.007087, 0.0298716, 0.0622145, 0.0290721]])
def test_gmfs(self): f1 = os.path.join(CDIR, 'ghorka_grid.xml') f2 = os.path.join(CDIR, 'ghorka_uncertainty.xml') array = get_shakemap_array(f1, f2) sitecol, shakemap = get_sitecol_shakemap(array, imt_dt.names) n = 4 # number of sites self.assertEqual(len(sitecol), n) gmf_by_imt, _ = mean_std(shakemap, site_effects=True) aae(gmf_by_imt, [[0.0062040, 0.0262588, 0.0497097, 0.0239060], [0.0069831, 0.0298023, 0.0602146, 0.0294691], [0.0069507, 0.0296108, 0.0594237, 0.0286251], [0.0080306, 0.0341960, 0.0762080, 0.0379360]])
def test_from_files(self): # files provided by Vitor Silva, without site amplification f1 = os.path.join(CDIR, 'test_shaking.xml') f2 = os.path.join(CDIR, 'test_uncertainty.xml') array = get_shakemap_array(f1, f2) sitecol, shakemap = get_sitecol_shakemap(array, imt_dt.names) n = 4 # number of sites self.assertEqual(len(sitecol), n) gmf_by_imt, std_by_imt = mean_std(shakemap, site_effects=False) # PGA, SA(0.3), SA(1.0), SA(3.0) aae(gmf_by_imt, [[0.0975815, 0.2442196, 0.0286512, 0.6358019], [0.2023841, 0.5013746, 0.0297236, 0.6544367], [0.3010831, 0.5986038, 0.0305651, 0.6575208], [0.3868380, 0.9331248, 0.0296789, 0.6393688]]) aae(std_by_imt, [[0.5922380, 0.6723980, 0.6325073, 0.6445988], [0.6077153, 0.6661571, 0.6296381, 0.668559], [0.6146356, 0.6748830, 0.6714424, 0.6613612], [0.5815353, 0.6460007, 0.6491335, 0.6603457]])
def test_from_files(self): # files provided by Vitor Silva, without site amplification f1 = os.path.join(CDIR, 'test_shaking.xml') f2 = os.path.join(CDIR, 'test_uncertainty.xml') array = get_shakemap_array(f1, f2) sitecol, shakemap = get_sitecol_shakemap(array, imt_dt.names) n = 4 # number of sites self.assertEqual(len(sitecol), n) gmf_by_imt, std_by_imt = mean_std(shakemap, site_effects=False) # PGA, SA(0.3), SA(1.0), SA(3.0) aae(gmf_by_imt, [[0.1168263, 0.3056736, 0.0356231, 0.7957914], [0.2422977, 0.6275377, 0.0369565, 0.8191154], [0.3604619, 0.7492331, 0.0380028, 0.8229756], [0.4631292, 1.1679310, 0.0369009, 0.8002559]]) aae(std_by_imt, [[0.5922380, 0.6723980, 0.6325073, 0.6445988], [0.6077153, 0.6661571, 0.6296381, 0.668559], [0.6146356, 0.6748830, 0.6714424, 0.6613612], [0.5815353, 0.6460007, 0.6491335, 0.6603457]])