Taper CF before calculating AIC.

This commit is contained in:
ludger 2019-11-14 16:47:16 +01:00
parent 98e429d8fd
commit 8419fc9681
2 changed files with 7 additions and 2 deletions

View File

@ -14,7 +14,8 @@ from pylot.core.io.phases import readPILOTEvent, picks_from_picksdict, \
from pylot.core.util.errors import FormatError, OverwriteError from pylot.core.util.errors import FormatError, OverwriteError
from pylot.core.util.event import Event from pylot.core.util.event import Event
from pylot.core.util.obspyDMT_interface import qml_from_obspyDMT from pylot.core.util.obspyDMT_interface import qml_from_obspyDMT
from pylot.core.util.utils import fnConstructor, full_range, check4rotated, check4gapsAndMerge, trim_station_components from pylot.core.util.utils import fnConstructor, full_range, check4rotated, \
check4gapsAndMerge, trim_station_components
class Data(object): class Data(object):

View File

@ -18,6 +18,7 @@ autoregressive prediction: application ot local and regional distances, Geophys.
""" """
import numpy as np import numpy as np
from scipy import signal
from obspy.core import Stream from obspy.core import Stream
@ -225,6 +226,8 @@ class AICcf(CharacteristicFunction):
ind = np.where(~np.isnan(xnp))[0] ind = np.where(~np.isnan(xnp))[0]
if ind.size: if ind.size:
xnp[:ind[0]] = xnp[ind[0]] xnp[:ind[0]] = xnp[ind[0]]
xnp = signal.tukey(len(xnp), alpha=0.05) * xnp
xnp = xnp - np.mean(xnp)
datlen = len(xnp) datlen = len(xnp)
k = np.arange(1, datlen) k = np.arange(1, datlen)
cf = np.zeros(datlen) cf = np.zeros(datlen)
@ -302,6 +305,7 @@ class HOScf(CharacteristicFunction):
if ind.size: if ind.size:
first = ind[0] first = ind[0]
LTA[:first] = LTA[first] LTA[:first] = LTA[first]
self.cf = LTA self.cf = LTA
self.xcf = x self.xcf = x