Example #1
0
def test_construct_taper_tukey():
    npts = 21
    result = np.ones(npts)
    result[0] = 0.0
    result[1] = 0.5
    result[npts-1] = 0.0
    result[npts-2] = 0.5
    taper = util.construct_taper(npts, taper_type="tukey", alpha=0.2)
    npt.assert_allclose(taper, result)
Example #2
0
def test_construct_taper_hann():
    npts = 21
    taper = util.construct_taper(npts, taper_type="hann")
    assert len(taper) == npts
    assert taper[0] == 0.0 and taper[20] == 0.0
    assert taper[10] == 1.0
Example #3
0
def test_construct_taper_boxcar():
    npts = 21
    taper = util.construct_taper(npts, taper_type="boxcar")
    npt.assert_allclose(taper, np.ones(21))