Skip to content

Instantly share code, notes, and snippets.

@cdeil
Created August 4, 2014 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdeil/ca385fe7271a6a9bfdb2 to your computer and use it in GitHub Desktop.
Save cdeil/ca385fe7271a6a9bfdb2 to your computer and use it in GitHub Desktop.
=============================================================== FAILURES ================================================================
________________________________________________________ test_compute_npred_cube ________________________________________________________
@pytest.mark.skipif('not HAS_SCIPY')
def test_compute_npred_cube():
# A quickly implemented check - should be improved
filenames = FermiGalacticCenter.filenames()
spectral_cube = GammaSpectralCube.read(filenames['diffuse_model'])
exposure_cube = GammaSpectralCube.read(filenames['exposure_cube'])
counts_cube = FermiGalacticCenter.counts()
energy_bounds = Quantity([10, 30, 100, 500], 'GeV')
# Reproject spectral cube onto exposure cube
spectral_cube = spectral_cube.reproject_to(exposure_cube)
# Compute npred cube
npred_cube = compute_npred_cube(spectral_cube,
exposure_cube,
energy_bounds)
expected_sum = counts_cube.data.sum()
actual_sum = np.nan_to_num(npred_cube.data).sum()
# Check npredicted is same order of magnitude of true counts
assert_allclose(expected_sum, actual_sum, rtol=1)
# PSF convolve the npred cube
npred_cube_convolved = convolve_npred_cube(npred_cube, max_offset=3,
> resolution=0.1)
E TypeError: convolve_npred_cube() takes at least 3 arguments (3 given)
gammapy/spectral_cube/tests/test_core.py:164: TypeError
_______________________________________________________ test_convolve_npred_cube ________________________________________________________
@pytest.mark.skipif('not HAS_SCIPY')
def test_convolve_npred_cube():
filenames = FermiGalacticCenter.filenames()
spectral_cube = GammaSpectralCube.read(filenames['diffuse_model'])
exposure_cube = GammaSpectralCube.read(filenames['exposure_cube'])
energy_bounds = Quantity([10, 30, 100, 500], 'GeV')
# Reproject spectral cube onto exposure cube
spectral_cube = spectral_cube.reproject_to(exposure_cube)
# Compute npred cube
npred_cube = compute_npred_cube(spectral_cube,
exposure_cube,
energy_bounds)
# PSF convolve the npred cube
npred_cube_convolved = convolve_npred_cube(npred_cube, max_offset=5,
> resolution=1)
E TypeError: convolve_npred_cube() takes at least 3 arguments (3 given)
gammapy/spectral_cube/tests/test_core.py:189: TypeError
================================ 2 failed, 167 passed, 9 skipped, 20 xfailed, 4 xpassed in 27.94 seconds ================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment