mirror of
https://github.com/HongjianFang/DSurfTomo.git
synced 2025-05-05 22:31:14 +08:00
nothing important
change the script for generating true model and add script for ploting paths
This commit is contained in:
parent
6b00b85ba0
commit
2b73597aea
@ -15,8 +15,9 @@ dep1=[0,0.2,0.4,0.6,0.8,1.1,1.4,1.8,2.5]
|
||||
anosize=0.5
|
||||
amplitude=0.4
|
||||
#end
|
||||
x=range(1,nx+1)
|
||||
y=range(1,ny+1)
|
||||
nmax = np.max([nx,ny])
|
||||
x=range(1,nmax+1)
|
||||
y=range(1,nmax+1)
|
||||
z=range(1,nz+1)
|
||||
z=np.ones(nz)
|
||||
bg=np.zeros((nz,nx,ny))
|
||||
@ -24,7 +25,7 @@ cross=np.zeros((nz,ny))
|
||||
vs1=np.zeros(nz)
|
||||
xy=np.kron(np.sin(anosize*np.array(y)),np.sin(anosize*np.array(x)))
|
||||
xyz=np.kron(z,xy)
|
||||
pxy=xyz.reshape(nz,nx,ny)
|
||||
pxy=xyz.reshape(nz,nmax,nmax)
|
||||
for k in range(nz):
|
||||
for j in range(ny):
|
||||
for i in range(nx):
|
||||
|
33
scripts/plotpath.py
Normal file
33
scripts/plotpath.py
Normal file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import numpy as np
|
||||
from matplotlib import pylab as plt
|
||||
|
||||
#parameters you need to change
|
||||
#begin
|
||||
numray = 3320 # how many rays do you have (all periods)
|
||||
rb = 1 # ray index for some period (first one)
|
||||
re = 50 # ray index for some period (last one)
|
||||
maxseg = 500 #
|
||||
#end
|
||||
|
||||
n = 0
|
||||
numseg = np.zeros(numray,)
|
||||
raylat = np.zeros((numray,maxseg))
|
||||
raylon = np.zeros((numray,maxseg))
|
||||
with open('raypath.out') as ray:
|
||||
for line in ray:
|
||||
linseg = line.split()
|
||||
if linseg[0]=='#':
|
||||
n = n+1
|
||||
seg = 0
|
||||
numseg[n-1] = float(linseg[1])
|
||||
else:
|
||||
seg = seg+1
|
||||
raylat[n-1,seg-1] = float(linseg[0])
|
||||
raylon[n-1,seg-1] = float(linseg[1])
|
||||
|
||||
for ii in range(rb,re):
|
||||
plt.plot(raylon[ii,0:numseg[ii]],raylat[ii,0:numseg[ii]],'k-')
|
||||
|
||||
plt.show()
|
BIN
src/DSurfTomo
BIN
src/DSurfTomo
Binary file not shown.
Loading…
Reference in New Issue
Block a user