Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(8)  |  Derive(0)  |  Import(4)

src/a/s/astroML-0.2/book_figures/chapter10/fig_wiener_filter.py   astroML(Download)
 
from scipy import optimize, fftpack
from astroML.filters import savitzky_golay, wiener_filter
 
#----------------------------------------------------------------------
#------------------------------------------------------------
# Use the Savitzky-Golay filter to filter the values
h_sg = savitzky_golay(hN, window_size=201, order=4, use_fft=False)
 
#------------------------------------------------------------

src/a/s/astroML-HEAD/book_figures/chapter10/fig_wiener_filter.py   astroML(Download)
 
from scipy import optimize, fftpack
from astroML.filters import savitzky_golay, wiener_filter
 
#----------------------------------------------------------------------
#------------------------------------------------------------
# Use the Savitzky-Golay filter to filter the values
h_sg = savitzky_golay(hN, window_size=201, order=4, use_fft=False)
 
#------------------------------------------------------------

src/a/s/astroML-0.2/astroML/tests/test_filters.py   astroML(Download)
import numpy as np
from numpy.testing import assert_allclose
from astroML.filters import savitzky_golay, wiener_filter
 
 
def test_savitzky_golay():
    y = np.zeros(100)
    y[::2] = 1
    f = savitzky_golay(y, window_size=3, order=1)
    for width in [3, 5]:
        for order in range(width - 1):
            f1 = savitzky_golay(y, width, order, use_fft=False)
            f2 = savitzky_golay(y, width, order, use_fft=True)
            assert_allclose(f1, f2)

src/a/s/astroML-HEAD/astroML/tests/test_filters.py   astroML(Download)
import numpy as np
from numpy.testing import assert_allclose
from astroML.filters import savitzky_golay, wiener_filter
 
 
def test_savitzky_golay():
    y = np.zeros(100)
    y[::2] = 1
    f = savitzky_golay(y, window_size=3, order=1)
    for width in [3, 5]:
        for order in range(width - 1):
            f1 = savitzky_golay(y, width, order, use_fft=False)
            f2 = savitzky_golay(y, width, order, use_fft=True)
            assert_allclose(f1, f2)