ImageProfileEstimator

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

Bases: object

Estimate profile from image.

Parameters:

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’]

Along which axis to estimate the profile.

Examples

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

import matplotlib.pyplot as plt
from gammapy.datasets import FermiGalacticCenter
from gammapy.image import ImageProfile, ImageProfileEstimator
from gammapy.image import SkyImage
from astropy import units as u

# load example data
fermi_cts = SkyImage.from_image_hdu(FermiGalacticCenter.counts())
fermi_cts.unit = u.count

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

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

plt.show()

Methods Summary

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

Methods Documentation

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

Run image profile estimator.

Parameters:

image : SkyImage

Input image to run profile estimator on.

image_err : SkyImage

Input error image to run profile estimator on.

mask : SkyImage

Optional mask to exclude regions from the measurement.

Returns:

profile : ImageProfile

Result image profile object.