import numpy as np
from stingray.pulse.modeling import fitSinc

np.random.seed(0)

def test_sinc_function():
    x = np.linspace(-5., 5., 200)
    y = 2 * (np.sin(x)/x)**2
    y += np.random.normal(0., 0.1, x.shape)

    s = fitSinc(x,y)
    
    assert np.abs(s.mean) < 0.1 
    assert np.abs(s.amplitude - 2) < 0.1 
    assert np.abs(s.width - 1) < 0.1

@@ -76,16 +76,17 @@
 eed(0)%0A%0A
+%0A
 def test
@@ -349,8 +349,331 @@
 ) %3C 0.1%0A
+    %0A    %0Adef test_gaussian_function():%0A    x = np.linspace(-5., 5., 200)%0A    y = 2 * np.exp(-0.5 * (x - 1.3)**2 / 0.7**2)%0A    y += np.random.normal(0., 0.1, x.shape)%0A%0A    gs = fit_gaussian(x,y) %0A    %0A    assert np.abs(gs.mean - 1.3) %3C 0.1%0A    assert np.abs(gs.amplitude - 2) %3C 0.1%0A    assert np.abs(gs.stddev - 0.7) %3C 0.1%0A

add test for Gaussian fit