create_background_2d_hdu

pyirf.io.create_background_2d_hdu(background_2d, reco_energy_bins, fov_offset_bins, extname='BACKGROUND', **header_cards)[source]

Create a fits binary table HDU in GADF format for the background 2d table. See the specification at https://gamma-astro-data-formats.readthedocs.io/en/latest/irfs/full_enclosure/bkg/index.html#bkg-2d

Parameters:
background_2d: astropy.units.Quantity[(MeV s sr)^-1]

Background rate, must have shape (n_energy_bins, n_fov_offset_bins)

reco_energy_bins: astropy.units.Quantity[energy]

Bin edges in reconstructed energy

fov_offset_bins: astropy.units.Quantity[angle]

Bin edges in the field of view offset.

extname: str

Name for BinTableHDU

**header_cards

Additional metadata to add to the header, use this to set e.g. TELESCOP or INSTRUME.