bugfixes and other not further specified changes

This commit is contained in:
Marcel Paffrath 2016-01-19 10:31:06 +01:00
parent 7edee1266a
commit ce705888f1
4 changed files with 32 additions and 13 deletions

View File

@ -170,9 +170,10 @@ class Survey(object):
for traceID in shot.getTraceIDlist(): for traceID in shot.getTraceIDlist():
if shot.getPickFlag(traceID) == 1 and shot.getManualPickFlag(traceID) == 1: if shot.getPickFlag(traceID) == 1 and shot.getManualPickFlag(traceID) == 1:
diffs.append(self.getDiffsFromManual()[shot][traceID]) diffs.append(self.getDiffsFromManual()[shot][traceID])
plt.hist(diffs, nbins) hist = plt.hist(diffs, nbins, histtype = 'step', normed = True, stacked = True)
plt.title('Histogram of the differences between automatic and manual pick') plt.title('Histogram of the differences between automatic and manual pick')
plt.xlabel('Difference in time (auto - manual) [s]') plt.xlabel('Difference in time (auto - manual) [s]')
return diffs
def pickAllShots(self, windowsize, HosAic = 'hos', vmin = 333, vmax = 5500, folm = 0.6): def pickAllShots(self, windowsize, HosAic = 'hos', vmin = 333, vmax = 5500, folm = 0.6):
''' '''
@ -421,7 +422,7 @@ class Survey(object):
#ax = fig.add_subplot(3,3,i, projection = '3d', title = 'shot:' #ax = fig.add_subplot(3,3,i, projection = '3d', title = 'shot:'
#+str(shot_dict[shotnumber].getShotnumber()), xlabel = 'X', ylabel = 'Y', zlabel = 'traveltime') #+str(shot_dict[shotnumber].getShotnumber()), xlabel = 'X', ylabel = 'Y', zlabel = 'traveltime')
#shot_dict[shotnumber].plot3dttc(ax = ax, plotpicks = True) #shot_dict[shotnumber].plot3dttc(ax = ax, plotpicks = True)
ax = fig.add_subplot(3, 4, index) ax = fig.add_subplot(rows, columns, index)
if mode == '3d': if mode == '3d':
self.getShot(shotnumber).matshow(ax = ax, colorbar = False, annotations = True, legend = False) self.getShot(shotnumber).matshow(ax = ax, colorbar = False, annotations = True, legend = False)
elif mode == '2d': elif mode == '2d':

View File

@ -747,6 +747,9 @@ class SeisArray(object):
return surface return surface
def exportAll(self, filename = 'interpolated_receivers.out'): def exportAll(self, filename = 'interpolated_receivers.out'):
'''
Exports all receivers to an input file for ActiveSeismoPick3D.
'''
recfile_out = open(filename, 'w') recfile_out = open(filename, 'w')
count = 0 count = 0
for traceID in self.getReceiverCoordinates().keys(): for traceID in self.getReceiverCoordinates().keys():
@ -803,7 +806,7 @@ class SeisArray(object):
xrc, yrc, zrc = self.getReceiverLists() xrc, yrc, zrc = self.getReceiverLists()
xsc, ysc, zsc = self.getSourceLocsLists() xsc, ysc, zsc = self.getSourceLocsLists()
plt.title('3D plot of seismic array %s'%self.recfile) plt.title('3D plot of seismic array.')
if len(xmt) > 0: if len(xmt) > 0:
ax.plot(xmt, ymt, zmt, 'b.', markersize = 10, label = 'measured topo points') ax.plot(xmt, ymt, zmt, 'b.', markersize = 10, label = 'measured topo points')
if len(xrc) > 0: if len(xrc) > 0:
@ -812,7 +815,7 @@ class SeisArray(object):
ax.plot(xmr, ymr, zmr, 'ro', label = 'measured receivers') ax.plot(xmr, ymr, zmr, 'ro', label = 'measured receivers')
if len(xsc) > 0: if len(xsc) > 0:
ax.plot(xsc, ysc, zsc, 'b*', label = 'shot locations') ax.plot(xsc, ysc, zsc, 'b*', label = 'shot locations')
ax.set_xlabel('X'); ax.set_ylabel('Y'); ax.set_zlabel('elevation') ax.set_xlabel('X [m]'); ax.set_ylabel('Y [m]'); ax.set_zlabel('Z [m]')
ax.legend() ax.legend()
return ax return ax
@ -842,13 +845,15 @@ class SeisArray(object):
zgrid = griddata((x, y), z, (xgrid, ygrid), method = method) zgrid = griddata((x, y), z, (xgrid, ygrid), method = method)
ax.plot_surface(xgrid, ygrid, zgrid, linewidth = 0, cmap = cm.jet, vmin = min(z), vmax = max(z)) surf = ax.plot_surface(xgrid, ygrid, zgrid, linewidth = 0, cmap = cm.jet, vmin = min(z), vmax = max(z))
cbar = plt.colorbar(surf)
cbar.set_label('Elevation [m]')
if exag == False: if exag == False:
ax.set_zlim(-(max(x) - min(x)/2),(max(x) - min(x)/2)) ax.set_zlim(-(max(x) - min(x)/2),(max(x) - min(x)/2))
ax.set_aspect('equal') ax.set_aspect('equal')
ax.set_xlabel('X'); ax.set_ylabel('Y'); ax.set_zlabel('elevation') ax.set_xlabel('X [m]'); ax.set_ylabel('Y [m]'); ax.set_zlabel('Z [m]')
ax.legend() ax.legend()
return ax return ax

