added shifting of SNR threshold along y axis

This commit is contained in:
Marcel Paffrath 2015-11-18 17:22:18 +01:00
parent 0a00aab3ba
commit 657472f576

View File

@ -14,7 +14,7 @@ def setArtificialPick(shot_dict, traceID, pick):
shot.setPick(traceID, pick) shot.setPick(traceID, pick)
shot.setPickwindow(traceID, shot.getCut()) shot.setPickwindow(traceID, shot.getCut())
def fitSNR4dist(shot_dict, shiftdist = 5): def fitSNR4dist(shot_dict, shiftdist = 5, shiftSNR = 3):
import numpy as np import numpy as np
dists = [] dists = []
picks = [] picks = []
@ -32,7 +32,7 @@ def fitSNR4dist(shot_dict, shiftdist = 5):
fit_fn = np.poly1d(fit) fit_fn = np.poly1d(fit)
for dist in dists: for dist in dists:
dist += shiftdist dist += shiftdist
snrthresholds.append(1/(fit_fn(dist)**2)) snrthresholds.append((1/(fit_fn(dist)**2)) - shiftSNR)
plotFittedSNR(dists, snrthresholds, snrs) plotFittedSNR(dists, snrthresholds, snrs)
return fit_fn #### ZU VERBESSERN, sollte fertige funktion wiedergeben return fit_fn #### ZU VERBESSERN, sollte fertige funktion wiedergeben
@ -47,13 +47,18 @@ def plotFittedSNR(dists, snrthresholds, snrs):
plt.ylabel('SNR') plt.ylabel('SNR')
plt.legend() plt.legend()
def setFittedSNR(shot_dict, shiftdist = 5, p1 = 0.004, p2 = -0.004): def setFittedSNR(shot_dict, shiftdist = 5, shiftSNR = 3, p1 = 0.004, p2 = -0.0007):
import numpy as np import numpy as np
#fit_fn = fitSNR4dist(shot_dict) #fit_fn = fitSNR4dist(shot_dict)
fit_fn = np.poly1d([p1, p2]) fit_fn = np.poly1d([p1, p2])
for shot in shot_dict.values(): for shot in shot_dict.values():
for traceID in shot.getTraceIDlist(): ### IMPROVE for traceID in shot.getTraceIDlist(): ### IMPROVE
shot.setSNRthreshold(traceID, 1/(fit_fn(shot.getDistance(traceID) + shiftdist)**2)) ### s.o. snrthreshold = (1/(fit_fn(shot.getDistance(traceID) + shiftdist)**2)) - shiftSNR
if snrthreshold < 0:
print('WARNING: SNR threshold %s lower 0!!! Try to lower the shiftSNR'
%snrthreshold)
break
shot.setSNRthreshold(traceID, snrthreshold)
print "setFittedSNR: Finished setting of fitted SNR-threshold" print "setFittedSNR: Finished setting of fitted SNR-threshold"