Skip to content

Commit

Permalink
Merge pull request #1164 from cta-observatory/fix_edisp_v0.9
Browse files Browse the repository at this point in the history
Properly normalize edisp in lstchain v0.9
  • Loading branch information
maxnoe authored Sep 25, 2023
2 parents b333971 + 9fc20e4 commit 375fd1b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lstchain/tools/lstchain_create_irf_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,12 @@ def start(self):
fov_offset_bins,
migration_bins,
)
# Different normalization of EDISP had been assumed so far (to the sum of 1).
# According to GADF definition, it should be normalized to the integral of 1.
# This normalization definition is assumed in pyirf >= v0.10.0.
# See https://github.com/cta-observatory/pyirf/pull/250
bin_width = np.diff(migration_bins)
self.edisp /= bin_width[np.newaxis, :, np.newaxis]
self.hdus.append(
create_energy_dispersion_hdu(
self.edisp,
Expand All @@ -576,6 +582,7 @@ def start(self):
point_like=self.point_like,
extname="ENERGY DISPERSION",
**extra_headers,
FIXEDNRM=True,
)
)
self.log.info("Energy Dispersion HDU created")
Expand Down

0 comments on commit 375fd1b

Please sign in to comment.