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 matplotlib.pyplot as plt >>> 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:
>>> ax = plt.subplot() >>> energy_range = [1, 10] * u.TeV >>> source.spectral_model().plot(energy_range, ax=ax) >>> source.spectral_model().plot_error(energy_range, ax=ax) >>> source.flux_points.plot(ax=ax)
Attributes Summary
Source positions as a
SkyCoord
object.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 catalog.
Attributes Documentation
- description = 'An open catalog of gamma-ray sources'#
- 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 catalog.