def test_Grid3Dfs(self): g = rg.Grid3d(self.x, self.y, self.z, method='FSM', tt_from_rp=False) tt = g.raytrace(self.src, self.rcv, self.slowness) dim = (self.x.size, self.y.size, self.z.size) tt = g.get_grid_traveltimes() tt = tt.flatten() tt_ref = get_tt('fsm_d_p_lc_src_all_tt.vtr') self.assertLess( np.sum(np.abs(tt - tt_ref)) / tt.size, 0.01, 'FSM accuracy failed (slowness in cells)')
def test_Grid3Ddsp(self): g = rg.Grid3d(self.x, self.y, self.z, method='DSPM', tt_from_rp=False, n_secondary=2, n_tertiary=2, radius_tertiary=2) tt = g.raytrace(self.src, self.rcv, self.slowness) dim = (self.x.size, self.y.size, self.z.size) tt = g.get_grid_traveltimes() tt = tt.flatten() tt_ref = get_tt('dspm_d_p_lc_2_2_2_src_all_tt.vtr') self.assertLess( np.sum(np.abs(tt - tt_ref)) / tt.size, 0.1, 'SPM accuracy failed (slowness in cells)')
def test_Grid3Dsp(self): g = rg.Grid3d(self.x, self.y, self.z, method='SPM', tt_from_rp=False, nsnx=5, nsny=5, nsnz=5, cell_slowness=0) tt = g.raytrace(self.src, self.rcv, self.slowness) dim = (self.x.size, self.y.size, self.z.size) tt = g.get_grid_traveltimes() tt = tt.flatten() tt_ref = get_tt('spm_d_p_gc_05_src_all_tt.vtr') self.assertLess( np.sum(np.abs(tt - tt_ref)) / tt.size, 0.1, 'SPM accuracy failed (slowness at nodes)')