gamma-cat¶
gamma-cat is an open data collection and source catalog for very-high-energy gamma-ray astronomy.
- Data and Docs (this site): https://gamma-cat.readthedocs.io
- Repository: https://github.com/gammapy/gamma-cat
- Explore gamma-cat and other gamma-ray data at gamma-sky.net
- Access and analyse gamma-cat and other gamma-ray data from Python: gammapy.catalog
Overview¶
Gamma-Cat provides the gamma-ray data as
- a full data collection (often multiple measurements, e.g. spectra, for a given source)
- a source catalog (a simple table with one source per row, and a small subset of available data)
The latest version of the files on github can be found here: https://github.com/gammapy/gamma-cat/tree/master/output/data
Source catalog¶
The source catalog is available as a single table in a single file. It contains only part of the data available in gamma-cat.
- gammacat.fits.gz – Main version of the source catalog (in FITS format)
- gammacat.ecsv – Partial source catalog (in ECSV format)
- gammacat.yaml – Partial source catalog (in YAML format)
Why multiple formats?
- FITS is the main format for the catalog we release. It supports vector columns, which we use for spectral points.
- The ECSV and YAML variant are more for us working on gamma-cat, to have a text-based, version control friendly format where it’s easy to see which changes occurred from one version to the next.
Data Collection¶
Here you can access the whole data collection.
At the moment we provide two “views”, either by source or by reference.
Data by source¶
List of sources in gamma-cat:
- PKS 0447-439 (ID: 21)
- Vela Junior (ID: 39)
- LMC N132D (ID: 24)
- HESS J1503-582 (ID: 75)
- HESS J1804-216 (ID: 113)
- PKS 1441+25 (ID: 167)
- 3C 58 (ID: 9)
- HESS J1834-087 (ID: 123)
- Geminga (ID: 31)
- W 49B (ID: 133)
- HESS J1858+020 (ID: 131)
- Gamma Cygni (ID: 144)
- 1ES 2344+514 (ID: 154)
- PKS 1424+240 (ID: 67)
- RBS 0723 (ID: 38)
- SNR G327.1-1.1 (ID: 81)
- HESS J1843-033 (ID: 126)
- 1ES 1215+303 (ID: 53)
- HESS J1826-130 (ID: 161)
- HESS J1745-303 (ID: 108)
- PKS 1510-089 (ID: 78)
- HESS J0632+057 (ID: 30)
- MAGIC J2001+435 (ID: 139)
- W28 (ID: 112)
- Tycho SNR (ID: 3)
- S4 0954+65 (ID: 41)
- IC 310 (ID: 16)
- PKS 2155-304 (ID: 147)
- HESS J1800-240A (ID: 111)
- Cassiopeia A (ID: 153)
- V* V635 Cas (ID: 169)
- HESS J1831-098 (ID: 120)
- RX J1713.7-3946 (ID: 96)
- W 51C (ID: 135)
- HESS J1507-622 (ID: 77)
- HESS J1626-490 (ID: 85)
- HESS J1018-589 A (ID: 45)
- RGB J0521+212 (ID: 23)
- HESS J1418-609 (ID: 65)
- VER J1746-289 (ID: 165)
- RCW 86 (ID: 70)
- HESS J1943+213 (ID: 137)
- SNR G0.9+0.1 (ID: 110)
- HESS J1427-608 (ID: 68)
- Centaurus A (ID: 63)
- RBS 0413 (ID: 17)
- W Comae (ID: 54)
- HESS J1857+026 (ID: 130)
- Markarian 421 (ID: 49)
- MAGIC J0223+403 (ID: 12)
- Markarian 180 (ID: 52)
- 1ES 0414+009 (ID: 20)
- HESS J1846-029 (ID: 127)
- MGRO J2031+41 (ID: 145)
- HESS J1640-465 (ID: 88)
- Terzan 5 (ID: 109)
- RGB J0136+391 (ID: 7)
- HESS J1708-443 (ID: 94)
- HESS J1808-204 (ID: 114)
- HESS J1457-593 (ID: 72)
- H 2356-309 (ID: 155)
- 1ES 1440+122 (ID: 71)
- 1ES 1218+304 (ID: 55)
- HESS J1632-478 (ID: 86)
- HESS J1702-420 (ID: 92)
- HESS J1828-099 (ID: 162)
- HESS J1729-345 (ID: 102)
- LS 5039 (ID: 119)
- 1ES 0806+524 (ID: 36)
- RGB J0710+591 (ID: 34)
- HESS J1849-000 (ID: 129)
- Westerlund 2 (ID: 46)
- NGC 253 (ID: 6)
- MS1221.8+2452 (ID: 57)
- HESS J1614-518 (ID: 83)
- BL Lacertae (ID: 148)
- HESS J1832-085 (ID: 163)
- SNR G106.3+02.7 (ID: 149)
- HESS J1741-302 (ID: 104)
- RGB J0152+017 (ID: 8)
- M 82 (ID: 40)
- S5 0716+714 (ID: 35)
- 1ES 1741+196 (ID: 105)
- HESS J1018-589 B (ID: 44)
- CTB 37A (ID: 97)
- HESS J1852-000 (ID: 157)
- HESS J1841-055 (ID: 125)
- MSH 15-52 (ID: 79)
- SHBL J001355.9-185406 (ID: 2)
- HESS J1832-093 (ID: 121)
- 30 Dor C (ID: 26)
- HESS J1813-126 (ID: 160)
- 3C 279 (ID: 59)
- PG 1553+113 (ID: 82)
- 1ES 0347-121 (ID: 19)
- HESS J1356-645 (ID: 64)
- Dragonfly (ID: 142)
- RX J1136.5+6737 (ID: 51)
- RX J0648.7+1516 (ID: 32)
- AP Librae (ID: 80)
- Galactic Centre (ID: 106)
- VER J2019+368 (ID: 143)
- V* V404 Cyg (ID: 168)
- Vela X (ID: 37)
- Markarian 501 (ID: 91)
- 3C 66A (ID: 11)
- HESS J1837-069 (ID: 124)
- CTB 37B (ID: 95)
- 1ES 1959+650 (ID: 138)
- HESS J1912+101 (ID: 134)
- CTA 1 (ID: 1)
- HESS J1616-508 (ID: 84)
- HESS J1848-018 (ID: 128)
- PSR B1259-63 (ID: 60)
- HESS J1026-582 (ID: 47)
- 1ES 1312-423 (ID: 62)
- HESS J1833-105 (ID: 122)
- LS I +61 303 (ID: 14)
- PKS 1222+216 (ID: 56)
- RGB J2243+203 (ID: 151)
- HESS J1809-193 (ID: 115)
- M 87 (ID: 58)
- 1ES 1011+496 (ID: 43)
- 1ES 0502+675 (ID: 22)
- HESS J1420-607 (ID: 66)
- SNR G15.4+0.1 (ID: 117)
- PKS 0548-322 (ID: 28)
- Arc source (ID: 159)
- HESS J1119-614 (ID: 50)
- SNR G323.7-01.0 (ID: 158)
- Crab pulsar (ID: 166)
- HESS J1844-030 (ID: 164)
- HESS J1641-463 (ID: 89)
- HESS J1813-178 (ID: 116)
- Westerlund 1 (ID: 90)
- HESS J1634-472 (ID: 87)
- 1RXS J101015.9-311909 (ID: 42)
- HESS J1800-240B (ID: 156)
- HESS J1303-631 (ID: 61)
- MGRO J1908+06 (ID: 132)
- PKS 2005-489 (ID: 140)
- HESS J1458-608 (ID: 73)
- B3 2247+381 (ID: 152)
- SNR G054.1+00.3 (ID: 136)
- 1ES 0033+595 (ID: 5)
- HESS J1731-347 (ID: 103)
- HESS J1825-137 (ID: 118)
- HESS J1718-385 (ID: 99)
- 1ES 1101-232 (ID: 48)
- IC 443 (ID: 29)
- Crab nebula (ID: 25)
- NGC 1275 (ID: 18)
- 1ES 1727+502 (ID: 101)
- VER J2016+371 (ID: 141)
- 1ES 0647+250 (ID: 33)
- H 1426+428 (ID: 69)
- PKS 0301-243 (ID: 15)
- Boomerang PWN (ID: 150)
- Galactic Centre ridge (ID: 107)
- S3 0218+35 (ID: 10)
- TeV J2032+4130 (ID: 146)
- KUV 00311-1938 (ID: 4)
- H 1722+119 (ID: 100)
- 1ES 0229+200 (ID: 13)
- SNR G349.7+0.2 (ID: 98)
- HESS J1708-410 (ID: 93)
- SN 1006 (ID: 74)
- N 157B (ID: 27)
Data by reference¶
List of references in gamma-cat:
- 1996ApJ…472L…9B
- 1999A&A…342…69A
- 1999A&A…350..757A
- 1999ApJ…526L..81M
- 2000AIPC..515..113P
- 2000PhDT………6P
- 2001A&A…366…62A
- 2001ApJ…546..898A
- 2002A&A…393…89A
- 2003A&A…403..523A
- 2003A&A…406L…9A
- 2003ApJ…583L…9H
- 2003ApJ…598..242A
- 2003ICRC….5.2615T
- 2004A&A…425L..13A
- 2004Natur.432…75A
- 2005A&A…430..865A
- 2005A&A…432L..25A
- 2005A&A…435L..17A
- 2005A&A…437…95A
- 2005A&A…437L…7A
- 2005A&A…439.1013A
- 2005A&A…442….1A
- 2005A&A…442..895A
- 2005A&A…442L..25A
- 2005ApJ…621..181D
- 2005ApJ…634..947S
- 2005Sci…309..746A
- 2006A&A…448L..43A
- 2006A&A…456..245A
- 2006A&A…457..899A
- 2006A&A…460..365A
- 2006A&A…460..743A
- 2006ApJ…636..777A
- 2006ApJ…639..761A
- 2006ApJ…641..740R
- 2006ApJ…642L.119A
- 2006ApJ…648L.105A
- 2006PhRvL..97v1102A
- 2007A&A…469L…1A
- 2007A&A…470..475A
- 2007A&A…472..489A
- 2007A&A…473L..25A
- 2007A&A…475L…9A
- 2007ApJ…661..236A
- 2007ApJ…662..892A
- 2007ApJ…663..125A
- 2007ApJ…666L..17A
- 2007ApJ…667L..21A
- 2008A&A…477..353A
- 2008A&A…477..481A
- 2008A&A…481..401A
- 2008A&A…481L.103A
- 2008A&A…483..509A
- 2008A&A…484..435A
- 2008A&A…486..829A
- 2008A&A…490..685A
- 2008AIPC.1085..249T
- 2008AIPC.1085..281R
- 2008AIPC.1085..285R
- 2008AIPC.1085..372C
- 2008ApJ…679..397A
- 2008ApJ…679.1029T
- 2008ApJ…679.1427A
- 2008ApJ…684L..73A
- 2008ICRC….2..803K
- 2008JPhG…35f5202G
- 2008Sci…320.1752M
- 2009A&A…499..723A
- 2009A&A…503..817A
- 2009A&A…507..389A
- 2009ApJ…690L.126A
- 2009ApJ…691L..13D
- 2009ApJ…693L.104A
- 2009ApJ…695.1370A
- 2009ApJ…696L.150A
- 2009ApJ…698L..94A
- 2009ApJ…698L.133A
- 2009ApJ…700.1034A
- 2009ApJ…703..169A
- 2009ApJ…703L…6A
- 2009ApJ…704L.129A
- 2009ApJ…705.1624A
- 2009ApJ…707..612A
- 2009Natur.462..770V
- 2009Sci…325..444A
- 2010A&A…511A..52H
- 2010A&A…516A..56H
- 2010A&A…516A..62A
- 2010A&A…519A..32A
- 2010A&A…520A..83H
- 2010ApJ…708L.100A
- 2010ApJ…709L.163A
- 2010ApJ…714..163A
- 2010ApJ…715L..49A
- 2010ApJ…716..819A
- 2010ApJ…719L..69A
- 2010JPhG…37l5201C
- 2011A&A…525A..45H
- 2011A&A…525A..46H
- 2011A&A…528A.143H
- 2011A&A…529A..49H
- 2011A&A…531A..81H
- 2011A&A…531L..18H
- 2011A&A…533A.103H
- 2011ApJ…726…43A
- 2011ApJ…726…58A
- 2011ApJ…727..129A
- 2011ApJ…729….2A
- 2011ApJ…730L…8A
- 2011ApJ…730L..20A
- 2011ApJ…734..110B
- 2011ApJ…738….3A
- 2011ApJ…738…25A
- 2011ApJ…738..169A
- 2011ApJ…742..127A
- 2011ICRC….7..185A
- 2011ICRC….7..244S
- 2011Sci…334…69V
- 2012A&A…537A.114A
- 2012A&A…538A.103H
- 2012A&A…539A.118A
- 2012A&A…539A.149H
- 2012A&A…541A…5H
- 2012A&A…541A..13A
- 2012A&A…542A..94H
- 2012A&A…544A..75A
- 2012A&A…544A.142A
- 2012A&A…545L…2H
- 2012A&A…548A..38A
- 2012A&A…548A..46H
- 2012ApJ…746..141A
- 2012ApJ…746..151A
- 2012ApJ…748…46A
- 2012ApJ…750…94A
- 2012ApJ…754L..10A
- 2012ApJ…755..118A
- 2012ApJ…758….2B
- 2012JPhG…39d5201C
- 2012arXiv1205.0719D
- 2013A&A…551A..94H
- 2013A&A…552A.118H
- 2013A&A…554A..72H
- 2013A&A…554A.107H
- 2013A&A…556A..67A
- 2013A&A…559A.136H
- 2013ApJ…762…92A
- 2013ApJ…764…38A
- 2013ApJ…770…93A
- 2013ApJ…775….3A
- 2013ApJ…776…69A
- 2013ApJ…779…88A
- 2013ApJ…779…92A
- 2013MNRAS.434.1889H
- 2013PhRvD..88j2003A
- 2013arXiv1303.0979O
- 2014A&A…562A..40H
- 2014A&A…567A.135A
- 2014A&A…567L…8A
- 2014ApJ…780..168A
- 2014ApJ…781L..11A
- 2014ApJ…782…13A
- 2014ApJ…783…16A
- 2014ApJ…785L..16A
- 2014ApJ…787..166A
- 2014ApJ…788…78A
- 2014ApJ…788..158A
- 2014ApJ…790..149A
- 2014ApJ…794L…1A
- 2014MNRAS.439.2828A
- 2015A&A…573A..31H
- 2015A&A…573A..50A
- 2015A&A…574A.100H
- 2015A&A…577A.131H
- 2015ApJ…799….7A
- 2015ApJ…802…65A
- 2015ApJ…808..110A
- 2015ApJ…812…65F
- 2015ApJ…815L..22A
- 2015MNRAS.446.1163H
- 2015NIMPA.770…42S
- 2015Sci…347..406H
- 2015arXiv151100309G
- 2015arXiv151201911H
- 2016A&A…594A..76A
- 2016ApJ…817L…7A
- 2016ApJ…819..156B
- 2016ApJ…821..129A
- 2016ApJ…831..113A
- 2016MNRAS.459.2550A
- 2016MNRAS.461..202A
- 2016Natur.531..476H
- 2016arXiv160104461H
- 2016arXiv160605404A
- 2016arXiv160900600H
- 2016arXiv160908671H
- 2016arXiv161005799S
- 2016arXiv161101863H
- 2017A&A…603A..31A
- 2017AIPC.1792d0023S
- 2017ApJ…834….2A
- 2017ApJ…836…23A
- 2017ApJ…836..205A
- 2017MNRAS.471.2117A
- 2017arXiv170107002A
- 2017arXiv170604535H
- 2017arXiv170804045M
- 2017arXiv170805107K
- 2017arXiv171101350H
- 2018ApJ…856…95A
- 2018arXiv180106020H
Stats¶
Basics¶
- Version: e4d09c0
Kifune plot¶
The so-called Kifune plot shows the cumulative number of detected TeV sources versus time.
(Source code, png, hires.png, pdf)

Source classes¶
Plot source class pie chart
Changes¶
This is the changelog for gamma-cat.
It lists releases and major changes, not every small data update.
See also: Contributors and Acknowledgements.
Version 0.1 (unreleased)¶
- tbd
Overview¶
Gamma-Cat is organised as a Github respository which mainly contains of the catalog and collection, the raw input data, the sphinx code of this webpage and a Python package to work with the data. The project is BSD licensed (like Astropy, Gammapy). This license only applies to the code, it has nothing to do with the data.
Gamma-Cat is under development and aims to provide data taken by HESS, MAGIC, VERITAS, WHIPPLE, HEGRA, CANGAROO, HAWC, MILAGRO, CRIMEA, ARGO, CAT and DURHAM. In the future we may try to ingest and interconnect other catalogs like e.g. the Fermi-LAT GeV catalogs.
Unfortunately, the catalog is still incomplete. If you want to help us, you are very welcome to look at the Github issue tracker (requires a Github account) or feel free to contact one of the Contributors.
For further information you can take a look on either the Gamma-Cat poster at ADASS 2016 at the ADASS 2016 conference or on the follow up Gamma-Cat poster from 2017 with more recent information on Gamma-Cat (and gamma-sky.net).
Terms of use¶
All data collected here was originally generated and published by others.
First and foremost, when using data, you have to cite the original publication!
In addition, if you used gamma-cat, we ask that you acknowledge this via
This research made use of gamma-cat (https://github.com/gammapy/gamma-cat),an open data collection and source catalog for gamma-ray astronomy.
(we plan to write a paper on gamma-cat; once that is available, we’ll mention the reference here)
Otherwise, you are free to use this data as you like.
Contributors¶
The following people have directly contributed to gamma-cat (alphabetical order by first name)
- Arjun Voruganti (@vorugantia)
- Axel Donath (@adonath)
- Christoph Deil (@cdeil)
- Gernot Maier (@GernotMaier)
- Matthias Wegen (@wegenmat)
- Peter Deiml (@pdeiml)
Many others have contributed indirectly, e.g. given data or feedback via private communication.
Thank you!
Acknowledgements¶
The following tools and services were used to produce this catalog:
- SIMBAD
- Astrophysics data system (ADS)
- Astropy
- Gammapy
- TGeVCat was used to look up info and we had good discussions and collaboration with the TGeVCat team.
- TeVCat was used to look up some info. (We did comply with their terms and conditions and didn’t scrape their website to collect data for this catalog!)
Example¶
TODO: Needs to be done!
Introduction¶
So you want to contribute to gamma-cat?
Really? Are you sure?
Great! Read on …
There are many ways to contribute to gamma-cat. We need more people that help with data entry, review data in gamma-cat for completeness and accuracy, improve the documentation, the data format schemas and the Python scripts.
We will try to describe and explain how everything works here in the contributor documentation. But we realise that in the end we will probably fall short, and if you try to contribute you will have questions about YAML or ECSV or schemas or get stuck with a git on Python question. If that happens, please don’t give up, but contact us and we will help!
Everything happens on Github here: https://www.github.com/gammapy/gamma-cat
This is a git repository that contains everything related to gamma-cat: the data entry in the
input
folder, the script make.py
and gammacat
folder with the Python scripts to
generate the output files, which are in the output
folder.
The documentation at https://gamma-cat.readthedocs.io is generated from the RST files in the
webpage
folder in that repo. But not just all the files and version control is there,
Github is also the place to file “issues” for question, discussion, feature or data entry requests,
bug reports (see https://github.com/gammapy/gamma-cat/issues).
And it is also the place where all changes and additions happen, via “pull requests”
(see https://github.com/gammapy/gamma-cat/pulls ).
So if you want to contribute to gamma-cat, you have to make an account on Github. It’s free and should just take a minute. You can then find a lot of information about git and Github here: https://help.github.com/
There you will find documentation how to open “issues” and “pull requests” and resources how to learn git, as well as how to do basic things like edit or add a file directly via the Github web interface. This means that you can do some data entry or documentation improvements for gamma-cat in a simple way. If you’re new to Github and git, and the explanations below aren’t clear to you, then what you can do is to open a new issue in the gamma-cat issue tracker where you describe what you want to do (i.e. add or change something), and then we’ll try to help you do it, i.e. make your first pull request.
The following pages give you more information, focusing mostly on how to do data entry for gamma-cat, since this will be the most common way for people to contribute.
Input¶
We’ve already mentioned it in the introduction: all data entry for gamma-cat happens by editing or adding
text files in the input
folder. We use file formats that are both human- and machine-readable:
This section describes the format and content of the data entry files for gamma-cat.
All data entry is done in the folder named input
. It contains three sub-folders of interest:
sources
contains yaml-files with basic information about the gamma-ray sources.data
contains the data from publications stored inYAML
andECSV
files. The folder contains subfolders named by years and there subsubfolders named by reference_ids. E.g. the data from the publication with reference2015ApJ...802...65A
is stored in the folderinput/data/2015/2015ApJ...802...65A
. All these files are named corresponding to the source_id of the gamma-ray source defined in its definition file.schemas
contains files which define the structure of the data entry files and descriptions of the properties in the data files.
Now, these input files will be discussed in more detail, firstly the source definition files in sources:
The information (and a short description) which can be stored in such a file are defined by some keywords in basic_source_info.schema.yaml.
It starts with properties, like the common_name
, the source_id
used in gamma-cat or the tevcat_name and goes on with information about experiments which investigated this source. Two important information are the reference_ids
, which are all ADS reference to publication which deal with this source, and the source_id
from which the names in the data folder are built.
At the end of basic_source_info.schema.yaml after the keyword required
, there are all of the upper information written down which have to be defined in a source definition file.
A good example to get familiar with this is e.g. tev_000049.yaml and compare it with basic_source_info.schema.yaml
The folders in /input/data/<year>/<reference> contain ecsv files with measured data in it, e.g. tev-000034-sed.ecsv, yaml files with model parameters, e.g. tev-000034.yaml, and finally a info yaml file in which all data corresponding to the publication are summarised, e.g. info.yaml.
The escv files can be either the measurement of spectral fluxes or of lightcurves. Information about the units of the data and additional information like source_id
or telescope
are stored as meta data in the header of the file.
The naming convention is tev-<source_id>-sed.ecsv
and tev-<source_id>-lc.ecsv
, respectively.
The YAML files contain the model parameters given in the publication and are named within gamma-cat as dataset-files
.
The information which can/ has to be stored in a yaml file are defined in dataset_source_info.schemas.yaml.
The info.yaml files give an overview about all stored data which is related to the publication and its layout is defined in dataset_info.schema.yaml. One important property in a info file is data-entry
with its subinformation status
, reviewed
and notes
.
Add/ Change data:¶
When you add or change input data you have to do three things. Firstly, you must add or change the data, secondly, you must update the data status in the corresponding info.yaml
file and finally, you have to tell gamma-cat that there is new data. This is done in gamma_cat_dataset.yaml where you must add the reference_id
of the publication of the added data. Gamma-cat will only contain data whose reference_id
is listed in gamma_cat_dataset.yaml.
Workflow¶
This page gives an overview how to make changes or additions to Gamma-Cat like e.g. add data, fix bugs or whatever. It is not a tutorial which explains the tools (git, Github, Sphinx etc.) or the code (Python etc.)
If you want to run the gamma-cat
Python scripts locally, go through the Installation chapter.
But contribution can be done without the installation because we have continous integration tests set up on travis-ci that check that everything is working OK. If that is what you want to do, jump over the Installation chapter.
For information about the gammacat
Python packages and the structure of the input files, please go to Code
Pull requests¶
Contribution can be done via pull requests on Github (hence you need an Github account). We like them small and easy to review. To get familiar with git and github you can look at https://help.github.com or simply use google for more information.
The general contribution cycle is roughly as follows:
1. Get the latest version of the master
branch
2. Checkout a new feature
branch for you changes/ additions
3. Make fixes, changes and additions locally
4. Make a pull request
5. Someone of us reviews the pull request, gives feedback and finally merges it
6. Update to the new latest verion of the master
branch
Then you are done and you can start using the new Gamma-Cat version or do further improvements in a new pull request. It is possible and normal do work on different tasks in parallel using git branches.
So how large should one pull request be?
Our experience is that the smaller the better and each pull request should only handle one task, e.g. for every data entry or every bug fix make a single pull request. Working on a pull request for an hour or maximum a day and having a diff of around 100 lines to review is pleasant.
Pull requests that drag on for a few days or having a diff of 1000 lines of code are almost always painful and inefficient for both, the person who makes it and the reviewer.
If your pull request is related to an issue, it is recommended to name it analogeously, e.g. Fix bug in issue 45
. This will make things easier for us.
Installation (optional)¶
If you want to run the gamma-cat
Python scripts locally, you need to install Python 3.6 and some Python packages.
We recommend you to download Anaconda
and then run the following commands in the gamma-cat
folder:
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda info -a
# Now install our dependencies
conda env create -f environment.yml
# Activation of the installed environment
source activate gamma-cat
Code¶
This page contains information about the whole code stored in the gamma-cat repository.
make.py¶
There is a command line interface to run the gamma-cat scripts,
the make.py
file in the top-level folder.
To see the available sub-commands and options:
$ ./make.py --help
To run the full pipeline, i.e. generate all output files and run all checks:
$ ./make.py all
After adding/ changing data in the input folder, one should always execute:
$ ./make.py checks
which checks the format/ structure of the input files.
gammacat package¶
The make.py
command line interface just imports and executes functions and classes
from the gammacat
Python package (i.e. the .py
files in the folder with name gammacat
).
We list the modules in gammacat
and comment on the code organisation.
The following are more basic modules:
utils.py
has some helper utility functions (e.g. for JSON / YAML / ECSV I/O)modeling.py
has aParameter
andParameterList
class to help process input spatial and spectral source models from the YAML files.info.py
has some helpers for versions, filenames, …sed.py
has a class to process and validate the spectral energy distributions (SEDs) in the input folder. The SEDs in the output folder can be read directly withgammapy.spectrum.FluxPoints
.lightcurve.py
has a class to process and validate the lightcurves in the input folder. The lightcurves in the output folder can be read directly withgammapy.time.LightCurve
.
In additions there are classes in gammapy.catalog.gammacat
that are used in the gammacat
scripts to process the data: GammaCatResource
, GammaCatResourceIndex
, GammaCatDatasetCollection
.
Then there is a hierarchy of higher-level modules (that import from the basic modules and modules representing lower-level steps in the processing pipeline):
input.py
has classes to read / clean up / process the data in theinput
folder.collection.py
has classes to create the files in theoutput
folder (only the dataset files and index files, not the catalog files).cat.py
is the code to create the catalog fileschecks.py
is the code to run checks. At the moment the methods there just dispatch to methods calledvalidate
orcheck
in lower-level modules (such asgammacat.input
), and the actual checks are thus scattered throughout thegammacat
modules. There’s also checks on data content ingammacat/tests
(which is probably a bad idea, but pytest is convenient to have asserts)
Tests¶
There is a folder gammacat/tests
with some unit tests for the code in the gammacat
package,
that can be executed via python -m pytest gammacat/tests
We don’t have the relation quite figure out, what goes where:
gammacat/tests
gammapy/catalog/tests/test_gammacat.py
- The various check / validate methods throughout
gammacat
and executed via./make.py check
.
Tools¶
The following tool is helpful to lint YAML files:
TODO: it’s too picky, showing errors for things that are OK. Figure out how to make it less picky and document that here.
Website build¶
The gamma-cat website is a static website generated by Python and Sphinx.
We have a Sphinx test page where we can try out things locally and check if they also work on ReadTheDocs. It’s an orphan page, i.e. doesn’t show up for normal users.
We use several Sphinx extensions, and also have our own in gammacat/sphinx/exts.
More info soon … for now this is just a link collection:
sphinxcontrib.rawfiles
- Useful example. Not very useful directly, because can’t control destination of the copy!?
- Code: https://bitbucket.org/birkenfeld/sphinx-contrib/src/master/rawfiles/sphinxcontrib/rawfiles.py
- PyPI: https://pypi.python.org/pypi/sphinxcontrib-rawfiles/
- Although for now, this is working for what I need: http://www.sphinx-doc.org/en/1.5.1/config.html#confval-html_extra_path
- Looks very useful! http://sphinxcontribdatatemplates.readthedocs.io/en/latest/
- A good Sphinx table extension would be useful: https://github.com/sphinx-doc/sphinx/issues/786
- Not sure if this is useful! https://pythonhosted.org/sphinxcontrib-restbuilder/
- Maybe: https://pypi.python.org/pypi/sphinxcontrib-jsoncall
- Looks interesting, probably not useful here: https://jsdoc-toolkit-rst-template.readthedocs.io/en/latest/
Details¶
This page contains some notes with details about gamma-cat.
Data¶
Reference identifiers¶
For paper identifiers, we use the ADS identifiers.
These are unique, well-known and stable. This corresponds to the bibcode in https://github.com/andycasey/ads/, i.e. can be used to obtain further info from ADS
Note that some bibcodes contain characters that don’t work well (or at all) as directory or filenames, e.g. 2011A&A…531L..18H with the & character. What ADS does in that case for URLs is to quote them, i.e. the URL is http://adsabs.harvard.edu/abs/2011A%26A…531L..18H . In gamma-cat we do the same, we URL quote the bibcode for filenames, folder names and URLs, and otherwise use the normal bibcode.
>>> papers = list(ads.SearchQuery(bibcode='2011A&A...531L..18H'))
>>> print(papers[0].bibcode)
'2011A&A...531L..18H'
>>> import urllib.parse
>>> urllib.parse.quote('2011A&A...531L..18H')
'2011A%26A...531L..18H'
>>> urllib.parse.unquote('2011A%26A...531L..18H')
'2011A&A...531L..18H'
Source identifiers¶
- We use integer source identifiers. In many cases they are the same as for the TeGeV catalog, but generally that is not the case.
- We do not introduce new sources “names” (for now). TBD: how should people reference sources from our catalog? Maybe we should do a position-based identifier like TeVCat or TeGeV cat?
- TBD: How do we handle sources that split out into multiple sources with deeper observations?
Source classes¶
TODO: document properly.
For now, see the list of source classes we’re using at the end of this schema file:
https://github.com/gammapy/gamma-cat/blob/master/input/schemas/basic_source_info.schema.yaml
Positions¶
Sometimes source positions aren’t measured or given in the paper. This is commonly the case for AGN. In those cases, we use the position from SIMBAD and look it up like this:
>>> from astropy.coordinates import SkyCoord
>>> SkyCoord.from_name('Crab nebula').to_string(precision=7)
'83.6330830 22.0145000'
and store it like this:
position:
simbad_id: Crab nebula
ra: 83.6330830
dec: 22.0145000
The presence of the simbad_id key means that it’s a position from SIMBAD.