SourceCatalogHGPS#

class gammapy.catalog.SourceCatalogHGPS(filename='$GAMMAPY_DATA/catalogs/hgps_catalog_v1.fits.gz', hdu='HGPS_SOURCES')[source]#

Bases: SourceCatalog

HESS Galactic plane survey (HGPS) source catalog.

Reference: https://www.mpi-hd.mpg.de/hfm/HESS/hgps/

One source is represented by SourceCatalogObjectHGPS.

Examples

Let’s assume you have downloaded the HGPS catalog FITS file, e.g. via:

curl -O https://www.mpi-hd.mpg.de/hfm/HESS/hgps/data/hgps_catalog_v1.fits.gz

Then you can load it like this:

>>> import matplotlib.pyplot as plt
>>> from gammapy.catalog import SourceCatalogHGPS
>>> filename = '$GAMMAPY_DATA/catalogs/hgps_catalog_v1.fits.gz'
>>> cat = SourceCatalogHGPS(filename)

Access a source by name:

>>> source = cat['HESS J1843-033']
>>> print(source)

*** Basic info ***

Catalog row index (zero-based) : 64
Source name          : HESS J1843-033
Analysis reference   : HGPS
Source class         : Unid
Identified object    : --
Gamma-Cat id         : 126


*** Info from map analysis ***

RA                   :  280.952 deg = 18h43m48s
DEC                  :   -3.554 deg = -3d33m15s
GLON                 :   28.899 +/- 0.072 deg
GLAT                 :    0.075 +/- 0.036 deg
Position Error (68%) : 0.122 deg
Position Error (95%) : 0.197 deg
ROI number           : 3
Spatial model        : 2-Gaussian
Spatial components   : HGPSC 083, HGPSC 084
TS                   : 256.6
sqrt(TS)             : 16.0
Size                 : 0.239 +/- 0.063 (UL: 0.000) deg
R70                  : 0.376 deg
RSpec                : 0.376 deg
Total model excess   : 979.5
Excess in RSpec      : 775.6
Model Excess in RSpec : 690.2
Background in RSpec  : 1742.4
Livetime             : 41.8 hours
Energy threshold     : 0.38 TeV
Source flux (>1 TeV) : (2.882 +/- 0.305) x 10^-12 cm^-2 s^-1 = (12.75 +/- 1.35) % Crab

Fluxes in RSpec (> 1 TeV):
Map measurement                : 2.267 x 10^-12 cm^-2 s^-1 = 10.03 % Crab
Source model                   : 2.018 x 10^-12 cm^-2 s^-1 =  8.93 % Crab
Other component model          : 0.004 x 10^-12 cm^-2 s^-1 =  0.02 % Crab
Large scale component model    : 0.361 x 10^-12 cm^-2 s^-1 =  1.60 % Crab
Total model                    : 2.383 x 10^-12 cm^-2 s^-1 = 10.54 % Crab
Containment in RSpec                :  70.0 %
Contamination in RSpec              :  15.3 %
Flux correction (RSpec -> Total)    : 121.0 %
Flux correction (Total -> RSpec)    :  82.7 %

*** Info from spectral analysis ***

Livetime             : 16.8 hours
Energy range:        : 0.22 to 61.90 TeV
Background           : 5126.9
Excess               : 980.1
Spectral model       : PL
TS ECPL over PL      : --
Best-fit model flux(> 1 TeV) : (3.043 +/- 0.196) x 10^-12 cm^-2 s^-1  = (13.47 +/- 0.87) % Crab
Best-fit model energy flux(1 to 10 TeV) : (10.918 +/- 0.733) x 10^-12 erg cm^-2 s^-1
Pivot energy         : 1.87 TeV
Flux at pivot energy : (0.914 +/- 0.058) x 10^-12 cm^-2 s^-1 TeV^-1  = (4.04 +/- 0.17) % Crab
PL   Flux(> 1 TeV)   : (3.043 +/- 0.196) x 10^-12 cm^-2 s^-1  = (13.47 +/- 0.87) % Crab
PL   Flux(@ 1 TeV)   : (3.505 +/- 0.247) x 10^-12 cm^-2 s^-1 TeV^-1  = (15.51 +/- 0.70) % Crab
PL   Index           : 2.15 +/- 0.05
ECPL   Flux(@ 1 TeV) : (0.000 +/- 0.000) x 10^-12 cm^-2 s^-1 TeV^-1  = (0.00 +/- 0.00) % Crab
ECPL   Flux(> 1 TeV) : (0.000 +/- 0.000) x 10^-12 cm^-2 s^-1  = (0.00 +/- 0.00) % Crab
ECPL Index           : -- +/- --
ECPL Lambda          : 0.000 +/- 0.000 TeV^-1
ECPL E_cut           : inf +/- nan TeV

*** Flux points info ***

