Background2D

class gammapy.irf.Background2D(energy_lo, energy_hi, offset_lo, offset_hi, data, meta=None, interp_kwargs=None)[source]

Bases: object

Background 2D.

Data format specification: bkg_2d

Parameters:

energy_lo, energy_hi : Quantity

Energy binning

offset_lo, offset_hi : Quantity

FOV coordinate offset-axis binning

data : Quantity

Background rate (usually: s^-1 MeV^-1 sr^-1)

Attributes Summary

default_interp_kwargs Default Interpolation kwargs for NDDataArray.

Methods Summary

evaluate(fov_offset[, fov_phi, energy_reco]) Evaluate the Background2D at a given offset and energy.
from_hdulist(hdulist[, hdu]) Create from HDUList.
from_table(table) Read from Table.
read(filename[, hdu]) Read from file.
to_fits([name]) Convert to BinTable.
to_table() Convert to Table.

Attributes Documentation

default_interp_kwargs = {'bounds_error': False, 'fill_value': None}

Default Interpolation kwargs for NDDataArray. Extrapolate.

Methods Documentation

evaluate(fov_offset, fov_phi=None, energy_reco=None, **kwargs)[source]

Evaluate the Background2D at a given offset and energy.

Parameters:

fov_offset : Angle

Offset in the FOV

fov_phi: `~astropy.coordinates.Angle`

Azimuth angle in the FOV. Not used for this class since the background model is radially symmetric

energy_reco : Quantity

Reconstructed energy

kwargs : dict

option for interpolation for RegularGridInterpolator

Returns:

array : Quantity

Interpolated values, axis order is the same as for the NDData array

classmethod from_hdulist(hdulist, hdu='BACKGROUND')[source]

Create from HDUList.

classmethod from_table(table)[source]

Read from Table.

classmethod read(filename, hdu='BACKGROUND')[source]

Read from file.

to_fits(name='BACKGROUND')[source]

Convert to BinTable.

to_table()[source]

Convert to Table.