Remove state from ExcessMapEstimator
@@ -114,11 +114,11 @@ class ExcessMapEstimator(Estimator):
geom = dataset.counts.geom
- self.counts_stat = convolved_map_dataset_counts_statistics(dataset, kernel)
+ counts_stat = convolved_map_dataset_counts_statistics(dataset, kernel)
- n_on = Map.from_geom(geom, data=self.counts_stat.n_on)
- bkg = Map.from_geom(geom, data=self.counts_stat.n_on - self.counts_stat.excess)
- excess = Map.from_geom(geom, data=self.counts_stat.excess)
+ n_on = Map.from_geom(geom, data=counts_stat.n_on)
+ bkg = Map.from_geom(geom, data=counts_stat.n_on - counts_stat.excess)
+ excess = Map.from_geom(geom, data=counts_stat.excess)
result = {"counts": n_on, "background": bkg, "excess": excess}
@@ -126,22 +126,22 @@ class ExcessMapEstimator(Estimator):
steps = ["ts", "err", "errn-errp", "ul"]
if "ts" in steps:
- tsmap = Map.from_geom(geom, data=self.counts_stat.delta_ts)
- significance = Map.from_geom(geom, data=self.counts_stat.significance)
+ tsmap = Map.from_geom(geom, data=counts_stat.delta_ts)
+ significance = Map.from_geom(geom, data=counts_stat.significance)
result.update({"ts": tsmap, "significance": significance})
if "err" in steps:
- err = Map.from_geom(geom, data=self.counts_stat.error)
+ err = Map.from_geom(geom, data=counts_stat.error)
result.update({"err": err})
if "errn-errp" in steps:
- errn = Map.from_geom(geom, data=self.counts_stat.compute_errn(self.n_sigma))
- errp = Map.from_geom(geom, data=self.counts_stat.compute_errp(self.n_sigma))
+ errn = Map.from_geom(geom, data=counts_stat.compute_errn(self.n_sigma))
+ errp = Map.from_geom(geom, data=counts_stat.compute_errp(self.n_sigma))
result.update({"errn": errn, "errp": errp})
if "ul" in steps:
ul = Map.from_geom(
- geom, data=self.counts_stat.compute_upper_limit(self.n_sigma_ul)
+ geom, data=counts_stat.compute_upper_limit(self.n_sigma_ul)
)
result.update({"ul": ul})
return result
