ImageProfileEstimator

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

Bases: gammapy.estimators.Estimator

Estimate profile from image.

Parameters
x_edgesAngle

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.

centerSkyCoord

Center coordinate for the radial profile option.

Examples

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

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

# load example data
filename = '$GAMMAPY_DATA/fermi-3fhl-gc/fermi-3fhl-gc-counts.fits.gz'
fermi_cts = Map.read(filename)

# 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()

Attributes Summary

config_parameters

Config parameters

selection_optional

tag

Methods Summary

copy()

Copy estimator

get_sqrt_ts(ts, norm)

Compute sqrt(TS) value.

run(image[, image_err, mask])

Run image profile estimator.

Attributes Documentation

config_parameters

Config parameters

selection_optional
tag = 'ImageProfileEstimator'

Methods Documentation

copy()

Copy estimator

static get_sqrt_ts(ts, norm)

Compute sqrt(TS) value.

Compute sqrt(TS) as defined by:

\[\begin{split}\sqrt{TS} = \left \{ \begin{array}{ll} -\sqrt{TS} & : \text{if} \ norm < 0 \\ \sqrt{TS} & : \text{else} \end{array} \right.\end{split}\]
Parameters
tsndarray

TS value.

normndarray

norm value

Returns
——-
sqrt_tsndarray

Sqrt(TS) value.

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

Run image profile estimator.

Parameters
imageMap

Input image to run profile estimator on.

image_errMap

Input error image to run profile estimator on.

maskMap

Optional mask to exclude regions from the measurement.

Returns
profileImageProfile

Result image profile object.