Skip to content

Commit

Permalink
Merge pull request #2331 from cdeil/cat-data
Browse files Browse the repository at this point in the history
Move catalog test data to text files
  • Loading branch information
cdeil committed Aug 30, 2019
2 parents 09061bc + 1632546 commit 75cd39f
Show file tree
Hide file tree
Showing 26 changed files with 1,115 additions and 375 deletions.
1 change: 0 additions & 1 deletion Makefile
Expand Up @@ -100,7 +100,6 @@ docs-all:
docs-show:
open docs/_build/html/index.html

# TODO: fix gammapy/catalog/tests/test_gammacat.py (move to ref txt file and exclude here?)
trailing-spaces:
find $(PROJECT) examples docs -name "*.py" -exec perl -pi -e 's/[ \t]*$$//' {} \;

Expand Down
1 change: 1 addition & 0 deletions gammapy/catalog/hess.py
Expand Up @@ -644,6 +644,7 @@ def __init__(self, filename=None, hdu="HGPS_SOURCES"):

self._table_components = Table.read(filename, hdu="HGPS_GAUSS_COMPONENTS")
self._table_associations = Table.read(filename, hdu="HGPS_ASSOCIATIONS")
self._table_associations["Separation"].format = ".6f"
self._table_identifications = Table.read(filename, hdu="HGPS_IDENTIFICATIONS")
self._table_large_scale_component = Table.read(
filename, hdu="HGPS_LARGE_SCALE_COMPONENT"
Expand Down
4 changes: 2 additions & 2 deletions gammapy/catalog/registry.py
Expand Up @@ -68,8 +68,8 @@ def register(self, name, cls, args=()):

def __getitem__(self, name):
if name not in self._available_catalogs:
msg = 'Unknown catalog: "{}". '.format(name)
msg += "Available catalogs: {}".format(self.catalog_names)
msg = 'Unknown catalog: {!r}. '.format(name)
msg += "Available catalogs: {!r}".format(self.catalog_names)
raise KeyError(msg)

if name not in self._loaded_catalogs:
Expand Down
22 changes: 22 additions & 0 deletions gammapy/catalog/tests/data/2hwc_j0534+220.txt
@@ -0,0 +1,22 @@

*** Basic info ***

Catalog row index (zero-based) : 0
Source name: : 2HWC J0534+220

*** Position info ***

RA : 83.628 deg
DEC : 22.024 deg
GLON : 184.547 deg
GLAT : -5.783 deg
Position error : 0.057 deg

*** Spectral info ***

Spectrum 0:
Flux at 7 TeV : 1.85e-13 +- 2.38e-15 cm-2 s-1 TeV-1
Spectral index : -2.580 +- 0.010
Test radius : 0.0 deg

No second spectrum available for this source
26 changes: 26 additions & 0 deletions gammapy/catalog/tests/data/2hwc_j0631+169.txt
@@ -0,0 +1,26 @@

*** Basic info ***

Catalog row index (zero-based) : 1
Source name: : 2HWC J0631+169

*** Position info ***

RA : 97.998 deg
DEC : 16.997 deg
GLON : 195.614 deg
GLAT : 3.507 deg
Position error : 0.114 deg

*** Spectral info ***

Spectrum 0:
Flux at 7 TeV : 6.71e-15 +- 1.47e-15 cm-2 s-1 TeV-1
Spectral index : -2.570 +- 0.150
Test radius : 0.0 deg

Spectrum 1:
Flux at 7 TeV : 4.87e-14 +- 6.85e-15 cm-2 s-1 TeV-1
Spectral index : -2.230 +- 0.080
Test radius : 2.0 deg

57 changes: 57 additions & 0 deletions gammapy/catalog/tests/data/3fgl_J0000.1+6545.txt
@@ -0,0 +1,57 @@

*** Basic info ***

Catalog row index (zero-based) : 0
Source name : 3FGL J0000.1+6545
Extended name :
Associations :
Other names : 2FGL J2359.6+6543c
Class :
TeVCat flag : No TeV association
Other flags : Source-to-background ratio less than 10% in highest band in which TS > 25. Background is integrated over the 68%-confidence area (pi*r_682) or 1 square degree, whichever is smaller.

*** Position info ***

RA : 0.038 deg
DEC : 65.752 deg
GLON : 117.694 deg
GLAT : 3.403 deg

Semimajor (68%) : 0.0628 deg
Semiminor (68%) : 0.0481 deg
Position angle (68%) : 41.03 deg
Semimajor (95%) : 0.1019 deg
Semiminor (95%) : 0.0780 deg
Position angle (95%) : 41.03 deg
ROI number : 185

*** Spectral info ***

Spectrum type : PowerLaw
Detection significance (100 MeV - 300 GeV) : 6.813
Significance curvature : 3.4
Pivot energy : 1159 MeV
Power law spectral index : 2.411
Spectral index : 2.411 +- 0.082
Flux Density at pivot energy : 1.01e-12 +- 1.49e-13 cm-2 MeV-1 s-1
Integral flux (1 - 100 GeV) : 1.02e-09 +- 1.58e-10 cm-2 s-1
Energy flux (100 MeV - 100 GeV) : 1.36e-11 +- 2.07e-12 erg cm-2 s-1

*** Spectral points ***

e_min e_max flux flux_errn flux_errp e2dnde e2dnde_errn e2dnde_errp is_ul flux_ul e2dnde_ul sqrt_TS
MeV MeV 1 / (cm2 s) 1 / (cm2 s) 1 / (cm2 s) erg / (cm2 s) erg / (cm2 s) erg / (cm2 s) 1 / (cm2 s) erg / (cm2 s)
--------- ---------- ----------- ----------- ----------- ------------- ------------- ------------- ----- ----------- ------------- ---------
100.000 300.000 1.808e-08 8.395e-09 8.236e-09 4.175e-12 1.938e-12 1.902e-12 False nan nan 2.1687548
300.000 1000.000 6.941e-09 1.353e-09 1.367e-09 4.544e-12 8.856e-13 8.948e-13 False nan nan 5.269711
1000.000 3000.000 1.237e-09 2.251e-10 2.343e-10 2.855e-12 5.198e-13 5.411e-13 False nan nan 6.02224
3000.000 10000.000 5.781e-11 4.045e-11 4.853e-11 3.784e-13 2.648e-13 3.177e-13 False nan nan 1.5091934
10000.000 100000.000 2.840e-11 1.484e-11 1.915e-11 4.317e-13 2.257e-13 2.912e-13 False nan nan 2.4211686

*** Lightcurve info ***

Lightcurve measured in the energy band: 100 MeV - 100 GeV

Variability index : 40.754

No peak measured for this source.
58 changes: 58 additions & 0 deletions gammapy/catalog/tests/data/3fgl_J0001.4+2120.txt
@@ -0,0 +1,58 @@

*** Basic info ***

Catalog row index (zero-based) : 4
Source name : 3FGL J0001.4+2120
Extended name :
Associations : TXS 2358+209, 3EG J2359+2041
Other names :
Class : fsrq
TeVCat flag : No TeV association
Other flags : None

*** Position info ***

RA : 0.361 deg
DEC : 21.338 deg
GLON : 107.665 deg
GLAT : -40.047 deg

Semimajor (68%) : 0.1298 deg
Semiminor (68%) : 0.1162 deg
Position angle (68%) : -32.55 deg
Semimajor (95%) : 0.2105 deg
Semiminor (95%) : 0.1884 deg
Position angle (95%) : -32.55 deg
ROI number : 326

*** Spectral info ***

Spectrum type : LogParabola
Detection significance (100 MeV - 300 GeV) : 11.350
Significance curvature : 4.4
beta : 0.5191451907157898 +- 0.15508420765399933
Pivot energy : 311 MeV
Power law spectral index : 2.777
Spectral index : 2.305 +- 0.180
Flux Density at pivot energy : 2.52e-11 +- 2.8e-12 cm-2 MeV-1 s-1
Integral flux (1 - 100 GeV) : 2.94e-10 +- 7.58e-11 cm-2 s-1
Energy flux (100 MeV - 100 GeV) : 8.07e-12 +- 8.38e-13 erg cm-2 s-1

*** Spectral points ***

e_min e_max flux flux_errn flux_errp e2dnde e2dnde_errn e2dnde_errp is_ul flux_ul e2dnde_ul sqrt_TS
MeV MeV 1 / (cm2 s) 1 / (cm2 s) 1 / (cm2 s) erg / (cm2 s) erg / (cm2 s) erg / (cm2 s) 1 / (cm2 s) erg / (cm2 s)
--------- ---------- ----------- ----------- ----------- ------------- ------------- ------------- ----- ----------- ------------- ---------
100.000 300.000 1.524e-08 2.378e-09 2.390e-09 3.773e-12 5.888e-13 5.918e-13 False nan nan 6.7877107
300.000 1000.000 3.640e-09 5.311e-10 5.450e-10 2.260e-12 3.297e-13 3.384e-13 False nan nan 7.5911775
1000.000 3000.000 3.565e-10 9.341e-11 1.018e-10 7.153e-13 1.874e-13 2.042e-13 False nan nan 4.5168524
3000.000 10000.000 8.414e-15 nan 1.924e-11 4.392e-17 nan 1.004e-13 True 3.849e-11 2.009e-13 0.0
10000.000 100000.000 1.036e-14 nan 1.126e-11 9.595e-17 nan 1.043e-13 True 2.252e-11 2.087e-13 0.0

*** Lightcurve info ***

Lightcurve measured in the energy band: 100 MeV - 100 GeV

Variability index : 130.336

No peak measured for this source.
58 changes: 58 additions & 0 deletions gammapy/catalog/tests/data/3fgl_J0023.4+0923.txt
@@ -0,0 +1,58 @@

*** Basic info ***

Catalog row index (zero-based) : 55
Source name : 3FGL J0023.4+0923
Extended name :
Associations : PSR J0023+0923
Other names : 1FGL J0023.5+0930, 2FGL J0023.5+0924
Class : PSR
TeVCat flag : No TeV association
Other flags : None

*** Position info ***

RA : 5.865 deg
DEC : 9.389 deg
GLON : 111.455 deg
GLAT : -52.858 deg

Semimajor (68%) : 0.0525 deg
Semiminor (68%) : 0.0485 deg
Position angle (68%) : -86.71 deg
Semimajor (95%) : 0.0852 deg
Semiminor (95%) : 0.0786 deg
Position angle (95%) : -86.71 deg
ROI number : 576

*** Spectral info ***

Spectrum type : PLExpCutoff
Detection significance (100 MeV - 300 GeV) : 13.328
Significance curvature : 5.7
Cutoff energy : 984 +- 239 MeV
Pivot energy : 905 MeV
Power law spectral index : 2.283
Spectral index : 0.971 +- 0.303
Flux Density at pivot energy : 2.27e-12 +- 2.53e-13 cm-2 MeV-1 s-1
Integral flux (1 - 100 GeV) : 1.12e-09 +- 1.25e-10 cm-2 s-1
Energy flux (100 MeV - 100 GeV) : 7.28e-12 +- 8.09e-13 erg cm-2 s-1

*** Spectral points ***

e_min e_max flux flux_errn flux_errp e2dnde e2dnde_errn e2dnde_errp is_ul flux_ul e2dnde_ul sqrt_TS
MeV MeV 1 / (cm2 s) 1 / (cm2 s) 1 / (cm2 s) erg / (cm2 s) erg / (cm2 s) erg / (cm2 s) 1 / (cm2 s) erg / (cm2 s)
--------- ---------- ----------- ----------- ----------- ------------- ------------- ------------- ----- ----------- ------------- ----------
100.000 300.000 3.158e-09 2.421e-09 2.484e-09 8.263e-13 6.335e-13 6.500e-13 False nan nan 1.3162491
300.000 1000.000 3.743e-09 4.966e-10 5.139e-10 2.719e-12 3.607e-13 3.733e-13 False nan nan 8.734414
1000.000 3000.000 9.629e-10 1.320e-10 1.395e-10 2.157e-12 2.958e-13 3.125e-13 False nan nan 9.994864
3000.000 10000.000 5.029e-11 2.401e-11 3.044e-11 2.625e-13 1.253e-13 1.589e-13 False nan nan 2.7636795
10000.000 100000.000 7.682e-12 nan 1.888e-11 7.117e-14 nan 1.749e-13 True 4.544e-11 4.210e-13 0.96025896

*** Lightcurve info ***

Lightcurve measured in the energy band: 100 MeV - 100 GeV

Variability index : 51.375

No peak measured for this source.
58 changes: 58 additions & 0 deletions gammapy/catalog/tests/data/3fgl_J0835.3-4510.txt
@@ -0,0 +1,58 @@

*** Basic info ***

Catalog row index (zero-based) : 960
Source name : 3FGL J0835.3-4510
Extended name :
Associations : PSR J0835-4510, Vela, Vela Pulsar, 1AGL J0835-4509
Other names : 0FGL J0835.4-4510, 1FGL J0835.3-4510, 2FGL J0835.3-4510, 1FHL J0835.3-4510
Class : PSR
TeVCat flag : Small TeV source
Other flags : None

*** Position info ***

RA : 128.838 deg
DEC : -45.178 deg
GLON : 263.555 deg
GLAT : -2.787 deg

Semimajor (68%) : 0.0032 deg
Semiminor (68%) : 0.0032 deg
Position angle (68%) : 20.08 deg
Semimajor (95%) : 0.0052 deg
Semiminor (95%) : 0.0052 deg
Position angle (95%) : 20.08 deg
ROI number : 88

*** Spectral info ***

Spectrum type : PLSuperExpCutoff
Detection significance (100 MeV - 300 GeV) : 1048.959
Significance curvature : 54.0
Super-exponential cutoff index : 0.47586068511009216 +- 0.008638832718133926
Pivot energy : 833 MeV
Power law spectral index : 1.952
Spectral index : 1.003 +- 0.018
Flux Density at pivot energy : 2.33e-09 +- 4.4e-12 cm-2 MeV-1 s-1
Integral flux (1 - 100 GeV) : 1.3e-06 +- 2.89e-09 cm-2 s-1
Energy flux (100 MeV - 100 GeV) : 8.93e-09 +- 1.73e-11 erg cm-2 s-1

*** Spectral points ***

e_min e_max flux flux_errn flux_errp e2dnde e2dnde_errn e2dnde_errp is_ul flux_ul e2dnde_ul sqrt_TS
MeV MeV 1 / (cm2 s) 1 / (cm2 s) 1 / (cm2 s) erg / (cm2 s) erg / (cm2 s) erg / (cm2 s) 1 / (cm2 s) erg / (cm2 s)
--------- ---------- ----------- ----------- ----------- ------------- ------------- ------------- ----- ----------- ------------- ----------
100.000 300.000 5.376e-06 2.615e-08 2.615e-08 1.372e-09 6.673e-12 6.673e-12 False nan nan 160.97115
300.000 1000.000 3.217e-06 7.406e-09 7.406e-09 2.292e-09 5.278e-12 5.278e-12 False nan nan 528.53766
1000.000 3000.000 1.070e-06 3.075e-09 3.075e-09 2.525e-09 7.256e-12 7.256e-12 False nan nan 711.6319
3000.000 10000.000 2.162e-07 1.255e-09 1.255e-09 1.321e-09 7.670e-12 7.670e-12 False nan nan 465.89935
10000.000 100000.000 1.138e-08 2.888e-10 2.888e-10 1.055e-10 2.676e-12 2.676e-12 False nan nan 111.192406

*** Lightcurve info ***

Lightcurve measured in the energy band: 100 MeV - 100 GeV

Variability index : 20.009

No peak measured for this source.
63 changes: 63 additions & 0 deletions gammapy/catalog/tests/data/3fhl_j2301.9+5855e.txt
@@ -0,0 +1,63 @@

*** Basic info ***

Catalog row index (zero-based) : 1500
Source name : 3FHL J2301.9+5855e
Extended name : FGES J2301.9+5855
Associations : CTB 109, 3FGL J2301.2+5853
ASSOC_PROB_BAY : nan
ASSOC_PROB_LR : nan
Class : SNR
TeVCat flag : No TeV association

Significance (10 GeV - 2 TeV) : 7.974
Npred : 53.1

*** Position info ***

RA : 345.494 deg
DEC : 58.920 deg
GLON : 109.203 deg
GLAT : -1.003 deg

Semimajor (95%) : nan deg
Semiminor (95%) : nan deg
Position angle (95%) : nan deg
ROI number : 479
*** Extended source information ***
Model form : Disk
Model semimajor : 0.2488 deg
Model semiminor : 0.2488 deg
Position angle : 0.0000 deg
Spatial function : RadialDisk
Spatial filename :


*** Spectral fit info ***

Spectrum type : PowerLaw
Significance curvature : 1.0
Power-law spectral index : 2.006 +- 0.174
Pivot energy : 30.2 GeV
Flux Density at pivot energy : 1.61e-12 +- 2.81e-13 cm-2 GeV-1 s-1
Integral flux (10 GeV - 1 TeV) : 1.46e-10 +- 2.57e-11 cm-2 s-1
Energy flux (10 GeV - TeV) : 1.08e-11 +- 2.9e-12 erg cm-2 s-1

*** Spectral points ***

e_min e_max flux flux_errn flux_errp e2dnde e2dnde_errn e2dnde_errp is_ul flux_ul e2dnde_ul sqrt_ts
GeV GeV 1 / (cm2 s) 1 / (cm2 s) 1 / (cm2 s) erg / (cm2 s) erg / (cm2 s) erg / (cm2 s) 1 / (cm2 s) erg / (cm2 s)
------- -------- ----------- ----------- ----------- ------------- ------------- ------------- ----- ----------- ------------- -------
10.000 20.000 7.545e-11 1.849e-11 2.071e-11 2.417e-12 5.923e-13 6.632e-13 False nan nan 5.446
20.000 50.000 4.747e-11 1.296e-11 1.507e-11 2.534e-12 6.916e-13 8.042e-13 False nan nan 5.218
50.000 150.000 2.058e-11 7.593e-12 9.512e-12 2.471e-12 9.117e-13 1.142e-12 False nan nan 4.016
150.000 500.000 4.437e-12 3.076e-12 4.877e-12 1.522e-12 1.055e-12 1.673e-12 False nan nan 1.791
500.000 2000.000 6.598e-17 nan 4.626e-12 7.039e-17 nan 4.936e-12 True 9.252e-12 9.872e-12 0.000

*** Other info ***

HEP Energy : 364.828 GeV
HEP Probability : 0.849
Bayesian Blocks : 1 (not variable)
Redshift : nan
NuPeak_obs : nan Hz

0 comments on commit 75cd39f

Please sign in to comment.