From 1a9f68f7413fe5b3e51bae86d86bce2eaa54d491 Mon Sep 17 00:00:00 2001 From: Marcel Paffrath Date: Mon, 7 Dec 2015 11:21:11 +0100 Subject: [PATCH] bugfixes (minSNR was 1, problem in for loop with break?) --- pylot/core/active/surveyUtils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pylot/core/active/surveyUtils.py b/pylot/core/active/surveyUtils.py index 1e8b9927..12f5cc39 100644 --- a/pylot/core/active/surveyUtils.py +++ b/pylot/core/active/surveyUtils.py @@ -41,7 +41,7 @@ def plotFittedSNR(dists, snrthresholds, snrs): import matplotlib.pyplot as plt plt.interactive(True) fig = plt.figure() - plt.plot(dists, snrs, '.', markersize = 0.5, label = 'SNR values') + plt.plot(dists, snrs, '.', markersize = 1.0, label = 'SNR values') plt.plot(dists, snrthresholds, 'r.', markersize = 1, label = 'Fitted threshold') plt.xlabel('Distance[m]') plt.ylabel('SNR') @@ -56,12 +56,12 @@ def setFittedSNR(shot_dict, shiftdist = 30, shiftSNR = 100, p1 = 0.004, p2 = -0. for traceID in shot.getTraceIDlist(): ### IMPROVE dist = shot.getDistance(traceID) + shiftdist snrthreshold = (1/(fit_fn(dist)**2)) - shiftSNR * np.exp(-0.05 * dist) - if snrthreshold <= 1: + if snrthreshold < minSNR: print('WARNING: SNR threshold %s lower %s. Set SNR threshold to %s.' %(snrthreshold, minSNR, minSNR)) shot.setSNRthreshold(traceID, minSNR) - break - shot.setSNRthreshold(traceID, snrthreshold) + else: + shot.setSNRthreshold(traceID, snrthreshold) print "setFittedSNR: Finished setting of fitted SNR-threshold"