Exemplo n.º 1
0
def test_gauss_center():
    """Check the gaussian center fitting."""
    # make a 2d dataset with a gaussian at the center
    from astropy.convolution import Gaussian2DKernel
    gaussian_2D_kernel = Gaussian2DKernel(10)
    plots = Imexamine()
    plots.set_data(gaussian_2D_kernel.array)
    a, xx, yy, xs, ys = plots.gauss_center(37, 37)

    amp = 0.0015915494309189533
    xc = 40.0
    yc = 40.0
    xsig = 10.0
    ysig = 10.0

    assert_allclose(amp, a, 1e-6)
    assert_allclose(xc, xx, 1e-4)
    assert_allclose(yc, yy, 1e-4)
    assert_allclose(xsig, xs, 0.01)
    assert_allclose(ysig, ys, 0.01)
Exemplo n.º 2
0
def test_gauss_center():
    """Check the gaussian center fitting."""
    # make a 2d dataset with a gaussian at the center
    from astropy.convolution import Gaussian2DKernel
    gaussian_2D_kernel = Gaussian2DKernel(10)
    plots = Imexamine()
    plots.set_data(gaussian_2D_kernel.array)
    a, xx, yy, xs, ys = plots.gauss_center(37, 37)

    amp = 0.0015915494309189533
    xc = 40.0
    yc = 40.0
    xsig = 10.0
    ysig = 10.0

    assert_allclose(amp, a, 1e-6)
    assert_allclose(xc, xx, 1e-4)
    assert_allclose(yc, yy, 1e-4)
    assert_allclose(xsig, xs, 0.01)
    assert_allclose(ysig, ys, 0.01)
Exemplo n.º 3
0
def test_gauss_center():
    """Check the gaussian center fitting."""

    from astropy.convolution import Gaussian2DKernel

    # This creates a 2D normalized gaussian kernal with
    # a set amplitude. Guess off-center
    amp = 0.0015915494309189533
    size = 81.0
    sigma = 10.0

    gaussian_2D_kernel = Gaussian2DKernel(sigma, x_size=size, y_size=size)
    plots = Imexamine()
    plots.set_data(gaussian_2D_kernel.array)
    a, xx, yy, xs, ys = plots.gauss_center(37, 37)

    assert_allclose(amp, a, 1e-6)
    assert_allclose(size // 2, xx, 1e-6)
    assert_allclose(size // 2, yy, 1e-6)
    assert_allclose(sigma, xs, 0.01)
    assert_allclose(sigma, ys, 0.01)
Exemplo n.º 4
0
def test_gauss_center():
    """Check the gaussian center fitting."""

    from astropy.convolution import Gaussian2DKernel

    # This creates a 2D normalized gaussian kernal with
    # a set amplitude. Guess off-center
    amp = 0.0015915494309189533
    size = 81.0
    sigma = 10.0

    gaussian_2D_kernel = Gaussian2DKernel(sigma, x_size=size, y_size=size)
    plots = Imexamine()
    plots.set_data(gaussian_2D_kernel.array)
    a, xx, yy, xs, ys = plots.gauss_center(37, 37)

    assert_allclose(amp, a, 1e-6)
    assert_allclose(size // 2, xx, 1e-6)
    assert_allclose(size // 2, yy, 1e-6)
    assert_allclose(sigma, xs, 0.01)
    assert_allclose(sigma, ys, 0.01)