View File

@ -365,7 +365,11 @@ class SeismicShot(object):
leftb = int(pickwindow[0] / self.getCut()[1] * len(hoscflist)) leftb = int(pickwindow[0] / self.getCut()[1] * len(hoscflist))
rightb = int(pickwindow[1] / self.getCut()[1] * len(hoscflist)) rightb = int(pickwindow[1] / self.getCut()[1] * len(hoscflist))
threshold = folm * max(hoscflist[leftb : rightb]) # combination of local maximum and threshold #threshold = folm * max(hoscflist[leftb : rightb]) # combination of local maximum and threshold
### TEST TEST
threshold = folm * (max(hoscflist[leftb : rightb]) - min(hoscflist[leftb : rightb])) + min(hoscflist[leftb : rightb]) # combination of local maximum and threshold
### TEST TEST
m = leftb m = leftb
@ -376,7 +380,10 @@ class SeismicShot(object):
lb = max(0, m - windowsize[0]) # if window exceeds t = 0 lb = max(0, m - windowsize[0]) # if window exceeds t = 0
aiccfcut = list(aiccf.getCF())[lb : m + windowsize[1]] aiccfcut = list(aiccf.getCF())[lb : m + windowsize[1]]
if len(aiccfcut) > 0:
n = aiccfcut.index(min(aiccfcut)) n = aiccfcut.index(min(aiccfcut))
else:
n = 0
m = lb + n m = lb + n
@ -814,8 +821,8 @@ class SeismicShot(object):
y.append(self.getRecLoc(traceID)[1]) y.append(self.getRecLoc(traceID)[1])
z.append(self.getPick(traceID)) z.append(self.getPick(traceID))
xaxis = np.arange(min(x), max(x), step) xaxis = np.arange(min(x) + step, max(x), step)
yaxis = np.arange(min(y), max(y), step) yaxis = np.arange(min(y) + step, max(y), step)
xgrid, ygrid = np.meshgrid(xaxis, yaxis) xgrid, ygrid = np.meshgrid(xaxis, yaxis)
zgrid = griddata((x, y), z, (xgrid, ygrid), method = method) zgrid = griddata((x, y), z, (xgrid, ygrid), method = method)
@ -892,9 +899,9 @@ class SeismicShot(object):
ax.text(0.5, 0.95, 'shot: %s' %self.getShotnumber(), transform = ax.transAxes ax.text(0.5, 0.95, 'shot: %s' %self.getShotnumber(), transform = ax.transAxes
, horizontalalignment = 'center') , horizontalalignment = 'center')
sc = ax.scatter(x, y, c = z, s = 30, label = 'picked shots', vmin = tmin, vmax = tmax, cmap = cmap, linewidths = 1.5) sc = ax.scatter(x, y, c = z, s = 30, label = 'picked shots', vmin = tmin, vmax = tmax, cmap = cmap, linewidths = 1.5)
label = None
for xyz in zip(xcut, ycut, zcut): for xyz in zip(xcut, ycut, zcut):
x, y, z = xyz x, y, z = xyz
label = None
if z > tmax: if z > tmax:
count += 1 count += 1
z = 'w' z = 'w'

View File

@ -54,7 +54,7 @@ def plotFittedSNR(dists, snrthresholds, snrs, snrBestFit):
plt.ylabel('SNR') plt.ylabel('SNR')
plt.legend() plt.legend()
def setFittedSNR(shot_dict, shiftdist = 30, shiftSNR = 100, p1 = 0.004, p2 = -0.0007): def setDynamicFittedSNR(shot_dict, shiftdist = 30, shiftSNR = 100, p1 = 0.004, p2 = -0.0007):
import numpy as np import numpy as np
minSNR = 2.5 minSNR = 2.5
#fit_fn = fitSNR4dist(shot_dict) #fit_fn = fitSNR4dist(shot_dict)
@ -69,8 +69,14 @@ def setFittedSNR(shot_dict, shiftdist = 30, shiftSNR = 100, p1 = 0.004, p2 = -0.
shot.setSNRthreshold(traceID, minSNR) shot.setSNRthreshold(traceID, minSNR)
else: else:
shot.setSNRthreshold(traceID, snrthreshold) shot.setSNRthreshold(traceID, snrthreshold)
print "setFittedSNR: Finished setting of fitted SNR-threshold" print "setDynamicFittedSNR: Finished setting of fitted SNR-threshold"
def setConstantSNR(shot_dict, snrthreshold = 2.5):
import numpy as np
for shot in shot_dict.values():
for traceID in shot.getTraceIDlist():
shot.setSNRthreshold(traceID, snrthreshold)
print "setConstantSNR: Finished setting of SNR threshold to a constant value of %s"%snrthreshold
def findTracesInRanges(shot_dict, distancebin, pickbin): def findTracesInRanges(shot_dict, distancebin, pickbin):
''' '''