removed most of the folm = 0.6 default values
This commit is contained in:
		
							parent
							
								
									3b4e1dcd1e
								
							
						
					
					
						commit
						3c1be950b9
					
				| @ -37,6 +37,7 @@ class SeismicShot(object): | |||||||
|         self.traces4plot = {} |         self.traces4plot = {} | ||||||
|         self.paras = {} |         self.paras = {} | ||||||
|         self.paras['shotname'] = obsfile |         self.paras['shotname'] = obsfile | ||||||
|  |         self.folm = None | ||||||
| 
 | 
 | ||||||
|     def removeEmptyTraces(self): |     def removeEmptyTraces(self): | ||||||
|         traceIDs = [] |         traceIDs = [] | ||||||
| @ -279,7 +280,7 @@ class SeismicShot(object): | |||||||
| 
 | 
 | ||||||
|         #raise ValueError('ambigious or empty traceID: %s' % traceID) |         #raise ValueError('ambigious or empty traceID: %s' % traceID) | ||||||
| 
 | 
 | ||||||
|     def pickTraces(self, traceID, windowsize, folm = 0.6, HosAic = 'hos'): ########## input variables ########## |     def pickTraces(self, traceID, windowsize, folm, HosAic = 'hos'): ########## input variables ########## | ||||||
|         # LOCALMAX NOT IMPLEMENTED! |         # LOCALMAX NOT IMPLEMENTED! | ||||||
|         ''' |         ''' | ||||||
|         Intitiate picking for a trace. |         Intitiate picking for a trace. | ||||||
| @ -299,7 +300,7 @@ class SeismicShot(object): | |||||||
|         :param: windowsize, window around the returned HOS picktime, to search for the AIC minumum |         :param: windowsize, window around the returned HOS picktime, to search for the AIC minumum | ||||||
|         :type: 'tuple' |         :type: 'tuple' | ||||||
| 
 | 
 | ||||||
|         :param: folm, fraction of local maximumm (default = 0.6) |         :param: folm, fraction of local maximumm | ||||||
|         :type: 'real' |         :type: 'real' | ||||||
| 
 | 
 | ||||||
|         :param: HosAic, get hos or aic pick (can be 'hos'(default) or 'aic') |         :param: HosAic, get hos or aic pick (can be 'hos'(default) or 'aic') | ||||||
| @ -308,6 +309,8 @@ class SeismicShot(object): | |||||||
|         hoscf = self.getHOScf(traceID) ### determination of both, HOS and AIC (need to change threshold-picker) ### |         hoscf = self.getHOScf(traceID) ### determination of both, HOS and AIC (need to change threshold-picker) ### | ||||||
|         aiccf = self.getAICcf(traceID) |         aiccf = self.getAICcf(traceID) | ||||||
| 
 | 
 | ||||||
|  |         self.folm = folm | ||||||
|  | 
 | ||||||
|         self.timeArray[traceID] = hoscf.getTimeArray() |         self.timeArray[traceID] = hoscf.getTimeArray() | ||||||
|         aiccftime, hoscftime = self.threshold(hoscf, aiccf, windowsize, self.getPickwindow(traceID), folm) |         aiccftime, hoscftime = self.threshold(hoscf, aiccf, windowsize, self.getPickwindow(traceID), folm) | ||||||
|         setHosAic = {'hos': hoscftime, |         setHosAic = {'hos': hoscftime, | ||||||
| @ -335,7 +338,7 @@ class SeismicShot(object): | |||||||
|         # self.picks[traceID]['spe'] *= 0.5 |         # self.picks[traceID]['spe'] *= 0.5 | ||||||
|         # TEST OF 1/2 PICKERROR |         # TEST OF 1/2 PICKERROR | ||||||
| 
 | 
 | ||||||
|     def threshold(self, hoscf, aiccf, windowsize, pickwindow, folm = 0.6): |     def threshold(self, hoscf, aiccf, windowsize, pickwindow, folm): | ||||||
|         ''' |         ''' | ||||||
|         Threshold picker, using the local maximum in a pickwindow to find the time at |         Threshold picker, using the local maximum in a pickwindow to find the time at | ||||||
|         which a fraction of the local maximum is reached for the first time. |         which a fraction of the local maximum is reached for the first time. | ||||||
| @ -355,7 +358,7 @@ class SeismicShot(object): | |||||||
|         :param: cutwindow [seconds], cut a part of the trace as in Characteristic Function |         :param: cutwindow [seconds], cut a part of the trace as in Characteristic Function | ||||||
|         :type: 'tuple' |         :type: 'tuple' | ||||||
| 
 | 
 | ||||||
|         :param: folm, fraction of local maximum (default = 0.6) |         :param: folm, fraction of local maximum | ||||||
|         :type: 'real' |         :type: 'real' | ||||||
|         ''' |         ''' | ||||||
|         hoscflist = list(hoscf.getCF()) |         hoscflist = list(hoscf.getCF()) | ||||||
| @ -663,7 +666,7 @@ class SeismicShot(object): | |||||||
|         ax.legend() |         ax.legend() | ||||||
|         ax.text(0.05, 0.9, 'SNR: %s' %snr, transform = ax.transAxes) |         ax.text(0.05, 0.9, 'SNR: %s' %snr, transform = ax.transAxes) | ||||||
| 
 | 
 | ||||||
|     def plot_traces(self, traceID, folm = 0.6): ########## 2D, muss noch mehr verbessert werden ########## |     def plot_traces(self, traceID): ########## 2D, muss noch mehr verbessert werden ########## | ||||||
|         from matplotlib.widgets import Button |         from matplotlib.widgets import Button | ||||||
| 
 | 
 | ||||||
|         def onclick(event): |         def onclick(event): | ||||||
| @ -688,6 +691,8 @@ class SeismicShot(object): | |||||||
|         def cleanup(event): |         def cleanup(event): | ||||||
|             self.traces4plot[traceID] = {} |             self.traces4plot[traceID] = {} | ||||||
| 
 | 
 | ||||||
|  |         folm = self.folm | ||||||
|  | 
 | ||||||
|         fig = plt.figure() |         fig = plt.figure() | ||||||
|         ax1 = fig.add_subplot(2,1,1) |         ax1 = fig.add_subplot(2,1,1) | ||||||
|         ax2 = fig.add_subplot(2,1,2, sharex = ax1) |         ax2 = fig.add_subplot(2,1,2, sharex = ax1) | ||||||
| @ -745,7 +750,7 @@ class SeismicShot(object): | |||||||
|         ax.legend() |         ax.legend() | ||||||
|         return ax |         return ax | ||||||
| 
 | 
 | ||||||
|     def _drawCFs(self, traceID, folm, refresh = False): |     def _drawCFs(self, traceID, folm = None, refresh = False): | ||||||
|         hoscf = self.getHOScf(traceID) |         hoscf = self.getHOScf(traceID) | ||||||
|         aiccf = self.getAICcf(traceID) |         aiccf = self.getAICcf(traceID) | ||||||
|         ax = self.traces4plot[traceID]['ax2'] |         ax = self.traces4plot[traceID]['ax2'] | ||||||
| @ -773,6 +778,7 @@ class SeismicShot(object): | |||||||
|                     [ax.get_ylim()[0], |                     [ax.get_ylim()[0], | ||||||
|                      ax.get_ylim()[1]], |                      ax.get_ylim()[1]], | ||||||
|                     'b:', label = 'latest') |                     'b:', label = 'latest') | ||||||
|  |         if folm is not None: | ||||||
|             ax.plot([0, self.getPick(traceID)], |             ax.plot([0, self.getPick(traceID)], | ||||||
|                     [folm * max(hoscf.getCF()), folm * max(hoscf.getCF())], |                     [folm * max(hoscf.getCF()), folm * max(hoscf.getCF())], | ||||||
|                     'm:', label = 'folm = %s' %folm) |                     'm:', label = 'folm = %s' %folm) | ||||||
| @ -834,7 +840,7 @@ class SeismicShot(object): | |||||||
| 
 | 
 | ||||||
|         plotmethod[method](*args) |         plotmethod[method](*args) | ||||||
| 
 | 
 | ||||||
|     def matshow(self, ax = None, step = 0.5, method = 'linear', plotRec = True, annotations = True, colorbar = True): |     def matshow(self, ax = None, step = 0.5, method = 'linear', plotRec = True, annotations = True, colorbar = True, legend = True): | ||||||
|         ''' |         ''' | ||||||
|         Plots a 2D matrix of the interpolated traveltimes. This needs less performance than plot3dttc |         Plots a 2D matrix of the interpolated traveltimes. This needs less performance than plot3dttc | ||||||
| 
 | 
 | ||||||
| @ -899,6 +905,7 @@ class SeismicShot(object): | |||||||
|             cbar = plt.colorbar(sc) |             cbar = plt.colorbar(sc) | ||||||
|             cbar.set_label('Time [s]') |             cbar.set_label('Time [s]') | ||||||
| 
 | 
 | ||||||
|  |         if legend == True: | ||||||
|             ax.legend() |             ax.legend() | ||||||
|         ax.set_xlabel('X') |         ax.set_xlabel('X') | ||||||
|         ax.set_ylabel('Y') |         ax.set_ylabel('Y') | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user