diff --git a/scripts/GenerateTrueMOD.py b/scripts/GenerateTrueMOD.py index 0ccb769..7348281 100644 --- a/scripts/GenerateTrueMOD.py +++ b/scripts/GenerateTrueMOD.py @@ -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): diff --git a/scripts/plotpath.py b/scripts/plotpath.py new file mode 100644 index 0000000..5ee2220 --- /dev/null +++ b/scripts/plotpath.py @@ -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() diff --git a/src/DSurfTomo b/src/DSurfTomo index 5056d65..59c37c3 100755 Binary files a/src/DSurfTomo and b/src/DSurfTomo differ