Commit 1e254428 authored by Marius's avatar Marius
Browse files

ifc: use scipy fftconvolve instead of numpy convolve.

parent a9b0c4b1
import sys
import logging
import numpy as num
from scipy.signal import fftconvolve
from pyrocko.guts import Object, String, Float
from pyrocko import trace, autopick, util
from lassie import shifter, common
......@@ -60,13 +61,12 @@ class WavePacketIFC(IFC):
tr.highpass(4, self.fmin, demean=True)
tr.lowpass(4, self.fmax, demean=False)
tr.ydata = tr.ydata**2
n = int(num.round(1./fsmooth / tr.deltat))
taper = num.hanning(n)
tr.set_ydata(num.convolve(tr.get_ydata(), taper))
tr.set_ydata(fftconvolve(tr.get_ydata(), taper))
tr.set_ydata(num.maximum(tr.ydata, 0.0))
tr.shift(-(n/2.*tr.deltat))
try:
tr.downsample_to(deltat_cf, snap=True, demean=False)
except util.UnavailableDecimation as e:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment