Add the dataset.mask
@@ -239,6 +239,8 @@ class TSMapEstimator(Estimator):
# Creating exposure map with the mean non-null exposure
exposure = Map.from_geom(geom, unit="cm2 s1")
exposure_mask = (dataset.exposure.data > 0.) & np.isfinite(dataset.exposure.data)
+ if dataset.mask:
+ exposure_mask &= dataset.mask.data
exposure.data[...] = np.mean(dataset.exposure.quantity[exposure_mask].to_value(exposure.unit))
# We use global evaluation mode to not modify the geometry
