Relaxed condition for slope determination, plot interims results even if picking failed.
This commit is contained in:
parent
d4b76bdecb
commit
3845e7291e
@ -253,7 +253,7 @@ class AICPicker(AutoPicker):
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
print("Slope Calculation: empty array islope, check signal window")
|
print("Slope Calculation: empty array islope, check signal window")
|
||||||
return
|
return
|
||||||
if len(dataslope) <= 2:
|
if len(dataslope) < 2:
|
||||||
print('No or not enough data in slope window found!')
|
print('No or not enough data in slope window found!')
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
@ -300,8 +300,9 @@ class AICPicker(AutoPicker):
|
|||||||
datafit = np.polyval(P, xslope)
|
datafit = np.polyval(P, xslope)
|
||||||
if datafit[0] >= datafit[-1]:
|
if datafit[0] >= datafit[-1]:
|
||||||
print('AICPicker: Negative slope, bad onset skipped!')
|
print('AICPicker: Negative slope, bad onset skipped!')
|
||||||
return
|
#return
|
||||||
self.slope = 1 / (len(dataslope) * self.Data[0].stats.delta) * (datafit[-1] - datafit[0])
|
else:
|
||||||
|
self.slope = 1 / (len(dataslope) * self.Data[0].stats.delta) * (datafit[-1] - datafit[0])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.SNR = None
|
self.SNR = None
|
||||||
@ -342,8 +343,11 @@ class AICPicker(AutoPicker):
|
|||||||
label='Slope Window')
|
label='Slope Window')
|
||||||
ax2.plot(self.Tcf[iislope], datafit, 'g', linewidth=2, label='Slope')
|
ax2.plot(self.Tcf[iislope], datafit, 'g', linewidth=2, label='Slope')
|
||||||
|
|
||||||
ax1.set_title('Station %s, SNR=%7.2f, Slope= %12.2f counts/s' % (self.Data[0].stats.station,
|
if self.slope is not None:
|
||||||
self.SNR, self.slope))
|
ax1.set_title('Station %s, SNR=%7.2f, Slope= %12.2f counts/s' % (self.Data[0].stats.station,
|
||||||
|
self.SNR, self.slope))
|
||||||
|
else:
|
||||||
|
ax1.set_title('Station %s, SNR=%7.2f' % (self.Data[0].stats.station, self.SNR))
|
||||||
ax2.set_xlabel('Time [s] since %s' % self.Data[0].stats.starttime)
|
ax2.set_xlabel('Time [s] since %s' % self.Data[0].stats.starttime)
|
||||||
ax2.set_ylabel('Counts')
|
ax2.set_ylabel('Counts')
|
||||||
ax2.set_yticks([])
|
ax2.set_yticks([])
|
||||||
|
Loading…
Reference in New Issue
Block a user