Please describe the use case that requires this feature.
For upcoming CTAO simulation campaigns, they will start to test importance-sampling, i.e, generating non-powerlaw shower energy distributions and also non-flat spatial distributions. Our current event weighting code (and pyIRF itself) only support a simple power-law weighting function read from the SimulationConfig. We do however, have the full histogram and propegate it (/simulation/service/shower_distribution), and this can be used as the correct weighting function.
Importance sampled simulations are expected in ≈4-6 months.
Describe the solution you'd like
- Allow 2D weighting functions in the IRF/etc codes: energy (already there for the 1D case), offset from array center (needs to be added)
- Create a
HistogramShowerDistribution function that is a 2D interpolator over these parameters, using the shower_distribution.
Some preliminary implementation is in #2927 in the spectrum_from_simulation_config function, but only a stub where we would put this code. Some modification is needed in pyirf if we want to have the weighting function there, or we could keep pyirf simple and create a local weighting function in ctapipe.
Please describe the use case that requires this feature.
For upcoming CTAO simulation campaigns, they will start to test importance-sampling, i.e, generating non-powerlaw shower energy distributions and also non-flat spatial distributions. Our current event weighting code (and pyIRF itself) only support a simple power-law weighting function read from the SimulationConfig. We do however, have the full histogram and propegate it (
/simulation/service/shower_distribution), and this can be used as the correct weighting function.Importance sampled simulations are expected in ≈4-6 months.
Describe the solution you'd like
HistogramShowerDistributionfunction that is a 2D interpolator over these parameters, using theshower_distribution.Some preliminary implementation is in #2927 in the
spectrum_from_simulation_configfunction, but only a stub where we would put this code. Some modification is needed inpyirfif we want to have the weighting function there, or we could keeppyirfsimple and create a local weighting function inctapipe.