updated plot of 2d ttcs

This commit is contained in:
Marcel Paffrath 2015-12-09 13:39:58 +01:00
parent a866bf5228
commit 943432dfb3

View File

@ -565,63 +565,67 @@ class SeismicShot(object):
def getDistArray4ttcPlot(self): ########## nur fuer 2D benoetigt ########## def getDistArray4ttcPlot(self): ########## nur fuer 2D benoetigt ##########
''' '''
Function to create a distance array for the plots. 2D only! Function to create a distance array for the plots. 2D only! X DIRECTION!!
''' '''
distancearray = [] distancearray = []
for traceID in self.picks.keys(): for traceID in self.picks.keys():
if self.getRecLoc(traceID) > self.getSrcLoc(traceID): if self.getRecLoc(traceID)[0] > self.getSrcLoc()[0]:
distancearray.append(self.getDistance(traceID)) distancearray.append(self.getDistance(traceID))
elif self.getRecLoc(traceID) < self.getSrcLoc(traceID): elif self.getRecLoc(traceID)[0] <= self.getSrcLoc()[0]:
distancearray.append((-1)*self.getDistance(traceID)) distancearray.append((-1)*self.getDistance(traceID))
return distancearray return distancearray
# def plot2dttc(self, dist_med = 0): ########## 2D ########## def plot2dttc(self, ax = None): ########## 2D ##########
# ''' '''
# Function to plot the traveltime curve for automated picks (AIC & HOS) of a shot. 2d only! Function to plot the traveltime curve for automated picks of a shot. 2d only! ATM: X DIRECTION!!
'''
import matplotlib.pyplot as plt
plt.interactive('True')
picks = []
# :param: dist_med (optional) for traceID in self.picks.keys():
# :type: 'dictionary' picks.append(self.getPick(traceID))
# '''
# import matplotlib.pyplot as plt
# plt.interactive('True')
# aictimearray = []
# hostimearray = []
# if dist_med is not 0:
# dist_medarray = []
# i = 1 if ax is None:
# for traceID in self.picks.keys(): fig = plt.figure()
# aictimearray.append(self.getPick(traceID)) ###### HIER NICHT MEHR aic = [0] oder hos = [1] ax = fig.add_subplot(111)
# hostimearray.append(self.getPick(traceID))
# if dist_med is not 0: dist_medarray.append(dist_med[self.getDistance(traceID)])
# i += 1
# plt.plot(self.getDistArray4ttcPlot(), aictimearray, 'r', label = "AIC") # shotnumbers = [shotnumbers for (shotnumbers, shotnames) in sorted(zip(shotnumbers, shotnames))]
# plt.plot(self.getDistArray4ttcPlot(), hostimearray, 'y', label = "HOS") plotarray = sorted(zip(self.getDistArray4ttcPlot(), picks))
# if dist_med is not 0: plt.plot(self.getDistArray4ttcPlot(), dist_medarray, ':b') x = []; y = []
# plt.title(self.shotname) for point in plotarray:
x.append(point[0])
y.append(point[1])
ax.plot(x, y,'r', label = "Automatic Picks")
plt.title('Shot: %s' %self.getShotnumber())
# def plotmanualttc(self): ########## 2D ########## def plotmanual2dttc(self, ax = None): ########## 2D ##########
# ''' '''
# Function to plot the traveltime curve for manual picks of a shot. 2D only! Function to plot the traveltime curve for manual picks of a shot. 2D only!
# ''' '''
# import matplotlib.pyplot as plt import matplotlib.pyplot as plt
# plt.interactive('True') plt.interactive('True')
# manualpicktimesarray = [] manualpicktimesarray = []
# dist_medarray = []
# i = 1 for traceID in self.picks.keys():
# for traceID in self.manualpicks.keys(): if not traceID in self.manualpicks.keys() or self.getManualPickFlag(traceID) == 0:
# if self.manualpicks[traceID][0] <= 0: manualpicktimesarray.append(None)
# manualpicktimesarray.append(None) else:
# else: manualpicktimesarray.append(self.getManualPick(traceID))
# manualpicktimesarray.append(self.manualpicks[traceID][0])
# i += 1
# plt.plot(self.getDistArray4ttcPlot(), manualpicktimesarray, 'b', label = "manual") if ax is None:
fig = plt.figure()
ax = fig.add_subplot(111)
plotarray = sorted(zip(self.getDistArray4ttcPlot(), manualpicktimesarray))
x = []; y = []
for point in plotarray:
x.append(point[0])
y.append(point[1])
ax.plot(x, y, 'b', label = "Manual Picks")
# def plotpickwindow(self): ########## 2D ########## # def plotpickwindow(self): ########## 2D ##########
# ''' # '''