FermiLATBasicImageEstimator

class gammapy.image.FermiLATBasicImageEstimator(reference, emin, emax, spectral_model=None, rad_max=<Quantity 1. deg>)[source]

Bases: gammapy.image.BasicImageEstimator

Estimate 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 : SkyImage

Reference sky image

emin, emax : Quantity

Energy range

spectral_model : SpectralModel

Spectral model assumption to compute mean exposure and psf images.

rad_max : Angle

PSF 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 : FermiLATDataset

Fermi basic dataset to compute images for.

Returns:

background : SkyImage

Predicted number of background counts sky image.

counts(dataset)[source]

Estimate counts image in energy band.

Parameters:

dataset : FermiLATDataset

Fermi basic dataset to compute images for.

Returns:

counts : SkyImage

Counts sky image.

excess(images)

Estimate excess image.

Requires ‘counts’ and ‘background’ image.

Parameters:

images : SkyImageList

List of sky images.

Returns:

excess : SkyImage

Excess sky image.

exposure(dataset)[source]

Estimate a spectral model weighted exposure image from an exposure cube.

Parameters:

dataset : FermiLATDataset

Fermi basic dataset to compute images for.

Returns:

exposure : SkyImage

Exposure sky image.

flux(images)

Estimate flux image.

Requires ‘counts’, ‘background’ and ‘exposure’ image.

Parameters:

images : SkyImageList

List of sky images.

Returns:

flux : SkyImage

Flux sky image.

run(dataset, which='all')[source]

Estimate sky images.

Parameters:

dataset : FermiLATDataset

Fermi 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 : SkyImageList

List of sky images.