estimate_exposure_reco_energy#

gammapy.estimators.utils.estimate_exposure_reco_energy(dataset, spectral_model=None, normalize=True)[source]#

Estimate an exposure map in reconstructed energy.

Parameters:
datasetMapDataset or MapDatasetOnOff

The input dataset.

spectral_modelSpectralModel, optional

Assumed spectral shape. If None, a Power Law of index 2 is assumed. Default is None.

normalizebool

Normalize the exposure to the total integrated flux of the spectral model. When not normalized it directly gives the predicted counts from the spectral model. Default is True.

Returns:
exposureMap

Exposure map in reconstructed energy.

Examples

from gammapy.datasets import MapDataset
from gammapy.estimators.utils import estimate_exposure_reco_energy
from gammapy.modeling.models import PowerLawSpectralModel
dataset = MapDataset.read("$GAMMAPY_DATA/cta-1dc-gc/cta-1dc-gc.fits.gz")
spectral_model = PowerLawSpectralModel()
reco_exposure = estimate_exposure_reco_energy(
    dataset,
    spectral_model=spectral_model,
)
print(reco_exposure)
WcsNDMap

geom  : WcsGeom
axes  : ['lon', 'lat', 'energy']
shape : (320, 240, 10)
ndim  : 3
unit  : cm2 s
dtype : float64