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 2 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
12 changes: 7 additions & 5 deletions lstchain/tools/lstchain_create_irf_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,13 @@ def start(self):
)
# 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
self.log.warning(
"Fixing EDISP normalization for v0.9 data products. The proper "
"normalization is assumed in lstchain v0.10.5 which uses pyirf >= v0.10.0"
)
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(
Expand All @@ -584,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