Exemplo n.º 1
0
def test_curve_of_growth():
    """Test the cog functionality."""
    from astropy.convolution import Gaussian2DKernel
    data = Gaussian2DKernel(1.5, x_size=25, y_size=25)
    plots = Imexamine()
    plots.set_data(data.array)
    x, y = plots.curve_of_growth(12, 12, genplot=False)

    rad = [1, 2, 3, 4, 5, 6, 7, 8]
    flux = [0.04535423476987057,
            0.34605795394960859,
            0.70094774639729907,
            0.89675381769455764,
            0.97242001951216395,
            0.99711765053819645,
            0.99965838382174854,
            0.99998044756724924]

    assert_array_equal(rad, x)
    assert_allclose(flux, y, 1e-6)
Exemplo n.º 2
0
def test_curve_of_growth():
    """Test the cog functionality."""
    from astropy.convolution import Gaussian2DKernel
    data = Gaussian2DKernel(1.5, x_size=25, y_size=25)
    plots = Imexamine()
    plots.set_data(data.array)
    x, y = plots.curve_of_growth(12, 12, genplot=False)

    rad = [1, 2, 3, 4, 5, 6, 7, 8]
    flux = [0.04535423476987057,
            0.34605795394960859,
            0.70094774639729907,
            0.89675381769455764,
            0.97242001951216395,
            0.99711765053819645,
            0.99965838382174854,
            0.99998044756724924]

    assert_array_equal(rad, x)
    assert_allclose(flux, y, 1e-6)
Exemplo n.º 3
0
def test_curve_of_growth():
    """Test the cog functionality."""
    from astropy.convolution import Gaussian2DKernel
    data = Gaussian2DKernel(1.5, x_size=25, y_size=25)
    plots = Imexamine()
    plots.set_data(data.array)
    rad_out, flux_out = plots.curve_of_growth(12, 12, genplot=False)

    rads = [1, 2, 3, 4, 5, 6, 7, 8]
    flux = []
    # Run the aperture phot on this to build up the expected fluxes
    plots.aper_phot_pars['genplot'][0] = False
    plots.aper_phot_pars['subsky'][0] = False

    for rad in rads:
        plots.aper_phot_pars['radius'][0] = rad
        plots.aper_phot(12, 12)
        flux.append(plots.total_flux)

    assert_array_equal(rads, rad_out)
    assert_allclose(flux, flux_out, 1e-6)
Exemplo n.º 4
0
def test_curve_of_growth():
    """Test the curve of growth functionality."""
    from astropy.convolution import Gaussian2DKernel
    data = Gaussian2DKernel(1.5, x_size=25, y_size=25)
    plots = Imexamine()
    plots.set_data(data.array)
    rad_out, flux_out = plots.curve_of_growth(12, 12, genplot=False)

    rads = [1, 2, 3, 4, 5, 6, 7, 8]
    flux = []

    # Run the aperture phot on this to build up the expected fluxes
    plots.aper_phot_pars['genplot'][0] = False
    plots.aper_phot_pars['subsky'][0] = False

    for rad in rads:
        plots.aper_phot_pars['radius'][0] = rad
        plots.aper_phot(12, 12)
        flux.append(plots.total_flux)

    assert_array_equal(rads, rad_out)
    assert_allclose(flux, flux_out, 1e-6)