Improve derivation of CORSIKA limits and allow to define a loss fraction per energy bin ('differential loss').#2185
Draft
GernotMaier wants to merge 19 commits into
Draft
Improve derivation of CORSIKA limits and allow to define a loss fraction per energy bin ('differential loss').#2185GernotMaier wants to merge 19 commits into
GernotMaier wants to merge 19 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the CORSIKA limit derivation workflow to optionally compute “differential” (per-energy-bin) loss limits and enhances plotting to display the resulting limit curves, aiming to make derived limits less sensitive to the simulation spectral index.
Changes:
- Add a new CLI/config option
differential_loss_bins_per_decadeand propagate it through the CORSIKA limits grid execution. - Implement differential per-energy-bin limit computation and expose the resulting curves for plotting.
- Update event energy binning to use decade-aligned bins and adjust unit/integration tests accordingly.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/simtools/production_configuration/derive_corsika_limits.py | Adds differential-limit computation path and per-energy-slice limit extraction utilities. |
| src/simtools/applications/production_derive_corsika_limits.py | Adds CLI argument for enabling/configuring differential loss binning. |
| src/simtools/sim_events/histograms.py | Changes energy bin edges to decade-aligned binning (10 bins/decade). |
| src/simtools/visualization/plot_simtel_event_histograms.py | Extends limit mapping and plotting to support drawing differential limit curves. |
| tests/unit_tests/production_configuration/test_derive_corsika_limits.py | Adds/updates unit tests for differential mode and argument propagation. |
| tests/unit_tests/sim_events/test_histograms.py | Updates expected energy bin structure for new decade-aligned binning. |
| tests/unit_tests/visualization/test_plot_simtel_event_histograms.py | Updates plotting tests for curve rendering and revised line behavior. |
| tests/integration_tests/config/production_derive_corsika_limits_hdf5_db_arrays.yml | Enables differential loss mode in an integration config. |
| docs/changes/2185.feature.md | Adds changelog fragment for the new capability. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Base automatically changed from
parallel-derive-corsika-grids-correct-base
to
main
May 13, 2026 11:28
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




A new config value allows to trigger a event loss fraction calculation per energy bin (e.g.,
--differential_loss_bins_per_decade=5). Energy bins are chosen as bins per decade, with bins aligned to the decades (e.g., lower limit to 100 GeV).The limit chosen (at this point) is the max of the differential limit.
Motivation is to get a better handle on the impact of the power law used to select the energies in the simulations. Limits should also be independent of the power-law index chosen.
Improve the plotting and plot the differential limit in the 2D plots.