background_3d_lonlat
- pyirf.irf.background_3d_lonlat(events, reco_energy_bins, fov_lon_bins, fov_lat_bins, t_obs)[source]
Calculate background rates in square 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-3d
- Parameters:
- events: astropy.table.QTable
DL2 events table of the selected background events. Needed columns for this function: reco_fov_lon, reco_fov_lat, reco_energy, weight.
- reco_energy: astropy.units.Quantity[energy]
The bins in reconstructed energy to be used for the IRF
- fov_lon_bins: astropy.units.Quantity[angle]
The bins in the field of view longitudinal direction to be used for the IRF. Will become DETX bins.
- fov_lat_bins: astropy.units.Quantity[angle]
The bins in the field of view latitudinal direction to be used for the IRF. Will become DETY bins.
- 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_lon_bins) - 1, len(fov_lon_bins) - 1)