working on implementing of gradients for different layers

This commit is contained in:
Marcel Paffrath 2015-11-05 10:13:04 +01:00
parent d8a59ac81d
commit f2fc5e5071

View File

@ -223,7 +223,7 @@ class SeisArray(object):
''' '''
PI = np.pi PI = np.pi
R = 6371. R = 6371.
angle = distance * 180 / (PI * R) angle = distance * 180. / (PI * R)
return angle return angle
def _getDistance(self, angle): def _getDistance(self, angle):
@ -232,7 +232,7 @@ class SeisArray(object):
''' '''
PI = np.pi PI = np.pi
R = 6371. R = 6371.
distance = angle / 180 * (PI * R) distance = angle / 180. * (PI * R)
return distance return distance
def getMeasuredReceiverLists(self): def getMeasuredReceiverLists(self):
@ -486,13 +486,13 @@ class SeisArray(object):
topo = point[2] topo = point[2]
z = -(R + topo - radius) z = -(R + topo - radius)
if z > (topo + 1): if z > (topo + 1):
vel = vtop[0] vel = 0.0
elif (topo + 1) >= z > topo: # cushioning around topography elif (topo + 1) >= z > topo: # cushioning around topography
vel = vtop[0] vel = vtop[0]
else: else:
for index in range(nlayers): for index in range(nlayers):
if (topo + ztop[index]) >= z > (topo + zbot[index]): if (topo + ztop[index]) >= z > (topo + zbot[index]):
vel = (z - ztop[index]) / (zbot[index] - ztop[index]) * (vbot[index] - vtop[index]) + vtop[index] vel = (z - ztop[index] - topo) / (zbot[index] - ztop[index]) * (vbot[index] - vtop[index]) + vtop[index]
break break
if not (topo + ztop[index]) >= z > (topo + zbot[index]): if not (topo + ztop[index]) >= z > (topo + zbot[index]):
print('ERROR in grid inputfile, could not find velocity for a z-value of %s in the inputfile'%(z - topo)) print('ERROR in grid inputfile, could not find velocity for a z-value of %s in the inputfile'%(z - topo))