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 for scaling true energy in IRFs to assess energy-scale systematics #1261

Merged
merged 35 commits into from
Jul 8, 2024

Conversation

deborahDOR
Copy link
Collaborator

@deborahDOR deborahDOR commented Jun 7, 2024

Modifications of the code for the consideration of systematics in the energy.
The goal is to generate modified IRFs due to the effect of a lower or higher light efficiency in the system (telescope + atmosphere) with respect to simulations, by scaling the true energy values in MC simulations.

The changes are:

  • A new argument in the DataBinning Component in lstchain/io/event_selection.py : "scale true energy" (value that will be applied in the true energy values of the events of the MC files)
  • Add "scale true energy" in the irf_dl3_config_tool.json in the DataBinning section (only if the value is different from 1, it will be considered in the computation).
  • Changes in lstchain_create_irfs_files.py to modify the values when pyrif commands are used. Added comments to describe how it can be used and its effects.

@morcuended morcuended changed the title Energy systematics in irfs Allow for scaling true energy in IRFs to assess energy-scale systematics Jun 7, 2024
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.35%. Comparing base (7f92595) to head (e999002).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1261      +/-   ##
==========================================
+ Coverage   73.28%   73.35%   +0.07%     
==========================================
  Files         134      134              
  Lines       14084    14117      +33     
==========================================
+ Hits        10321    10356      +35     
+ Misses       3763     3761       -2     

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

Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @deborahDOR, it looks good to me, I just left some comments regarding the description of the new energy scaling factor. Maybe also try to add a small unit test for this (?)

lstchain/tools/lstchain_create_irf_files.py Outdated Show resolved Hide resolved
lstchain/tools/lstchain_create_irf_files.py Outdated Show resolved Hide resolved
Upload of the modifications suggested.
Add alias and header for 'scale_true_energy' component.
deborahDOR and others added 5 commits July 2, 2024 14:03
Add a test for verification of the validation of modified IRFs
Need to be refined because only few events.
Change the directories for config files.
Update new test for energy sclaing in IRFs which has been verified and adapted.
lstchain/tools/tests/test_tools.py Outdated Show resolved Hide resolved
docs/examples/irf_dl3_tool_config_mod.json Outdated Show resolved Hide resolved
Use only one config_file for the test for energy scaling in irfs
Remove --point-like argument
Remove additional comments.
chaimain
chaimain previously approved these changes Jul 4, 2024
@chaimain chaimain requested a review from morcuended July 4, 2024 07:01
@deborahDOR deborahDOR removed the request for review from SeiyaNozaki July 4, 2024 07:04
Cleaning of code for assert lines
morcuended
morcuended previously approved these changes Jul 4, 2024
Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks @deborahDOR and @chaimain

lstchain/tools/tests/test_tools.py Outdated Show resolved Hide resolved
morcuended
morcuended previously approved these changes Jul 4, 2024
chaimain
chaimain previously approved these changes Jul 4, 2024
@chaimain chaimain dismissed stale reviews from morcuended and themself via 980aabe July 8, 2024 09:00
@chaimain chaimain requested a review from morcuended July 8, 2024 09:20
@rlopezcoto rlopezcoto merged commit ef91c64 into main Jul 8, 2024
9 checks passed
@maxnoe maxnoe deleted the energy_systematics_in_irfs branch July 8, 2024 10:38
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.

6 participants