FermiLATBasicImageEstimator¶
-
class
gammapy.image.FermiLATBasicImageEstimator(reference, emin, emax, spectral_model=None, rad_max=<Quantity 1. deg>)[source]¶ Bases:
gammapy.image.BasicImageEstimatorEstimate basic sky images for Fermi-LAT data.
Can compute the following images: counts, exposure, background
TODO: allow different background estimation methods TODO: add examples
Parameters: reference :
SkyImageReference sky image
emin, emax :
QuantityEnergy range
spectral_model :
SpectralModelSpectral model assumption to compute mean exposure and psf images.
rad_max :
AnglePSF kernel size, passed to
gammapy.irf.TablePSF.kernel()Examples
This example shows how to compute a set of basic images for the galactic center region using a prepared 2FHL dataset:
from astropy import units as u from gammapy.image import SkyImage, FermiLATBasicImageEstimator from gammapy.datasets import FermiLATDataset kwargs = {} kwargs['reference'] = SkyImage.empty(nxpix=201, nypix=101, binsz=0.05) kwargs['emin'] = 50 * u.GeV kwargs['emax'] = 3000 * u.GeV image_estimator = FermiLATBasicImageEstimator(**kwargs) filename = '$FERMI_LAT_DATA/2fhl/fermi_2fhl_data_config.yaml' dataset = FermiLATDataset(filename) result = image_estimator.run(dataset) result['counts'].show()
Methods Summary
background(dataset)Estimate predicted counts background image in energy band. counts(dataset)Estimate counts image in energy band. excess(images)Estimate excess image. exposure(dataset)Estimate a spectral model weighted exposure image from an exposure cube. flux(images)Estimate flux image. run(dataset[, which])Estimate sky images. Methods Documentation
-
background(dataset)[source]¶ Estimate predicted counts background image in energy band.
The background estimate is based on the Fermi-LAT galactic and isotropic diffuse models.
Parameters: dataset :
FermiLATDatasetFermi basic dataset to compute images for.
Returns: background :
SkyImagePredicted number of background counts sky image.
-
counts(dataset)[source]¶ Estimate counts image in energy band.
Parameters: dataset :
FermiLATDatasetFermi basic dataset to compute images for.
Returns: counts :
SkyImageCounts sky image.
-
excess(images)¶ Estimate excess image.
Requires ‘counts’ and ‘background’ image.
Parameters: images :
SkyImageListList of sky images.
Returns: excess :
SkyImageExcess sky image.
-
exposure(dataset)[source]¶ Estimate a spectral model weighted exposure image from an exposure cube.
Parameters: dataset :
FermiLATDatasetFermi basic dataset to compute images for.
Returns: exposure :
SkyImageExposure sky image.
-
flux(images)¶ Estimate flux image.
Requires ‘counts’, ‘background’ and ‘exposure’ image.
Parameters: images :
SkyImageListList of sky images.
Returns: flux :
SkyImageFlux sky image.
-
run(dataset, which='all')[source]¶ Estimate sky images.
Parameters: dataset :
FermiLATDatasetFermi basic dataset to compute images for.
which : str or list of str
Which images to compute. Can be:
- ‘all’
- ‘counts’
- ‘background’
- ‘exposure’
- ‘excess’
- ‘flux’
- ‘psf’
Or a list containing any subset of the images listed above.
Returns: images :
SkyImageListList of sky images.
-