Stabilized slope determination.
This commit is contained in:
parent
60c882fe04
commit
d7abd3bef9
@ -240,7 +240,15 @@ class AICPicker(AutoPicker):
|
|||||||
ax.set_yticks([])
|
ax.set_yticks([])
|
||||||
ax.set_title(self.Data[0].stats.station)
|
ax.set_title(self.Data[0].stats.station)
|
||||||
return
|
return
|
||||||
|
|
||||||
islope = islope[0][0:imax]
|
islope = islope[0][0:imax]
|
||||||
|
if len(islope) < 2:
|
||||||
|
# get local maximum of AIC function to calculate properly slope
|
||||||
|
islope = np.where((self.Tcf <= min([self.Pick + tslope, len(self.Data[0].data)])) \
|
||||||
|
& (self.Tcf >= self.Pick))
|
||||||
|
imax = np.argmax(aicsmooth[islope])
|
||||||
|
islope = islope[0][0:imax]
|
||||||
|
|
||||||
dataslope = self.Data[0].data[islope]
|
dataslope = self.Data[0].data[islope]
|
||||||
# calculate slope as polynomal fit of order 1
|
# calculate slope as polynomal fit of order 1
|
||||||
xslope = np.arange(0, len(dataslope), 1)
|
xslope = np.arange(0, len(dataslope), 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user