begin og test hawc
@@ -4,6 +4,7 @@ from numpy.testing import assert_allclose
import astropy.units as u
from astropy.utils.data import get_pkg_data_filename
from gammapy.catalog import SourceCatalog2HWC
+from gammapy.catalog.hawc import SourceCatalog3HWC
from gammapy.modeling.models import (
DiskSpatialModel,
PointSpatialModel,
@@ -104,3 +105,37 @@ class TestSourceCatalogObject2HWC:
assert_allclose(pos_err.width.value, 2 * 0.057 * scale_r95, rtol=1e-4)
assert_allclose(model.position.l.value, pos_err.center.l.value)
assert_allclose(model.position.b.value, pos_err.center.b.value)
+
+
+
+
+
+
+@pytest.fixture(scope="session")
+def cat():
+ return SourceCatalog3HWC()
+
+
+@requires_data()
+class TestSourceCatalog3HWC:
+ @staticmethod
+ def test_source_table(cat):
+ assert cat.tag == "3hwc"
+ assert len(cat.table) == 65
+
+ @staticmethod
+ def test_positions(cat):
+ assert len(cat.positions) == 65
+
+
+@requires_data()
+class TestSourceCatalogObject3HWC:
+ @staticmethod
+ def test_data(cat):
+ assert cat[0].data["source_name"] == "3HWC J1739+099"
+ assert cat[0].n_models == 0
+
+ assert cat[1].data["source_name"] == "3HWC J2043+443"
+ assert cat[1].n_models == 0.5
+
+
\ No newline at end of file
