@pytest.mark.skipif(u'not HAS_SCIPY')
def test_subpixel_gauss_2D():
 gauss_2D = Gaussian2D(1, 0, 0, 0.1, 0.1)
 values = discretize_model(gauss_2D, ((-1), 2), ((-1), 2), mode=u'integrate', factor=100)
 assert_allclose(values.sum(), ((2 * np.pi) * 0.01), atol=1e-05)

@ pytest . mark . skipif ( u'not HAS_SCIPY' ) def test_subpixel_gauss_2D ( ) : gauss_2D = Gaussian2D ( 1 , 0 , 0 , 0.1 , 0.1 ) values = discretize_model ( gauss_2D , ( ( - 1 ) , 2 ) , ( ( - 1 ) , 2 ) , mode = u'integrate' , factor = 100 ) assert_allclose ( values . sum ( ) , ( ( 2 * np . pi ) * 0.01 ) , atol = 1e-05 )
test subpixel accuracy of the oversample mode with gaussian 2d model .