Esempio n. 1
0
 def test_Mesh3Dfs(self):
     g = tm.Mesh3d(self.nodes, self.tet, method='FSM', tt_from_rp=0)
     tt = g.raytrace(self.src, self.rcv, slowness=self.slowness)
     tt = g.get_grid_traveltimes()
     tt = tt.flatten()
     tt_ref = get_tt('fsm_d_p_lc_u_src_all_tt.vtu')
     self.assertLess(
         np.sum(np.abs(tt - tt_ref)) / tt.size, 0.01,
         'FSM accuracy failed (slowness in cells)')
Esempio n. 2
0
 def test_Mesh3Dsp(self):
     g = tm.Mesh3d(self.nodes,
                   self.tet,
                   method='SPM',
                   n_secondary=5,
                   cell_slowness=0,
                   tt_from_rp=0)
     tt = g.raytrace(self.src, self.rcv, slowness=self.slowness)
     tt = g.get_grid_traveltimes()
     tt = tt.flatten()
     tt_ref = get_tt('spm_d_p_gc_05_u_src_all_tt.vtu')
     self.assertLess(
         np.sum(np.abs(tt - tt_ref)) / tt.size, 0.01,
         'SPM accuracy failed (slowness at nodes)')
Esempio n. 3
0
 def test_Mesh3Ddsp(self):
     g = tm.Mesh3d(self.nodes,
                   self.tet,
                   method='DSPM',
                   n_secondary=2,
                   n_tertiary=2,
                   radius_tertiary=2.0,
                   tt_from_rp=0)
     tt = g.raytrace(self.src, self.rcv, slowness=self.slowness)
     tt = g.get_grid_traveltimes()
     tt = tt.flatten()
     tt_ref = get_tt('dspm_d_p_lc_2_2_2_u_src_all_tt.vtu')
     self.assertLess(
         np.sum(np.abs(tt - tt_ref)) / tt.size, 0.01,
         'DSPM accuracy failed (slowness in cells)')
Esempio n. 4
0
Topo_data = np.loadtxt('all_dec.xyz') * 1.e-3
nx = (np.unique(Topo_data[:, 0])).size
ny = (np.unique(Topo_data[:, 1])).size
X = Topo_data[:, 0].reshape([nx, ny])
Y = Topo_data[:, 1].reshape([nx, ny])
Z = Topo_data[:, 2].reshape([nx, ny])

# object cmesh
MESH = MSHReader('Model.msh')
nodes = MESH.readNodes()
cells = MESH.readTetraherdonElements()
Mesh3D = tmesh.Mesh3d(nodes,
                      tetra=cells,
                      method='DSPM',
                      cell_slowness=0,
                      n_threads=1,
                      n_secondary=2,
                      n_tertiary=1,
                      process_vel=1,
                      radius_factor_tertiary=2,
                      translate_grid=1)
for h in range(Hypocenters.shape[0]):
    pts = intersectionEll(Ucrties[h][1],
                          Ucrties[h][2],
                          Ucrties[h][3],
                          Hypocenters[h, 2:],
                          Hypocenters[h, 2:],
                          nbreP=50,
                          meshObj=Mesh3D)
    plt.plot(pts[:, 0], pts[:, 1], '-r', markersize=0.1)
    plt.annotate(str(int(1.e3 * Hypocenters[h, 4])),
                 (Hypocenters[h, 2] - 0.008, Hypocenters[h, 3] + 0.006),