background_2d

pyirf.irf.background_2d(events, reco_energy_bins, fov_offset_bins, t_obs)[source]

Calculate background rates in radially symmetric bins in the field of view.

GADF documentation here: https://gamma-astro-data-formats.readthedocs.io/en/latest/irfs/full_enclosure/bkg/index.html#bkg-2d

Parameters:
events: astropy.table.QTable

DL2 events table of the selected background events. Needed columns for this function: reco_source_fov_offset, reco_energy, weight

reco_energy: astropy.units.Quantity[energy]

The bins in reconstructed energy to be used for the IRF

fov_offset_bins: astropy.units.Quantity[angle]

The bins in the field of view offset to be used for the IRF

t_obs: astropy.units.Quantity[time]

Observation time. This must match with how the individual event weights are calculated.

Returns:
bg_rate: astropy.units.Quantity

The background rate as particles per energy, time and solid angle in the specified bins.

Shape: (len(reco_energy_bins) - 1, len(fov_offset_bins) - 1)