Commit 415eb5cad1eee0ecabdd840de8e4003fbdc30ece
1 parent
1b831d9b
Add page about plotting to user manual
Showing
2 changed files
with
57 additions
and
0 deletions
doc/source/user_manual/index.rst
doc/source/user_manual/plotting.rst
0 → 100644
| 1 | +Plotting | ||
| 2 | +======== | ||
| 3 | + | ||
| 4 | +Gammalib and ctools currently do not include classes and scripts to make plots. | ||
| 5 | + | ||
| 6 | +This is intentional because creating and maintaining plotting tools that work on most user's machines | ||
| 7 | +and cover most user's needs is a big project in itself, and deciding to support a | ||
| 8 | +plotting package that is popular now as part of the CTA science tools could become very problematic in the future. | ||
| 9 | + | ||
| 10 | +But we realise that most ctools users need to create plots for their high-level science results, | ||
| 11 | +so on this page we provide a few pointers to external packages and tools. | ||
| 12 | + | ||
| 13 | +General | ||
| 14 | +------- | ||
| 15 | + | ||
| 16 | +The most common way to create publication-quality astronomy plots at the moment is to use the `matplotlib`_ | ||
| 17 | +Python plotting package. As illustrated by the `matplotlib gallery`_, virtually any plot can be constructed, | ||
| 18 | +but matplotlib doesn't have built-in easy-to-use classes or functions to create the common plots for gamma-ray | ||
| 19 | +astronomy, which are sky maps and spectra, so in the sections below we give some specific pointers for those. | ||
| 20 | + | ||
| 21 | +Sky maps | ||
| 22 | +-------- | ||
| 23 | + | ||
| 24 | +For creating publication quality sky map plots via a Python script a good choice is to use `APLPy`_, `WCSAxes`_ | ||
| 25 | +or `kapteyn`_, which are all based on matplotlib. | ||
| 26 | + | ||
| 27 | +You can also use interactive astronomy image viewers like `DS9`_, `Aladin`_ or `Ginga`_ | ||
| 28 | +which allow you to save the image to a PNG or PDF file after customising it interactively, | ||
| 29 | +but also contain command line options to create the plot, i.e. you can write a bash or Python script | ||
| 30 | +to make the plot reproducible (DS9 and Ginga also feature direct communication with Python, | ||
| 31 | +but that is a bit harder to use and usually used for interactive image analysis, not plotting scripts). | ||
| 32 | + | ||
| 33 | + | ||
| 34 | +Spectra and light curves | ||
| 35 | +------------------------ | ||
| 36 | + | ||
| 37 | +To plot spectra or spectral energy distributions (including flux model curves, flux model error bands, | ||
| 38 | +flux points and residuals) and light curves, you can use matplotlib directly, | ||
| 39 | +or use the classes and scripts in `Gammapy`_. | ||
| 40 | + | ||
| 41 | +Another option is to use virtual observatory interactive spectrum tools like `IRIS`_, `CASSIS`_ or `VOSpec`_ | ||
| 42 | +which allow you to save the plot to a PNG or PDF file after creating it interactively. | ||
| 43 | + | ||
| 44 | + | ||
| 45 | +.. _DS9: http://ds9.si.edu/ | ||
| 46 | +.. _Aladin: http://aladin.u-strasbg.fr/ | ||
| 47 | +.. _Ginga: http://ejeschke.github.io/ginga/ | ||
| 48 | +.. _matplotlib: http://matplotlib.org/ | ||
| 49 | +.. _matplotlib gallery: http://matplotlib.org/gallery.html | ||
| 50 | +.. _WCSAxes: http://wcsaxes.readthedocs.org/ | ||
| 51 | +.. _APLPy: http://aplpy.github.io/ | ||
| 52 | +.. _kapteyn: https://www.astro.rug.nl/software/kapteyn/ | ||
| 53 | +.. _Gammapy: https://gammapy.readthedocs.org/ | ||
| 54 | +.. _IRIS: http://cxc.cfa.harvard.edu/iris/ | ||
| 55 | +.. _CASSIS: http://cassis.irap.omp.eu/ | ||
| 56 | +.. _VOSpec: http://www.sciops.esa.int/index.php?project=SAT&page=vospec |