Use maximum of HOS/AR-CF instead of AIC-CF to start searching for global minimum in AIC function.
This commit is contained in:
parent
6563b01293
commit
f4a76680ad
@ -172,21 +172,14 @@ class AICPicker(AutoPicker):
|
|||||||
aicsmooth[i] = aicsmooth[i - 1] + (aic[i] - aic[ii1]) / ismooth
|
aicsmooth[i] = aicsmooth[i - 1] + (aic[i] - aic[ii1]) / ismooth
|
||||||
else:
|
else:
|
||||||
aicsmooth[i] = np.mean(aic[1: i])
|
aicsmooth[i] = np.mean(aic[1: i])
|
||||||
# remove offset
|
# remove offset in AIC function
|
||||||
offset = abs(min(aic) - min(aicsmooth))
|
offset = abs(min(aic) - min(aicsmooth))
|
||||||
aicsmooth = aicsmooth - offset
|
aicsmooth = aicsmooth - offset
|
||||||
# get maximum of 1st derivative of AIC-CF (more stable!) as starting point
|
# get maximum of HOS/AR-CF as startimg point for searching
|
||||||
diffcf = np.diff(aicsmooth)
|
# minimum in AIC function
|
||||||
# find NaN's
|
icfmax = np.argmax(self.Data[0].data)
|
||||||
nn = np.isnan(diffcf)
|
|
||||||
if len(nn) > 1:
|
|
||||||
diffcf[nn] = 0
|
|
||||||
# taper CF to get rid off side maxima
|
|
||||||
tap = np.hanning(len(diffcf))
|
|
||||||
diffcf = tap * diffcf * max(abs(aicsmooth))
|
|
||||||
icfmax = np.argmax(diffcf)
|
|
||||||
|
|
||||||
# find minimum in AIC-CF front of maximum
|
# find minimum in AIC-CF front of maximum of HOS/AR-CF
|
||||||
lpickwindow = int(round(self.PickWindow / self.dt))
|
lpickwindow = int(round(self.PickWindow / self.dt))
|
||||||
for i in range(icfmax - 1, max([icfmax - lpickwindow, 2]), -1):
|
for i in range(icfmax - 1, max([icfmax - lpickwindow, 2]), -1):
|
||||||
if aicsmooth[i - 1] >= aicsmooth[i]:
|
if aicsmooth[i - 1] >= aicsmooth[i]:
|
||||||
@ -195,6 +188,14 @@ class AICPicker(AutoPicker):
|
|||||||
# if no minimum could be found:
|
# if no minimum could be found:
|
||||||
# search in 1st derivative of AIC-CF
|
# search in 1st derivative of AIC-CF
|
||||||
if self.Pick is None:
|
if self.Pick is None:
|
||||||
|
diffcf = np.diff(aicsmooth)
|
||||||
|
# find NaN's
|
||||||
|
nn = np.isnan(diffcf)
|
||||||
|
if len(nn) > 1:
|
||||||
|
diffcf[nn] = 0
|
||||||
|
# taper CF to get rid off side maxima
|
||||||
|
tap = np.hanning(len(diffcf))
|
||||||
|
diffcf = tap * diffcf * max(abs(aicsmooth))
|
||||||
for i in range(icfmax - 1, max([icfmax - lpickwindow, 2]), -1):
|
for i in range(icfmax - 1, max([icfmax - lpickwindow, 2]), -1):
|
||||||
if diffcf[i - 1] >= diffcf[i]:
|
if diffcf[i - 1] >= diffcf[i]:
|
||||||
self.Pick = self.Tcf[i]
|
self.Pick = self.Tcf[i]
|
||||||
|
Loading…
Reference in New Issue
Block a user