in make_counts in gammapy/makers/map.py, check if the geometry is actually a region, fixing failing test
@@ -14,7 +14,7 @@ from .utils import (
make_map_background_irf,
make_map_exposure_true_energy,
make_psf_map,
- make_counts_rad_max
+ make_counts_rad_max,
)
__all__ = ["MapDatasetMaker"]
@@ -82,9 +82,9 @@ class MapDatasetMaker(Maker):
counts : `~gammapy.maps.Map`
Counts map.
"""
- if isinstance(geom.region, PointSkyRegion):
+ if geom.is_region and isinstance(geom.region, PointSkyRegion):
counts = make_counts_rad_max(geom, observation)
- elif isinstance(geom.region, CircleSkyRegion):
+ else:
counts = Map.from_geom(geom)
counts.fill_events(observation.events)
return counts
