From 3e7e693a66b6148beebf4c0c3da15756b5623b34 Mon Sep 17 00:00:00 2001 From: Marcel Paffrath Date: Thu, 1 Oct 2015 11:30:46 +0200 Subject: [PATCH] changed structure: plot option -> survey method --- pylot/core/active/surveyPlotTools.py | 82 ---------------------------- 1 file changed, 82 deletions(-) diff --git a/pylot/core/active/surveyPlotTools.py b/pylot/core/active/surveyPlotTools.py index d91998c9..2f7b2a0a 100644 --- a/pylot/core/active/surveyPlotTools.py +++ b/pylot/core/active/surveyPlotTools.py @@ -1,85 +1,6 @@ import matplotlib.pyplot as plt -import math -#from selectRegions import regions - plt.interactive(True) -def plotAllPicks(shot_dict, dist_med = None): - ''' - Plots all picks over the distance between source and receiver. Returns (ax, region) - ''' - dist = [] - pick = [] - snrloglist = [] - for shot in shot_dict.values(): - for traceID in shot.getTraceIDlist(): - if shot.getPick(traceID) is not None: - dist.append(shot.getDistance(traceID)) - pick.append(shot.getPick(traceID)) - snrloglist.append(math.log10(shot.getSNR(traceID)[0])) - - ax = createPlot(dist, pick, snrloglist, label = 'log10(SNR)') - region = regions(ax, shot_dict) - if dist_med is not None: - ax = addDistMed(ax, dist_med) - ax.legend() - - return ax, region - -def plotAllPicks_withCutOutTraces(shot_dict, dist_med = None): - ''' - Plots all picks over the distance between source and receiver. Returns (ax, region) - ''' - dist = [] - pick = [] - snrloglist = [] - for shot in shot_dict.values(): - for traceID in shot.getTraceIDlist(): - if shot.getSNR(traceID)[0] > 3: - dist.append(shot.getDistance(traceID)) - pick.append(shot.getPick_backup(traceID)) - snrloglist.append(math.log10(shot.getSNR(traceID)[0])) - - ax = createPlot(dist, pick, snrloglist, label = 'log10(SNR)') - region = regions(ax, shot_dict) - if dist_med is not None: - ax = addDistMed(ax, dist_med) - ax.legend() - - return ax, region - -def createPlot(dist, pick, inkByVal, label): - cm = plt.cm.jet - - fig = plt.figure() - ax = fig.add_subplot(111) - fig = ax.scatter(dist, pick, cmap = cm, c = inkByVal, s = 5, edgecolors = 'none', label = label) - cbar = plt.colorbar(fig, fraction = 0.05) - cbar.set_label(label) - plt.title('Plot of all Picks') - plt.xlabel('Distance [m]') - plt.ylabel('Time [s]') - - return ax - -def addDistMed(ax, dist_med): - ''' - Add shot dictionary containing the Median for several distancebins to the ax. - ''' - x = [] - y = [] - for dist in dist_med.keys(): - x.append(dist) - y.append(dist_med[dist]) - - xy = sorted(zip(x,y)) - x1 = [x for (x,y) in xy] - y1 = [y for (x,y) in xy] - - ax.plot(x1, y1, 'k', label = 'Median') - - return ax - class regions(object): def __init__(self, ax, shot_dict): self.ax = ax @@ -159,7 +80,6 @@ class regions(object): self.ax.set_ylim(shot.getCut()) def plotTracesInRegion(self): - import matplotlib.pyplot as plt count = 0 maxfigures = 20 # if len(self.shots_found) == 0: @@ -179,7 +99,6 @@ class regions(object): print 'No picks yet defined in the regions x = (%s, %s), y = (%s, %s)' %(self._x0, self._x1, self._y0, self._y1) def plotTracesInRegion_withCutOutTraces(self): - import matplotlib.pyplot as plt count = 0 maxfigures = 20 # if len(self.shots_found) == 0: @@ -246,5 +165,4 @@ class regions(object): self.refreshFigure() def refreshFigure(self): - import matplotlib.pyplot as plt plt.draw()