Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly normalize edisp in lstchain v0.9 #1164

Merged
merged 4 commits into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading