Skip to content

Commit

Permalink
Merge pull request #2540 from cdeil/mv-tuts
Browse files Browse the repository at this point in the history
Restructure tutorial notebooks
  • Loading branch information
cdeil committed Nov 14, 2019
2 parents 11a4d9c + 7a04bb5 commit a5dee0d
Show file tree
Hide file tree
Showing 16 changed files with 672 additions and 600 deletions.
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -12,7 +12,7 @@ A Python Package for Gamma-ray Astronomy
:target: http://www.astropy.org/

.. image:: http://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/gammapy/gammapy-webpage/master?urlpath=lab/tree/first_steps.ipynb
:target: https://mybinder.org/v2/gh/gammapy/gammapy-webpage/master?urlpath=lab/tree/overview.ipynb

Status shields
++++++++++++++
Expand Down
2 changes: 1 addition & 1 deletion docs/analysis/index.rst
Expand Up @@ -256,7 +256,7 @@ Using the high-level interface

Gammapy tutorial notebooks that show examples using the high-level interface:

* `hess.html <../notebooks/hess.html>`__
* `first_analysis.html <../notebooks/first_analysis.html>`__

Reference/API
=============
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog/index.rst
Expand Up @@ -114,7 +114,7 @@ Using `gammapy.catalog`
For more advanced use cases please go to the tutorial notebooks:

* `hgps.html <../notebooks/hgps.html>`__
* `first_steps.html <../notebooks/first_steps.html>`__
* `overview.html <../notebooks/overview.html>`__
* `sed_fitting_gammacat_fermi.html <../notebooks/sed_fitting_gammacat_fermi.html>`__

The following pages describe ``gammapy.catalog`` in more detail:
Expand Down
3 changes: 2 additions & 1 deletion docs/data/index.rst
Expand Up @@ -47,7 +47,8 @@ Using `gammapy.data`

Gammapy tutorial notebooks that show examples using ``gammapy.data``:

* `cta_1dc_introduction.html <../notebooks/cta_1dc_introduction.html>`__
* `cta.html <../notebooks/cta.html>`__
* `hess.html <../notebooks/hess.html>`__
* `fermi_lat.html <../notebooks/fermi_lat.html>`__

Reference/API
Expand Down
4 changes: 2 additions & 2 deletions docs/development/howto.rst
Expand Up @@ -941,7 +941,7 @@ versions of the notebooks and subsections providing its filename with the ``.ipy
and the relative path to the ``notebooks`` folder. This folder is created and populated with notebooks
at the root of the ``docs`` folder in the process of documentation building::

`Maps in first steps with Gammapy <../notebooks/first_steps.ipynb#Maps>`__
`Maps section in Gammapy overview tutorial <../notebooks/overview.ipynb#Maps>`__

Links within notebooks
++++++++++++++++++++++
Expand All @@ -951,7 +951,7 @@ and subsections using the markdown syntax to declare links to resources, as show

