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

Allow using custom energy dependent cuts (e.g. based on sensitivity optimization) for IRFs and DL3 #1348

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

gabemery
Copy link
Collaborator

@gabemery gabemery commented Feb 5, 2025

Currently, IRF and DL3 creation tools only allow for global or energy-dependent gammaness, theta or alpha cuts calculated based on MC gamma-ray efficiency.

These changes introduce the option to provide custom previously calculated energy-dependent cuts on gammaness, theta or alpha during the IRFs creation. And provides associated metadata in the IRFs and DL3 files.

Why is it needed : Allows to provide energy dependent cuts based on criteria different from gamma efficiency. Such as best sensitivity.

Tool usage change with the new implementation :
Removed flags --energy-dependent-gh, --energy-dependent-theta and --energy-dependent-alpha and replaced them by a --cut_strategy-{gh, theta, alpha} which receives the technique used as a string input.

The implementation is near complete and can be reviewed, but some points need discussion/further work.
To do before merging :

  • (optionnal) Decide how to store the energy dependent cuts : Should the input be stored in the metadata? Before or after re-binning? Other strategy?
  • Implement tests

@gabemery gabemery self-assigned this Feb 5, 2025
@morcuended
Copy link
Member

morcuended commented Feb 7, 2025

Hi @gabemery, thanks for the implementation, I think it makes sense to support this. Maybe have a look at how it was recently done in ctapipe, so here we use similar naming and so on (cta-observatory/ctapipe#2473).

Specifically, they implement:
Two components for calculating G/H and optionally theta cuts are added:
PercentileCuts keeps a certain percentage of gamma events in each bin and (what we had already)
PointSourceSensitivityOptimizer optimizes G/H cuts for maximum point source sensitivity and
optionally calculates percentile theta cuts.

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.99%. Comparing base (76540cc) to head (87056e5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1348      +/-   ##
==========================================
+ Coverage   72.86%   72.99%   +0.12%     
==========================================
  Files         137      137              
  Lines       14515    14583      +68     
==========================================
+ Hits        10577    10645      +68     
  Misses       3938     3938              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gabemery
Copy link
Collaborator Author

gabemery commented Feb 7, 2025

@morcuended Thanks for bringing the ctapipe version to my attention. I will have a look and see what can be implemented without re-writing the full tool.

@gabemery
Copy link
Collaborator Author

gabemery commented Feb 7, 2025

After having a look, there is nothing to directly implement from the ctapipe irf production into this PR since the pipelines are very different.
It could be interesting to fully transition to the ctapipe tools later. But I would say this is out of the scope of this feature addition.

@moralejo
Copy link
Collaborator

@morcuended can you approve? I had a quick look and it seems ok to me, but probably you know this better.

@morcuended
Copy link
Member

Let me have a look first

@morcuended morcuended changed the title Energy dependent cuts for IRFs and DL3 Allow using custom energy dependent cuts (e.g. based on sensitivity optimization) for IRFs and DL3 Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants