SourceCatalogGammaCat#

class gammapy.catalog.SourceCatalogGammaCat(filename='$GAMMAPY_DATA/catalogs/gammacat/gammacat.fits.gz')[source]#

Bases: gammapy.catalog.core.SourceCatalog

Gammacat open TeV source catalog.

See: https://github.com/gammapy/gamma-cat

One source is represented by SourceCatalogObjectGammaCat.

Parameters
filenamestr

Path to the gamma-cat fits file.

Examples

Load the catalog data:

>>> import astropy.units as u
>>> from gammapy.catalog import SourceCatalogGammaCat
>>> cat = SourceCatalogGammaCat()

Access a source by name:

>>> source = cat['Vela Junior']

Access source spectral data and plot it:

>>> energy_range = [1, 10] * u.TeV
>>> source.spectral_model().plot(energy_range)
<AxesSubplot:xlabel='Energy [TeV]', ylabel='dnde [1 / (cm2 s TeV)]'>
>>> source.spectral_model().plot_error(energy_range)
<AxesSubplot:xlabel='Energy [TeV]', ylabel='dnde [1 / (cm2 s TeV)]'>
>>> source.flux_points.plot()
<AxesSubplot:xlabel='Energy [TeV]', ylabel='dnde (1 / (cm2 s TeV))'>

Attributes Summary

description

positions

Source positions (SkyCoord).

tag

Methods Summary

row_index(name)

Look up row index of source by name.

source_name(index)

Look up source name by row index.

to_models(**kwargs)

Create Models object from catalogue

Attributes Documentation

description = 'An open catalog of gamma-ray sources'#
positions#

Source positions (SkyCoord).

tag = 'gamma-cat'#

Methods Documentation

row_index(name)#

Look up row index of source by name.

Parameters
namestr

Source name

Returns
indexint

Row index of source in table

source_name(index)#

Look up source name by row index.

Parameters
indexint

Row index of source in table

to_models(**kwargs)#

Create Models object from catalogue