fisspy/analysis/filter.py
def FourierFilter(data, nt, dt, filterRange, axis=0):
    """
    Apply the Fourier bandpass filter.

    Parameters
    ----------
    data: `~numpy.ndarray`
        N-dimensional array.
    nt: `int`
        The number of the time domain.
    dt: `float`
        Bin size of the time domain.
    filterRange: `list`
        Bandpass filter range.
    axis: `int`
        time axis of the data.
    """
    if data.dtype == '>f8':
        data = data.astype(float)
    freq = fftfreq(nt, dt)
    if filterRange[0] == None:
        filterRange[0] = 0
    if filterRange[1] == None:
        filterRange[1] = freq.max()
    filt = np.logical_or(np.abs(freq) < filterRange[0],
                         np.abs(freq) > filterRange[1])
    fdata = fft(data, axis=axis)
    fdata[filt] = 0
    return ifft(fdata, axis=axis).real

    Apply the Fourier bandpass filter.

    Parameters
    ----------
    data: `~numpy.ndarray`
        N-dimensional array.
    nt: `int`
        The number of the time domain.
    dt: `float`
        Bin size of the time domain.
    filterRange: `list`
        Bandpass filter range.
    axis: `int`
        time axis of the data.
    
Apply the Fourier bandpass filter.
Parameters


Apply the Fourier bandpass filter . Parameters
def FourierFilter(data, nt, dt, filterRange, axis=0):
    if data.dtype == '>f8':
        data = data.astype(float)
    freq = fftfreq(nt, dt)
    if filterRange[0] == None:
        filterRange[0] = 0
    if filterRange[1] == None:
        filterRange[1] = freq.max()
    filt = np.logical_or(np.abs(freq) < filterRange[0],
                         np.abs(freq) > filterRange[1])
    fdata = fft(data, axis=axis)
    fdata[filt] = 0
    return ifft(fdata, axis=axis).real
def FourierFilter ( data , nt , dt , filterRange , axis = 0 ) : if data . dtype == '>f8' : data = data . astype ( float ) freq = fftfreq ( nt , dt ) if filterRange [ 0 ] == None : filterRange [ 0 ] = 0 if filterRange [ 1 ] == None : filterRange [ 1 ] = freq . max ( ) filt = np . logical_or ( np . abs ( freq ) < filterRange [ 0 ] , np . abs ( freq ) > filterRange [ 1 ] ) fdata = fft ( data , axis = axis ) fdata [ filt ] = 0 return ifft ( fdata , axis = axis ) . real
Apply the Fourier bandpass filter.
Apply the Fourier bandpass filter .
"""
    Apply the Fourier bandpass filter.

    Parameters
    ----------
    data: `~numpy.ndarray`
        N-dimensional array.
    nt: `int`
        The number of the time domain.
    dt: `float`
        Bin size of the time domain.
    filterRange: `list`
        Bandpass filter range.
    axis: `int`
        time axis of the data.
    """
data
nt
dt
filterRange
axis