Browse Source

speed up preprocessing with pre_downsample_deltat option

weighting
Sebastian Heimann 2 years ago
parent
commit
d1850418e1
  1. 9
      src/ifc.py

9
src/ifc.py

@ -170,6 +170,7 @@ class WavePacketIFC(IFC):
fsmooth = Float.T(optional=True)
fsmooth_factor = Float.T(default=0.1)
pre_downsample_deltat = Float.T(optional=True)
def get_tpad(self):
return 4. / self.get_fsmooth()
@ -195,6 +196,10 @@ class WavePacketIFC(IFC):
trs_filt = []
for orig_tr in trs:
tr = orig_tr.copy()
if self.pre_downsample_deltat is not None:
tr.downsample_to(self.pre_downsample_deltat)
tr.bandpass(4, self.fmin, self.fmax, demean=True)
tr.ydata = tr.ydata**2
@ -249,6 +254,7 @@ class OnsetIFC(IFC):
fsmooth_factor = Float.T(optional=True)
fnormalize = Float.T(optional=True)
fnormalize_factor = Float.T(optional=True)
pre_downsample_deltat = Float.T(optional=True)
def get_tpad(self):
return 2. / self.get_fnormalize()
@ -288,6 +294,9 @@ class OnsetIFC(IFC):
trs_filt = []
for orig_tr in trs:
tr = orig_tr.copy()
if self.pre_downsample_deltat is not None:
tr.downsample_to(self.pre_downsample_deltat)
tr.highpass(4, self.fmin, demean=True)
tr.lowpass(4, self.fmax, demean=False)
tr.ydata = tr.ydata**2

Loading…
Cancel
Save