make exposure optional also for PSF
@@ -829,7 +829,7 @@ class MapDataset(Dataset):
edisp_map = Map.from_hdulist(hdulist, hdu="edisp")
try:
exposure_map = Map.from_hdulist(hdulist, hdu="edisp_exposure")
- except:
+ except KeyError:
exposure_map = None
if edisp_map.geom.axes[0].name == "energy":
kwargs["edisp"] = EDispKernelMap(edisp_map, exposure_map)
@@ -842,7 +842,10 @@ class MapDataset(Dataset):
if "PSF" in hdulist:
psf_map = Map.from_hdulist(hdulist, hdu="psf")
+ try:
exposure_map = Map.from_hdulist(hdulist, hdu="psf_exposure")
+ except KeyError:
+ exposure_map = None
kwargs["psf"] = PSFMap(psf_map, exposure_map)
if "MASK_SAFE" in hdulist:
