SourceCatalogGammaCat

class gammapy.catalog.SourceCatalogGammaCat(filename='$GAMMA_CAT/output/gammacat.fits.gz')[source]

Bases: gammapy.catalog.SourceCatalog

Gammacat open TeV source catalog.

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

One source is represented by SourceCatalogObjectGammaCat.

Parameters:

filename : str

Path to the gamma-cat fits file.

Examples

Load the catalog data:

>>> from gammapy.catalog import SourceCatalogGammaCat
>>> cat = SourceCatalogGammaCat()

Access a source by name:

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

Access source spectral data and plot it:

>>> source.spectral_model.plot()
>>> source.spectral_model.plot_error()
>>> source.flux_points.plot()

Attributes Summary

description
name
positions SkyCoord

Methods Summary

copy() Copy catalog
info() Print info string.
row_index(name) Look up row index of source by name.
select_image_region(image) Select all source within an image
source_name(index) Look up source name by row index.
to_source_library() Convert to a SourceLibrary.

Attributes Documentation

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

SkyCoord

Methods Documentation

copy()

Copy catalog

info()

Print info string.

row_index(name)

Look up row index of source by name.

Parameters:

name : str

Source name

Returns:

index : int

Row index of source in table

select_image_region(image)

Select all source within an image

Parameters:

image : SkyImage

Sky image

Returns:

catalog : SourceCatalog

Source catalog selection.

source_name(index)

Look up source name by row index.

Parameters:

index : int

Row index of source in table

to_source_library()[source]

Convert to a SourceLibrary.

TODO: add an option whether to skip or raise on missing models or data.