changed SNR threshold (scaled by exp function)

This commit is contained in:
Marcel Paffrath 2015-11-24 12:37:53 +01:00
parent fdd7ff003b
commit b310062687

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, shiftSNR = 3): def fitSNR4dist(shot_dict, shiftdist = 30, shiftSNR = 100):
import numpy as np import numpy as np
dists = [] dists = []
picks = [] picks = []
@ -32,7 +32,7 @@ def fitSNR4dist(shot_dict, shiftdist = 5, shiftSNR = 3):
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)) - shiftSNR) snrthresholds.append((1/(fit_fn(dist)**2)) - shiftSNR * np.exp(-0.05 * dist))
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,17 +47,19 @@ def plotFittedSNR(dists, snrthresholds, snrs):
plt.ylabel('SNR') plt.ylabel('SNR')
plt.legend() plt.legend()
def setFittedSNR(shot_dict, shiftdist = 5, shiftSNR = 3, p1 = 0.004, p2 = -0.0007): def setFittedSNR(shot_dict, shiftdist = 30, shiftSNR = 100, p1 = 0.004, p2 = -0.0007):
import numpy as np import numpy as np
minSNR = 2.5
#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
snrthreshold = (1/(fit_fn(shot.getDistance(traceID) + shiftdist)**2)) - shiftSNR dist = shot.getDistance(traceID) + shiftdist
snrthreshold = (1/(fit_fn(dist)**2)) - shiftSNR * np.exp(-0.05 * dist)
if snrthreshold <= 1: if snrthreshold <= 1:
print('WARNING: SNR threshold %s lower 1!!! Try to lower the shiftSNR' print('WARNING: SNR threshold %s lower %s. Set SNR threshold to %s.'
%snrthreshold) %(snrthreshold, minSNR, minSNR))
shot.setSNRthreshold(traceID, 1) shot.setSNRthreshold(traceID, minSNR)
break break
shot.setSNRthreshold(traceID, snrthreshold) shot.setSNRthreshold(traceID, snrthreshold)
print "setFittedSNR: Finished setting of fitted SNR-threshold" print "setFittedSNR: Finished setting of fitted SNR-threshold"