def test_fromTrace(): xp0 = [0.0] xp1 = [0.0] yp0 = [0.0] yp1 = [0.05] zp = [0.0] widths = [10.0] dips = [45.0] fault = Fault.fromTrace(xp0, yp0, xp1, yp1, zp, widths, dips, reference='From J Smith, (personal communication)') fstr = io.StringIO() fault.writeFaultFile(fstr) xp0 = [-121.81529, -121.82298] xp1 = [-121.82298, -121.83068] yp0 = [37.73707, 37.74233] yp1 = [37.74233, 37.74758] zp = [10, 15] widths = [15.0, 20.0] dips = [30.0, 45.0] fault = Fault.fromTrace(xp0, yp0, xp1, yp1, zp, widths, dips, reference='From J Smith, (personal communication)')
def test_misc(): # Make a fault lat0 = np.array([34.1]) lon0 = np.array([-118.2]) lat1 = np.array([34.2]) lon1 = np.array([-118.15]) z = np.array([1.0]) W = np.array([3.0]) dip = np.array([30.]) flt = Fault.fromTrace(lon0, lat0, lon1, lat1, z, W, dip) fm = flt.getFaultAsMesh() fa = flt.getFaultAsArrays() ref = flt.getReference()
def test_misc(): # Make a fault lat0 = np.array([34.1]) lon0 = np.array([-118.2]) lat1 = np.array([34.2]) lon1 = np.array([-118.15]) z = np.array([1.0]) W = np.array([3.0]) dip = np.array([30.]) flt = Fault.fromTrace(lon0, lat0, lon1, lat1, z, W, dip) fm = flt.getFaultAsMesh() fa = flt.getFaultAsArrays() ref = flt.getReference()
def test_fromTrace(): xp0 = [0.0] xp1 = [0.0] yp0 = [0.0] yp1 = [0.05] zp = [0.0] widths = [10.0] dips = [45.0] fault = Fault.fromTrace(xp0, yp0, xp1, yp1, zp, widths, dips, reference='From J Smith, (personal communication)') fstr = io.StringIO() fault.writeFaultFile(fstr) xp0 = [-121.81529, -121.82298] xp1 = [-121.82298, -121.83068] yp0 = [37.73707, 37.74233] yp1 = [37.74233, 37.74758] zp = [10, 15] widths = [15.0, 20.0] dips = [30.0, 45.0] fault = Fault.fromTrace(xp0, yp0, xp1, yp1, zp, widths, dips, reference='From J Smith, (personal communication)')
def main(pargs): nargin = len(pargs.coords) if nargin < 6: print 'You must specify at least two top edge points each with (x y z) coordinates.' sys.exit(1) if (nargin % 3) != 0: print 'Each point must have 3 coordinates (x y z) per top edge point.' sys.exit(1) npoints = nargin/3 nquads = ((npoints*2 - 4)/2) + 1 if pargs.widths is None or len(pargs.widths) != nquads: print 'You must specify %i widths' % nquads sys.exit(1) if pargs.dips is not None and pargs.depths is not None: print 'You must specify %i depths or %i dips, not both.' % (nquads,nquads) sys.exit(1) x = np.array(pargs.coords[1::3]) y = np.array(pargs.coords[0::3]) z = np.array(pargs.coords[2::3]) fault = Fault.fromTrace(x,y,z,pargs.widths,pargs.dips) if pargs.plotfile: fig = plt.figure() ax0 = fig.add_subplot(2,1,1) ax1 = fig.add_subplot(2,1,2, projection='3d') for quad in fault.getQuadrilaterals(): P0,P1,P2,P3 = quad xp = np.array([P0.longitude,P1.longitude,P2.longitude,P3.longitude,P0.longitude]) yp = np.array([P0.latitude,P1.latitude,P2.latitude,P3.latitude,P0.latitude]) zp = np.array([-P0.depth,-P1.depth,-P2.depth,-P3.depth,-P0.depth]) ax0.plot(xp,yp) ax0.set_xlabel('Longitude') ax0.set_xlabel('Latitude') ax1.plot(xp,yp,zp) ax1.set_xlabel('Longitude') ax1.set_xlabel('Latitude') ax1.set_zlabel('Depth') ax0.axis('equal') ax1.axis('equal') plt.savefig(pargs.plotfile) if pargs.outfile: fault.writeFaultFile(pargs.outfile)
def test_slip(): # Make a fault lat0 = np.array([34.1]) lon0 = np.array([-118.2]) lat1 = np.array([34.2]) lon1 = np.array([-118.15]) z = np.array([1.0]) W = np.array([3.0]) dip = np.array([30.]) flt = Fault.fromTrace(lon0, lat0, lon1, lat1, z, W, dip) slp = get_quad_slip(flt.getQuadrilaterals()[0], 30).getArray() slpd = np.array([0.80816457, 0.25350787, 0.53160491]) np.testing.assert_allclose(slp, slpd) slp = get_local_unit_slip_vector(22, 30, 86).getArray() slpd = np.array([0.82714003, 0.38830563, 0.49878203]) np.testing.assert_allclose(slp, slpd)
def test_slip(): # Make a fault lat0 = np.array([34.1]) lon0 = np.array([-118.2]) lat1 = np.array([34.2]) lon1 = np.array([-118.15]) z = np.array([1.0]) W = np.array([3.0]) dip = np.array([30.]) flt = Fault.fromTrace(lon0, lat0, lon1, lat1, z, W, dip) slp = get_quad_slip(flt.getQuadrilaterals()[0], 30).getArray() slpd = np.array([0.80816457, 0.25350787, 0.53160491]) np.testing.assert_allclose(slp, slpd) slp = get_local_unit_slip_vector(22, 30, 86).getArray() slpd = np.array([0.82714003, 0.38830563, 0.49878203]) np.testing.assert_allclose(slp, slpd)
def test_exceptions(): vs30file = os.path.join(shakedir, 'tests/data/Vs30_test.grd') cx = -118.2 cy = 34.1 dx = 0.0083 dy = 0.0083 xspan = 0.0083 * 5 yspan = 0.0083 * 5 site = Sites.fromCenter(cx, cy, xspan, yspan, dx, dy, vs30File=vs30file, padding=True, resample=False) # Make souce instance lat0 = np.array([34.1]) lon0 = np.array([-118.2]) lat1 = np.array([34.2]) lon1 = np.array([-118.15]) z = np.array([1.0]) W = np.array([3.0]) dip = np.array([30.]) flt = Fault.fromTrace(lon0, lat0, lon1, lat1, z, W, dip) event = {'lat': 34.1, 'lon': -118.2, 'depth': 1, 'mag': 6, 'id': '', 'locstring': '', 'type': 'U', 'mech':'RS', 'rake':90, 'time': ShakeDateTime.utcfromtimestamp(int(time.time())), 'timezone': 'UTC'} source = Source(event, flt) gmpelist = ["Primate"] with pytest.raises(Exception) as e: dists = Distance.fromSites(gmpelist, source, site) gmpelist = [AbrahamsonEtAl2014()] sctx = site.getSitesContext() dist_types = ['repi', 'rhypo', 'rjb', 'rrup', 'rx', 'ry', 'ry0', 'U', 'V'] with pytest.raises(Exception) as e: dists = get_distance(dist_types, sctx.lats, sctx.lons, np.zeros_like(sctx.lons), source) dist_types = ['repi', 'rhypo', 'rjb', 'rrup', 'rx', 'ry', 'ry0', 'U', 'T'] with pytest.raises(Exception) as e: dists = get_distance(dist_types, sctx.lats, sctx.lons[0:4,], np.zeros_like(sctx.lons), source)
def test_multigmpe(): # Define gmpes and their weights gmpes = [AbrahamsonEtAl2014(), BooreEtAl2014(), CampbellBozorgnia2014(), ChiouYoungs2014()] wts = [0.25, 0.25, 0.25, 0.25] # Make sites instance vs30file = os.path.join(shakedir, 'tests/data/Vs30_test.grd') cx = -118.2 cy = 34.1 dx = 0.0083 dy = 0.0083 xspan = 0.0083 * 5 yspan = 0.0083 * 5 site = Sites.createFromCenter(cx, cy, xspan, yspan, dx, dy, vs30File=vs30file, padding=True, resample=False) sctx = site.getSitesContext() sctx.vs30 = np.reshape(sctx.vs30, (-1,)) sctx.vs30measured = np.reshape(sctx.vs30measured, (-1,)) sctx.z1pt0 = np.reshape(sctx.z1pt0, (-1,)) # Need separate z1pt0 arrays sctx.z1pt0cy14 = mg._z1_from_vs30_cy14_cal(sctx.vs30) sctx.z1pt0ask14 = mg._z1_from_vs30_ask14_cal(sctx.vs30) sctx.z2pt5 = mg._z2p5_from_vs30_cb14_cal(sctx.vs30) / 1000.0 # Make souce instance lat0 = np.array([34.1]) lon0 = np.array([-118.2]) lat1 = np.array([34.2]) lon1 = np.array([-118.15]) z = np.array([1.0]) W = np.array([3.0]) dip = np.array([30.]) flt = Fault.fromTrace(lon0, lat0, lon1, lat1, z, W, dip) event = {'lat': 34.1, 'lon': -118.2, 'depth': 1, 'mag': 6, 'id': '', 'locstring': '', 'rake': 30.3, 'time': ShakeDateTime.utcfromtimestamp(int(time.time())), 'timezone': 'UTC'} source = Source(event, flt) # Make a rupture context rupt = source.getRuptureContext(gmpes) # Make a distance context dctx = Distance.fromSites(gmpes, source, site).getDistanceContext() dctx.rhypo = np.reshape(dctx.rhypo, (-1,)) dctx.rx = np.reshape(dctx.rx, (-1,)) dctx.rjb = np.reshape(dctx.rjb, (-1,)) dctx.ry0 = np.reshape(dctx.ry0, (-1,)) dctx.rrup = np.reshape(dctx.rrup, (-1,)) # Compute weighted GMPE iimt = imt.PGV() stddev_types = [const.StdDev.TOTAL] mgmpe = mg.MultiGMPE.from_list(gmpes, wts) lnmu, lnsd = mgmpe.get_mean_and_stddevs( sctx, rupt, dctx, iimt, stddev_types) lnmud = np.array( [3.44828531, 3.49829605, 3.61749432, 3.64343805, 3.7001028, 3.7348924, 3.76927164, 3.78659955, 3.82600784, 3.46635007, 3.53816879, 3.6486898, 3.67058155, 3.72223342, 3.75403094, 3.79315031, 3.79871491, 3.82093027, 3.54889613, 3.57531437, 3.64441687, 3.69915981, 3.74491289, 3.78931599, 3.80957828, 3.80870754, 3.8731021, 3.5927326, 3.60764647, 3.66894024, 3.72148551, 3.75742965, 3.82164661, 3.86341308, 3.87171115, 3.79092594, 3.64153758, 3.61835381, 3.68166249, 3.7338161, 3.82454214, 3.81543928, 3.81507658, 3.80006803, 3.77165695, 3.65178742, 3.71324776, 3.70389969, 3.77034752, 3.78259432, 3.78677497, 3.79838465, 3.79050287, 3.75066018, 3.52883328, 3.67813977, 3.71754876, 3.65520574, 3.69463436, 3.72516445, 3.7457098, 3.74672185, 3.72615784, 3.44535551, 3.61907294, 3.58790363, 3.58068716, 3.61177983, 3.64349327, 3.66698468, 3.67129902, 3.65483002] ) lnsdd = np.array( [ 0.63560302, 0.63648101, 0.63610581, 0.6390135 , 0.64203528, 0.64624098, 0.64851812, 0.64640406, 0.64384305, 0.6361429 , 0.63677975, 0.63715381, 0.64040366, 0.64404005, 0.64782624, 0.6476325 , 0.64509458, 0.64297808, 0.63477576, 0.63727968, 0.63899462, 0.64205578, 0.64604037, 0.64815296, 0.64609948, 0.64402734, 0.63844724, 0.6343891 , 0.63806041, 0.64043609, 0.64406094, 0.64776777, 0.64717195, 0.64297191, 0.64011346, 0.64110084, 0.63137566, 0.63864151, 0.64163093, 0.64588687, 0.64714873, 0.64603694, 0.64397734, 0.64217431, 0.63958323, 0.62883338, 0.63127469, 0.63961477, 0.64097303, 0.6442055 , 0.64376449, 0.64273526, 0.64112115, 0.63815862, 0.63575399, 0.6291859 , 0.63180644, 0.6394421 , 0.63946545, 0.63947169, 0.63935499, 0.63832598, 0.63664816, 0.63595663, 0.62755689, 0.63523274, 0.63663489, 0.63631586, 0.63616589, 0.63597828, 0.63542126, 0.63500847]) np.testing.assert_allclose(lnmu, lnmud) np.testing.assert_allclose(lnsd[0], lnsdd) # Check for exception due to weights: with pytest.raises(Exception) as a: wts = [0.25, 0.25, 0.25, 0.25 + 1e-4] mgmpe = mg.MultiGMPE.from_list(gmpes, wts) # Check exception on GMPE check with pytest.raises(Exception) as a: wts = [1.0] mgmpe = mg.MultiGMPE.from_list(['BA08'], wts) # Check exception on tectonic region with pytest.raises(Exception) as a: gmpes = [BooreEtAl2014(), Campbell2003()] wts = [0.5, 0.5] mgmpe = mg.MultiGMPE.from_list(gmpes, wts) # Check exception on length of gmpe and weight lenghts with pytest.raises(Exception) as a: gmpes = [BooreEtAl2014(), Campbell2003()] wts = [1.0] mgmpe = mg.MultiGMPE.from_list(gmpes, wts) # Check PGV from a GMPE without PGV gmpes = [Campbell2003()] wts = [1.0] mgmpe = mg.MultiGMPE.from_list(gmpes, wts) lnmu, lnsd = mgmpe.get_mean_and_stddevs( sctx, rupt, dctx, iimt, stddev_types) lnmud = np.array( [ 3.09152212, 3.1524312 , 3.20749883, 3.25431585, 3.29035521, 3.31326677, 3.32116911, 3.31341321, 3.29819842, 3.12252648, 3.18081138, 3.23208034, 3.27383205, 3.30358765, 3.319195 , 3.31916753, 3.30623521, 3.28938984, 3.15235911, 3.20745205, 3.25429394, 3.29035582, 3.31328548, 3.32119931, 3.31344697, 3.2982328 , 3.27982759, 3.17945026, 3.23203088, 3.2738231 , 3.30360265, 3.31922869, 3.31921198, 3.30628471, 3.28944133, 3.26955097, 3.18990634, 3.24351181, 3.28521502, 3.31195497, 3.32124956, 3.3135073 , 3.29830033, 3.27989827, 3.25860053, 3.17942778, 3.23201703, 3.27282524, 3.29888607, 3.3078892 , 3.30156745, 3.2884687 , 3.26964276, 3.24701758, 3.14910673, 3.19888101, 3.23727522, 3.26163304, 3.2701699 , 3.2690822 , 3.26201491, 3.24919602, 3.23101321, 3.10184816, 3.1475792 , 3.18259748, 3.20467529, 3.21444387, 3.21832088, 3.21671138, 3.20966263, 3.19737325] ) lnsdd = np.array( [ 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518, 0.83458518] ) np.testing.assert_allclose(lnmu, lnmud) np.testing.assert_allclose(lnsd[0], lnsdd)
xp1 = [-121.82298, -121.83068] yp0 = [37.73707, 37.74233] yp1 = [37.74233, 37.74758] zp = [10, 15] widths = [15.0, 20.0] dips = [30.0, 45.0] fault = Fault.fromTrace(xp0, yp0, xp1, yp1, zp, widths, dips, reference='From J Smith, (personal communication)') if __name__ == '__main__': xp0 = np.array([-118.0]) xp1 = np.array([-118.0]) yp0 = np.array([34.0]) yp1 = np.array([34.5]) zp = np.array([5.0]) widths = np.array([10.0]) dips = np.array([45.0]) fault = Fault.fromTrace(xp0, yp0, xp1, yp1, zp, widths, dips) _test_trace() #_test_northridge() #_test_correct() # _test_incorrect()
def test_distance_from_sites_source(): # Make sites instance vs30file = os.path.join(shakedir, 'tests/data/Vs30_test.grd') cx = -118.2 cy = 34.1 dx = 0.0083 dy = 0.0083 xspan = 0.0083 * 5 yspan = 0.0083 * 5 site = Sites.createFromCenter(cx, cy, xspan, yspan, dx, dy, vs30File=vs30file, padding=True, resample=False) # Make souce instance lat0 = np.array([34.1]) lon0 = np.array([-118.2]) lat1 = np.array([34.2]) lon1 = np.array([-118.15]) z = np.array([1.0]) W = np.array([3.0]) dip = np.array([30.]) flt = Fault.fromTrace(lon0, lat0, lon1, lat1, z, W, dip) event = {'lat': 34.1, 'lon': -118.2, 'depth': 1, 'mag': 6, 'id': '', 'locstring': '', 'type': 'U', 'time': ShakeDateTime.utcfromtimestamp(int(time.time())), 'timezone': 'UTC'} source = Source(event, flt) gmpelist = [AbrahamsonEtAl2014(), BergeThierryEtAl2003SIGMA()] dists = Distance.fromSites(gmpelist, source, site) dctx = dists.getDistanceContext() rhypo = np.array( [[4.91471497, 4.47602418, 4.13427127, 3.91492565, 3.83902646, 3.91492565, 4.13427127, 4.47602418, 4.91471497], [4.25968568, 3.74498133, 3.32896405, 3.05225679, 2.95426722, 3.05225679, 3.32896405, 3.74498133, 4.25968568], [3.7219197, 3.11965436, 2.60558436, 2.24124201, 2.10583262, 2.24124201, 2.60558436, 3.11965436, 3.7219197], [3.35823105, 2.67523213, 2.05265767, 1.564393, 1.36331682, 1.564393, 2.05265767, 2.67523213, 3.35823105], [3.22800413, 2.50973226, 1.83166664, 1.26045653, 1., 1.26045653, 1.83166664, 2.50973226, 3.22800413], [3.35850726, 2.67542717, 2.05277065, 1.56443006, 1.36331682, 1.56443006, 2.05277065, 2.67542717, 3.35850726], [3.72241812, 3.11998886, 2.60576236, 2.24129374, 2.10583262, 2.24129374, 2.60576236, 3.11998886, 3.72241812], [4.26033893, 3.74539929, 3.32917303, 3.05231378, 2.95426722, 3.05231378, 3.32917303, 3.74539929, 4.26033893]] ) np.testing.assert_allclose( rhypo, dctx.rhypo, rtol=0, atol=0.01) rx = np.array( [[-4.25168879e+00, -3.54281195e+00, -2.83395897e+00, -2.12512986e+00, -1.41632463e+00, -7.07543303e-01, 1.21411306e-03, 7.09947601e-01, 1.41865714e+00], [-3.89788718e+00, -3.18894046e+00, -2.48001760e+00, -1.77111861e+00, -1.06224350e+00, -3.53392295e-01, 3.55434994e-01, 1.06423835e+00, 1.77301777e+00], [-3.54408550e+00, -2.83506891e+00, -2.12607617e+00, -1.41710732e+00, -7.08162347e-01, 7.58720005e-04, 7.09655868e-01, 1.41852908e+00, 2.12737835e+00], [-3.19028373e+00, -2.48119729e+00, -1.77213470e+00, -1.06309600e+00, -3.54081177e-01, 3.54909735e-01, 1.06387673e+00, 1.77281978e+00, 2.48173889e+00], [-2.83648190e+00, -2.12732562e+00, -1.41819320e+00, -7.09084651e-01, 2.56777675e-12, 7.09060743e-01, 1.41809756e+00, 2.12711045e+00, 2.83609938e+00], [-2.48268001e+00, -1.77345390e+00, -1.06425166e+00, -3.55073292e-01, 3.54081177e-01, 1.06321174e+00, 1.77231837e+00, 2.48140106e+00, 3.19045980e+00], [-2.12887807e+00, -1.41958215e+00, -7.10310097e-01, -1.06192604e-03, 7.08162347e-01, 1.41736271e+00, 2.12653914e+00, 2.83569163e+00, 3.54482016e+00], [-1.77507608e+00, -1.06571037e+00, -3.56368521e-01, 3.52949440e-01, 1.06224350e+00, 1.77151365e+00, 2.48075986e+00, 3.18998213e+00, 3.89918045e+00]] ) np.testing.assert_allclose( rx, dctx.rx, rtol=0, atol=0.01) rjb = np.array( [[4.25806540e+00, 3.54812473e+00, 2.83820819e+00, 2.12831587e+00, 1.41844799e+00, 7.08605677e-01, 2.52145001e-03, 2.71336156e-03, 2.81274718e-03], [3.90373176e+00, 3.19372137e+00, 2.48373511e+00, 1.77377308e+00, 1.06383562e+00, 3.53925643e-01, 2.25816823e-03, 2.45009861e-03, 2.54949398e-03], [3.54939857e+00, 2.83931844e+00, 2.12926243e+00, 1.41923064e+00, 7.09223517e-01, 1.57594916e-03, 1.86044244e-03, 2.05239165e-03, 2.15179678e-03], [3.21162971e+00, 2.48510934e+00, 1.77479025e+00, 1.06468863e+00, 3.54611655e-01, 1.04375185e-03, 1.32827303e-03, 1.52024106e-03, 1.61965594e-03], [3.07587955e+00, 2.30690967e+00, 1.53793979e+00, 7.68969896e-01, 5.88918451e-12, 3.77111295e-04, 6.61660373e-04, 8.53647223e-04, 2.38384209e-01], [3.21191809e+00, 2.48531877e+00, 1.79442084e+00, 1.20242597e+00, 8.54793253e-01, 5.62052963e-01, 2.69254693e-01, 5.26105100e-05, 5.93270976e-01], [3.58897017e+00, 2.95646628e+00, 2.40489915e+00, 2.00231070e+00, 1.70958533e+00, 1.41681634e+00, 1.12398937e+00, 8.63761551e-01, 1.08872127e+00], [4.14172611e+00, 3.60741953e+00, 3.17112489e+00, 2.85711592e+00, 2.56437623e+00, 2.27157856e+00, 1.97872291e+00, 1.78518260e+00, 1.90424524e+00]] ) np.testing.assert_allclose( rjb, dctx.rjb, rtol=0, atol=0.01) ry0 = np.array( [[0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [3.15917743e-01, 2.29488608e-02, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [1.17233848e+00, 8.79340738e-01, 5.86285075e-01, 2.93171494e-01, 6.20905972e-12, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [2.02875906e+00, 1.73573247e+00, 1.44264795e+00, 1.14950551e+00, 8.56305149e-01, 5.63046877e-01, 2.69730699e-01, 0.00000000e+00, 0.00000000e+00], [2.88517947e+00, 2.59212404e+00, 2.29901067e+00, 2.00583937e+00, 1.71261015e+00, 1.41932302e+00, 1.12597797e+00, 8.32575011e-01, 5.39114157e-01], [3.74159969e+00, 3.44851542e+00, 3.15537321e+00, 2.86217307e+00, 2.56891499e+00, 2.27559900e+00, 1.98222508e+00, 1.68879326e+00, 1.39530352e+00]] ) np.testing.assert_allclose( ry0, dctx.ry0, rtol=0, atol=0.01) rrup = np.array( [[4.37398161, 3.68659567, 3.00969158, 2.35231374, 1.73674834, 1.22755262, 1.0025215, 1.22371894, 1.57836451], [4.02976949, 3.34678672, 2.67788811, 2.03697073, 1.46129187, 1.06271102, 1.06352692, 1.40073832, 1.75541869], [3.68743926, 3.01030105, 2.3526499, 1.73673635, 1.22706347, 1.00157564, 1.22283363, 1.57764099, 1.93235615], [3.3634728, 2.67858182, 2.03712377, 1.46095502, 1.06170931, 1.06220616, 1.39958479, 1.75442695, 2.1091769], [3.23412325, 2.51415965, 1.8343632, 1.26143652, 1., 1.2212501, 1.57621925, 1.9310962, 2.28588093], [3.36374812, 2.67877609, 2.05412785, 1.56384179, 1.3617346, 1.50608502, 1.77308319, 2.10764873, 2.46246823], [3.72541099, 3.12078859, 2.6043486, 2.23799413, 2.09885629, 2.11696797, 2.23191013, 2.4299612, 2.69282837], [4.26042286, 3.74318473, 3.32482368, 3.04635272, 2.9183523, 2.86659485, 2.88815116, 2.98141559, 3.13998993]] ) np.testing.assert_allclose( rrup, dctx.rrup, rtol=0, atol=0.01)