Update gammapy/scripts/tests/test_spectrum_pipe.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
-import numpy as np
-from numpy.testing import assert_allclose
-from astropy.tests.helper import pytest
from astropy.tests.helper import assert_quantity_allclose
import astropy.units as u
from ...utils.energy import EnergyBounds
@@ -14,22 +11,24 @@ from .. import SpectrumAnalysisIACT
def get_config():
"""Get test config, extend to several scenarios"""
- model = PowerLaw(index=2,
+ model = PowerLaw(
+ index=2,
amplitude=1e-11 * u.Unit('cm-2 s-1 TeV-1'),
- reference=1 * u.TeV)
- test_conf = dict(
+ reference=1 * u.TeV,
+ )
+ fp_binning = EnergyBounds.equal_log_spacing(1, 50, 4, 'TeV')
+ return dict(
outdir=None,
background=dict(on_region=on_region()),
extraction=dict(),
fit=dict(model=model),
- fp_binning=EnergyBounds.equal_log_spacing(
- 1, 50, 4, 'TeV')
+ fp_binning=fp_binning,
)
- return test_conf
@requires_data('gammapy-extra')
@requires_dependency('scipy')
+@requires_dependency('sherpa')
def test_spectrum_analysis_iact(tmpdir):
conf = get_config()
conf['outdir'] = tmpdir
