SimulatedEventsInfo

class pyirf.simulations.SimulatedEventsInfo(n_showers, energy_min, energy_max, max_impact, spectral_index, viewcone_min, viewcone_max)[source]

Bases: object

Information about all simulated events, for calculating event weights.

Attributes:
n_showers: int

Total number of simulated showers. If reuse was used, this should already include the reuse.

energy_min: u.Quantity[energy]

Lower limit of the simulated energy range

energy_max: u.Quantity[energy]

Upper limit of the simulated energy range

max_impact: u.Quantity[length]

Maximum simulated impact parameter

spectral_index: float

Spectral Index of the simulated power law with sign included.

viewcone_min: u.Quantity[angle]

Inner angle of the viewcone

viewcone_max: u.Quantity[angle]

Outer angle of the viewcone

Attributes Summary

energy_max

Upper limit of the simulated energy range

energy_min

Lower limit of the simulated energy range

max_impact

Maximum simualted impact radius

n_showers

Total number of simulated showers, if reuse was used, this must already include reuse

spectral_index

Spectral index of the simulated power law with sign included

viewcone_max

Outer viewcone angle

viewcone_min

Inner viewcone angle

Methods Summary

calculate_n_showers_per_energy(energy_bins)

Calculate number of showers that were simulated in the given energy intervals

calculate_n_showers_per_energy_and_fov(...)

Calculate number of showers that were simulated in the given energy and fov bins.

calculate_n_showers_per_fov(fov_bins)

Calculate number of showers that were simulated in the given fov bins.

Attributes Documentation

energy_max

Upper limit of the simulated energy range

energy_min

Lower limit of the simulated energy range

max_impact

Maximum simualted impact radius

n_showers

Total number of simulated showers, if reuse was used, this must already include reuse

spectral_index

Spectral index of the simulated power law with sign included

viewcone_max

Outer viewcone angle

viewcone_min

Inner viewcone angle

Methods Documentation

calculate_n_showers_per_energy(energy_bins)[source]

Calculate number of showers that were simulated in the given energy intervals

This assumes the events were generated and from a powerlaw like CORSIKA simulates events.

Parameters:
energy_bins: astropy.units.Quantity[energy]

The interval edges for which to calculate the number of simulated showers

Returns:
n_showers: numpy.ndarray

The expected number of events inside each of the energy_bins. This is a floating point number. The actual numbers will follow a poissionian distribution around this expected value.

calculate_n_showers_per_energy_and_fov(energy_bins, fov_bins)[source]

Calculate number of showers that were simulated in the given energy and fov bins.

This assumes the events were generated uniformly distributed per solid angle, and from a powerlaw in energy like CORSIKA simulates events.

Parameters:
energy_bins: astropy.units.Quantity[energy]

The energy bin edges for which to calculate the number of simulated showers

fov_bins: astropy.units.Quantity[angle]

The FOV bin edges for which to calculate the number of simulated showers

Returns:
n_showers: numpy.ndarray(ndim=2)

The expected number of events inside each of the energy_bins and fov_bins. Dimension (n_energy_bins, n_fov_bins) This is a floating point number. The actual numbers will follow a poissionian distribution around this expected value.

calculate_n_showers_per_fov(fov_bins)[source]

Calculate number of showers that were simulated in the given fov bins.

This assumes the events were generated uniformly distributed per solid angle, like CORSIKA simulates events with the VIEWCONE option.

Parameters:
fov_bins: astropy.units.Quantity[angle]

The FOV bin edges for which to calculate the number of simulated showers

Returns:
n_showers: numpy.ndarray(ndim=2)

The expected number of events inside each of the fov_bins. This is a floating point number. The actual numbers will follow a poissionian distribution around this expected value.