mirror of
https://github.com/HongjianFang/DSurfTomo.git
synced 2025-12-17 16:21:07 +08:00
nothing important
change the script for generating true model and add script for ploting paths
This commit is contained in:
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()
|
||||
Reference in New Issue
Block a user