Skip to content

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
mainfrom
differential-loss
Draft

Improve derivation of CORSIKA limits and allow to define a loss fraction per energy bin ('differential loss').#2185
GernotMaier wants to merge 19 commits into
mainfrom
differential-loss

Conversation

@GernotMaier
Copy link
Copy Markdown
Contributor

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.

@GernotMaier GernotMaier self-assigned this May 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_decade and 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.

Comment thread src/simtools/visualization/plot_simtel_event_histograms.py
Comment thread src/simtools/sim_events/histograms.py
Comment thread src/simtools/production_configuration/derive_corsika_limits.py Outdated
Comment thread src/simtools/production_configuration/derive_corsika_limits.py
GernotMaier and others added 6 commits May 13, 2026 13:06
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
@ctao-sonarqube
Copy link
Copy Markdown

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.

2 participants