-
Notifications
You must be signed in to change notification settings - Fork 8
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
Implement custom energy-dependent cuts for IRFs and DL3 creations #280
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #280 +/- ##
==========================================
+ Coverage 77.18% 77.51% +0.33%
==========================================
Files 22 22
Lines 2621 2660 +39
==========================================
+ Hits 2023 2062 +39
Misses 598 598 ☔ View full report in Codecov by Sentry. |
Thank you @gabemery. Very useful. I was just checking this quickly: there are if clauses inside an elif? (Maybe we can reformulate a bit this and through elifs). As for the new io function, I would suggest passing only the dictionary and string, instead of the whole config, so that we can try to keep backward compatibility (i.e., if the new 'entry' is not in the config, the script can exit w/o erros in the module), but this depends on if we want to create a new major version or not |
Hi @Elisa-Visentin , Thank you for the review. I was also a bit bothered by the elif : if, but I didn't have a clear idea of a better solution. Currently the structure is:
To avoid duplicating 35 lines of code, for the energy depedent case, it is needed to have the cuts recovery handled for both before the application. I can think of alternatives, but I am not sure which would be good. To give a few I can invent now :
|
This is possible without issue, it is only moving config["interpolate_kind"], and config["custom_cuts"] as input to the function instead of config.
For backward compatibility I think it is already ok, since the new entries are only read in the new io function, and in log.info messages in the if blocks for "custom" cuts. So I think there is nothing to change there. |
Hi, probably the most 'beautiful' solution is the last one, where a new function (which could also be defined inside the main function), so that we have only one if-elif-else statement, but I would suggest to wait for Alessio and Julian before changing this (maybe they have a better solution) |
I have to check this better.... (sorry, I'm quite busy and I'm working on too many things at the same time). Probably we should first fix the nested ifs, to be sure about where we call the involved function: if it is only in the 'elif custom', it should work fine |
These changes introduce the option to provide energy-dependent cuts on gammaness or theta 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.
Usage : In the config file