class gammapy.maps.ImageProfileEstimator(x_edges=None, method='sum', axis='lon', center=None)[source]

Bases: object

Estimate profile from image.

x_edges : Angle

Coordinate edges to define a custom measument grid (optional).

method : [‘sum’, ‘mean’]

Compute sum or mean within profile bins.

axis : [‘lon’, ‘lat’, ‘radial’]

Along which axis to estimate the profile.

center : SkyCoord

Center coordinate for the radial profile option.


This example shows how to compute a counts profile for the Fermi galactic center region:

import matplotlib.pyplot as plt
from gammapy.image import ImageProfileEstimator
from gammapy.maps import Map
from astropy import units as u

# load example data
filename = '$GAMMAPY_DATA/tests/unbundled/fermi/fermi_counts.fits.gz'
fermi_cts =

# set up profile estimator and run
p = ImageProfileEstimator(axis='lon', method='sum')
profile =

# smooth profile and plot
smoothed = profile.smooth(kernel='gauss')

Methods Summary

run(self, image[, image_err, mask]) Run image profile estimator.

Methods Documentation

run(self, image, image_err=None, mask=None)[source]

Run image profile estimator.

image : Map

Input image to run profile estimator on.

image_err : Map

Input error image to run profile estimator on.

mask : Map

Optional mask to exclude regions from the measurement.

profile : ImageProfile

Result image profile object.