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 3 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
13 changes: 12 additions & 1 deletion lstchain/tools/lstchain_create_irf_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,17 @@ 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
edisp_header = fits.Header()
edisp_header["FIXEDNRM"] = True
for k, v in extra_headers.items():
edisp_header[k] = v

morcuended marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -575,7 +586,7 @@ def start(self):
fov_offset_bins,
point_like=self.point_like,
extname="ENERGY DISPERSION",
**extra_headers,
**edisp_header,
morcuended marked this conversation as resolved.
Show resolved Hide resolved
)
)
self.log.info("Energy Dispersion HDU created")
Expand Down
Loading