.. code-block:: rst
- [Maps in first steps with Gammapy](first_steps.ipynb#Maps)
- [Maps section in Gammapy overview tutorial](overview.ipynb#Maps)
- [Help!](../getting-started.rst#help)
You can also link to the Gammapy API reference documentation using the same Sphinx syntax that is used
Expand Down
3 changes: 1 addition & 2 deletions docs/irf/index.rst
Expand Up @@ -28,8 +28,7 @@ Most (at some point maybe all) classes in `gammapy.irf` have an
Getting Started
===============

See `cta_1dc_introduction.html <../notebooks/cta_1dc_introduction.html>`__ for an example how to access IACT
IRFs.
See `cta.html <../notebooks/cta.html>`__ for an example how to access IACT IRFs.

Effective area
==============
Expand Down
37 changes: 21 additions & 16 deletions docs/tutorials.rst
Expand Up @@ -22,59 +22,63 @@ Notebooks
.. toctree::
:hidden:

notebooks/first_steps.ipynb
notebooks/first_analysis.ipynb
notebooks/overview.ipynb
notebooks/maps.ipynb
notebooks/models.ipynb
notebooks/cta_1dc_introduction.ipynb
notebooks/cta.ipynb
notebooks/hess.ipynb
notebooks/fermi_lat.ipynb
notebooks/cta_data_analysis.ipynb
notebooks/analysis_3d.ipynb
notebooks/analysis_3d_joint.ipynb
notebooks/simulate_3d.ipynb
notebooks/hess.ipynb
notebooks/detect_ts.ipynb
notebooks/image_fitting_with_sherpa.ipynb
notebooks/spectrum_analysis.ipynb
notebooks/spectrum_fitting_with_sherpa.ipynb
notebooks/sed_fitting_gammacat_fermi.ipynb
notebooks/fermi_lat.ipynb
notebooks/light_curve.ipynb
notebooks/cta_sensitivity.ipynb
notebooks/spectrum_simulation.ipynb
notebooks/image_analysis.ipynb
notebooks/joint_1d_3d_analysis.ipynb


For a quick introduction to Gammapy, go here:
**Getting started**

- `First analysis <notebooks/first_analysis.html>`__ | *first_analysis.ipynb*

- `First steps with Gammapy <notebooks/first_steps.html>`__ | *first_steps.ipynb*
**Gammapy package**

- `Overview <notebooks/overview.html>`__ | *overview.ipynb*
- `Maps <notebooks/maps.html>`__ | *maps.ipynb*
- `Models <notebooks/models.html>`__ | *models.ipynb*

Interested to do a first analysis of simulated CTA data?

- `CTA first data challenge (1DC) with Gammapy <notebooks/cta_1dc_introduction.html>`__ | *cta_1dc_introduction.ipynb*
- `CTA data analysis with Gammapy <notebooks/cta_data_analysis.html>`__ | *cta_data_analysis.ipynb*
**What data can I analyse?**

To get started with H.E.S.S. data analysis see here:
- `CTA with Gammapy <notebooks/cta.html>`__ | *cta.ipynb*
- `H.E.S.S. with Gammapy <notebooks/hess.html>`__ | *hess.ipynb*
- `Fermi-LAT with Gammapy <notebooks/fermi_lat.html>`__ | *fermi_lat.ipynb*

- `H.E.S.S. with Gammapy <notebooks/hess.html>`__ | *hess.ipynb*
**Analyses**

3-dimensional cube analysis:
3-dim sky cube analysis:

- `CTA data analysis with Gammapy <notebooks/cta_data_analysis.html>`__ | *cta_data_analysis.ipynb*
- `3D analysis <notebooks/analysis_3d.html>`__ | *analysis_3d.ipynb*
- `Joint 3D analysis <notebooks/analysis_3d_joint.html>`__ | *analysis_3d_joint.ipynb*
- `3D simulation and fitting <notebooks/simulate_3d.html>`__ | *simulate_3d.ipynb*
- `Fermi-LAT data with Gammapy <notebooks/fermi_lat.html>`__ | *fermi_lat.ipynb*
- `Joint 3D and 1D analysis <notebooks/joint_1d_3d_analysis.html>`__ | *joint_1d_3d_analysis.ipynb*

2-dimensional sky image analysis:
2-dim sky image analysis:

- `Source detection with Gammapy <notebooks/detect_ts.html>`__ (Fermi-LAT data example) | *detect_ts.ipynb*
- `CTA 2D source fitting with Gammapy <notebooks/image_analysis.html>`__ (DC 1 example) | *image_analysis.ipynb*
- `CTA 2D source fitting with Sherpa <notebooks/image_fitting_with_sherpa.html>`__ | *image_fitting_with_sherpa.ipynb*


1-dimensional spectral analysis:
1-dim spectral analysis:

- `Spectral simulation with Gammapy <notebooks/spectrum_simulation.html>`__ | *spectrum_simulation.ipynb*
- `Spectral analysis with Gammapy <notebooks/spectrum_analysis.html>`__ (H.E.S.S. data example) | *spectrum_analysis.ipynb*
Expand All @@ -89,6 +93,7 @@ Sensitivity:

- `Compute the CTA sensitivity <notebooks/cta_sensitivity.html>`__ | *cta_sensitivity.ipynb*


.. _tutorials_scripts:

Scripts
Expand Down
2 changes: 1 addition & 1 deletion gammapy/data/data_store.py
Expand Up @@ -21,7 +21,7 @@ class DataStore:
The data selection and access happens using an observation
and an HDU index file as described at :ref:`gadf:iact-storage`.
For a usage example see `cta_1dc_introduction.html <../notebooks/cta_1dc_introduction.html>`__
For a usage example see `cta.html <../notebooks/cta.html>`__
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion gammapy/scripts/main.py
Expand Up @@ -102,7 +102,7 @@ def cli_download(ctx): # noqa: D301
$ gammapy download notebooks
$ gammapy download datasets
$ gammapy download tutorials --release 0.8
$ gammapy download notebooks --src first_steps
$ gammapy download notebooks --src overview
$ gammapy download datasets --src fermi-3fhl-gc --out localfolder/
"""

Expand Down
19 changes: 17 additions & 2 deletions tutorials/cta_1dc_introduction.ipynb → tutorials/cta.ipynb
Expand Up @@ -4,6 +4,21 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# CTA with Gammapy\n",
"\n",
"**TODO: rewrite this notebook!**\n",
"\n",
"This is a very old notebook, most of the content below is outdated and should be deleted.\n",
"\n",
"What should remain is a 5-10 min introduction for CTA users that have never used Gammapy,\n",
"similar to `hess.ipynb` for H.E.S.S. or `fermi_lat.ipynb` for Fermi-LAT.\n",
"\n",
"- Explain that prod 3 IRFs are available as FITS and what they contain\n",
"- Explain about first data challenge\n",
"- Mention Gammapy capabilities to simulate something for CTA or to do first analyses with CTA.\n",
"- Give some simple exercises\n",
"- Link to other tutorials and documentation that might be of interest\n",
"\n",
"![CTA first data challenge logo](images/cta-1dc.png)\n",
"\n",
"# CTA first data challenge (1DC) with Gammapy"
Expand Down Expand Up @@ -1185,9 +1200,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0"
"version": "3.7.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
7 changes: 2 additions & 5 deletions tutorials/cta_data_analysis.ipynb
Expand Up @@ -12,9 +12,7 @@
"\n",
"**This notebook shows an example how to make a sky image and spectrum for simulated CTA data with Gammapy.**\n",
"\n",
"The dataset we will use is three observation runs on the Galactic center. This is a tiny (and thus quick to process and play with and learn) subset of the simulated CTA dataset that was produced for the first data challenge in August 2017.\n",
"\n",
"**This notebook can be considered part 2 of the introduction to CTA 1DC analysis. Part one is here: [cta_1dc_introduction.ipynb](cta_1dc_introduction.ipynb)**"
"The dataset we will use is three observation runs on the Galactic center. This is a tiny (and thus quick to process and play with and learn) subset of the simulated CTA dataset that was produced for the first data challenge in August 2017.\n"
]
},
{
Expand Down Expand Up @@ -92,7 +90,7 @@
"source": [
"## Select observations\n",
"\n",
"Like explained in [cta_1dc_introduction.ipynb](cta_1dc_introduction.ipynb), a Gammapy analysis usually starts by creating a `~gammapy.data.DataStore` and selecting observations.\n",
"A Gammapy analysis usually starts by creating a `~gammapy.data.DataStore` and selecting observations.\n",
"\n",
"This is shown in detail in the other notebook, here we just pick three observations near the galactic center."
]
Expand Down Expand Up @@ -546,7 +544,6 @@
"## What next?\n",
"\n",
"* This notebook showed an example of a first CTA analysis with Gammapy, using simulated 1DC data.\n",
"* This was part 2 for CTA 1DC turorial, the first part was here: [cta_1dc_introduction.ipynb](cta_1dc_introduction.ipynb)\n",
"* Let us know if you have any question or issues!"
]
}
Expand Down

0 comments on commit a5dee0d

Please sign in to comment.