Number of flux points: 6
Flux points table:

e_ref  e_min  e_max        dnde         dnde_errn       dnde_errp        dnde_ul     is_ul
 TeV    TeV    TeV   1 / (TeV s cm2) 1 / (TeV s cm2) 1 / (TeV s cm2) 1 / (TeV s cm2)
------ ------ ------ --------------- --------------- --------------- --------------- -----
 0.332  0.215  0.511       3.048e-11       6.890e-12       7.010e-12       4.455e-11 False
 0.787  0.511  1.212       5.383e-12       6.655e-13       6.843e-13       6.739e-12 False
 1.957  1.212  3.162       9.160e-13       9.732e-14       1.002e-13       1.120e-12 False
 4.870  3.162  7.499       1.630e-13       2.001e-14       2.097e-14       2.054e-13 False
12.115  7.499 19.573       1.648e-14       3.124e-15       3.348e-15       2.344e-14 False
30.142 19.573 46.416       7.777e-16       4.468e-16       5.116e-16       1.883e-15 False

*** Gaussian component info ***

Number of components: 2
Spatial components   : HGPSC 083, HGPSC 084

Component HGPSC 083:
GLON                 :   29.047 +/- 0.026 deg
GLAT                 :    0.244 +/- 0.027 deg
Size                 : 0.125 +/- 0.021 deg
Flux (>1 TeV)        : (1.34 +/- 0.36) x 10^-12 cm^-2 s^-1 = (5.9 +/- 1.6) % Crab

Component HGPSC 084:
GLON                 :   28.770 +/- 0.059 deg
GLAT                 :   -0.073 +/- 0.069 deg
Size                 : 0.229 +/- 0.046 deg
Flux (>1 TeV)        : (1.54 +/- 0.47) x 10^-12 cm^-2 s^-1 = (6.8 +/- 2.1) % Crab


*** Source associations info ***

  Source_Name    Association_Catalog    Association_Name   Separation
                                                              deg
---------------- ------------------- --------------------- ----------
  HESS J1843-033                3FGL     3FGL J1843.7-0322   0.178442
  HESS J1843-033                3FGL     3FGL J1844.3-0344   0.242835
  HESS J1843-033                 SNR             G28.6-0.1   0.330376

Access source spectral data and plot it:

>>> ax = plt.subplot()
>>> source.spectral_model().plot(source.energy_range, ax=ax) 
>>> source.spectral_model().plot_error(source.energy_range, ax=ax) 
>>> source.flux_points.plot(ax=ax) 

Gaussian component information can be accessed as well, either via the source, or via the catalog:

>>> source.components
[SourceCatalogObjectHGPSComponent('HGPSC 083'), SourceCatalogObjectHGPSComponent('HGPSC 084')]
>>> cat.gaussian_component(83)
SourceCatalogObjectHGPSComponent('HGPSC 084')

Attributes Summary

description

Source catalog description (str).

large_scale_component

Large scale component model as a SourceCatalogLargeScaleHGPS object.

positions

Source positions as a SkyCoord object.

table_associations

Source association table as a Table.

table_components

Gaussian component table as a Table.

table_identifications

Source identification table as a Table.

table_large_scale_component

Large scale component table as a Table.

tag

Source catalog name (str).

Methods Summary

gaussian_component(row_idx)

Gaussian component as a SourceCatalogObjectHGPSComponent object.

row_index(name)

Look up row index of source by name.

source_name(index)

Look up source name by row index.

to_models([which, components_status])

Create Models object from catalog.

Attributes Documentation

description = 'H.E.S.S. Galactic plane survey (HGPS) source catalog'#

Source catalog description (str).

large_scale_component#

Large scale component model as a SourceCatalogLargeScaleHGPS object.

positions#

Source positions as a SkyCoord object.

table_associations#

Source association table as a Table.

table_components#

Gaussian component table as a Table.

table_identifications#

Source identification table as a Table.

table_large_scale_component#

Large scale component table as a Table.

tag = 'hgps'#

Source catalog name (str).

Methods Documentation

gaussian_component(row_idx)[source]#

Gaussian component as a SourceCatalogObjectHGPSComponent object.

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(which='best', components_status='independent')[source]#

Create Models object from catalog.

Parameters:
which{‘best’, ‘pl’, ‘ecpl’}

Which spectral model.

components_status{‘independent’, ‘linked’, ‘merged’}
Relation between the sources components. Available options are:
  • ‘independent’: each subcomponent of a source is given as a different SkyModel (Default).

  • ‘linked’: each subcomponent of a source is given as a different SkyModel but the spectral parameters except the normalisation are linked.

  • ‘merged’: the subcomponents are merged into a single SkyModel given as a TemplateSpatialModel with a PowerLawNormSpectralModel. In that case the relative weights between the components cannot be adjusted.

Returns:
modelsModels

Models of the catalog.