.. include:: references.txt .. _tutorials: Gammapy tutorial notebooks ========================== What is this? ------------- - This is an overview of tutorial `Jupyter `__ notebooks for `Gammapy `__, a Python package for gamma-ray astronomy. - The notebooks complement the Gammapy Sphinx-based documentation at http://docs.gammapy.org - The notebooks and example datasets are available at https://github.com/gammapy/gammapy-extra Set up ------ The Gammapy installation instructions are here: :ref:`install` One quick way to get set up, that works the same on Linux, Mac and Windows is this: * Install Anaconda or Miniconda (see https://www.anaconda.com/download/ ) * Get the following repository that contains the Gammapy tutorial notebooks:: git clone https://github.com/gammapy/gammapy-extra.git export GAMMAPY_EXTRA=$PWD/gammapy-extra * Create a Python conda environment that contains all software used in the tutorials:: cd gammapy-extra conda env create -f environment.yml * If you already have that environment, but want to update:: conda env update -f environment.yml * Activate the environment and start Jupyter:: source activate gammapy-tutorial cd notebooks jupyter notebook * Select and start the notebook you want in your webbrowser. If you have any questions, ask for help. See http://gammapy.org/contact.html Execute tutorials online ------------------------ If you want, you can execute latest version of the collection of notebooks on-line accessing the `Gammapy Binder `__ space. Click the "launch binder" link here, or at the top of each notebook below: .. image:: http://mybinder.org/badge.svg :target: http://mybinder.org/repo/gammapy/gammapy-extra Note that this is a free, temporary notebook server. You cannot upload your data or save your work there. For that, install Gammapy on your machine and work there. The basics ---------- Gammapy is a Python package built on Numpy and Astropy, and the tutorials are Jupyter notebooks. If you're already familar with those, you can skip to the next section and start learning about Gammapy. To learn the basics, here are a few good resources. Python ++++++ - `A Whirlwind tour of Python `__ (learn Python) Scientific Python +++++++++++++++++ - `Python data science handbook `__ (learn IPython, Numpy, matplotlib) Astropy +++++++ - `Astropy introduction for Gammapy users `__ | *astropy_introduction.ipynb* - `Astropy Hands On (1st ASTERICS-OBELICS International School) `__ Other useful resources: - http://www.astropy.org/astropy-tutorials - http://astropy.readthedocs.io - https://python4astronomers.github.io/ Notebooks --------- For a quick introduction to Gammapy, go here: - `First steps with Gammapy `__ | *first_steps.ipynb* Interested to do a first analysis of simulated CTA data? - `CTA first data challenge (1DC) with Gammapy `__ | *cta_1dc_introduction.ipynb* - `CTA data analysis with Gammapy `__ | *cta_data_analysis.ipynb* To learn how to work with gamma-ray data with Gammapy: - `IACT DL3 data with Gammapy `__ (H.E.S.S data example) | *data_iact.ipynb* - `Fermi-LAT data with Gammapy `__ (Fermi-LAT data example) | *data_fermi_lat.ipynb* 2-dimensional sky image analysis: - `Image analysis with Gammapy (run pipeline) `__ (H.E.S.S. data example) | *image_pipe.ipynb* - `Image analysis with Gammapy (individual steps) `__ (H.E.S.S. data example) | *image_analysis.ipynb* - `Source detection with Gammapy `__ (Fermi-LAT data example) | *detect_ts.ipynb* - `CTA 2D source fitting with Sherpa `__ | *image_fitting_with_sherpa.ipynb* 1-dimensional spectral analysis: - `Spectral models in Gammapy `__ | *spectrum_models.ipynb* - `Spectral analysis with Gammapy (run pipeline) `__ (H.E.S.S. data example) | *spectrum_pipe.ipynb* - `Spectral analysis with Gammapy (individual steps) `__ (H.E.S.S. data example) | *spectrum_analysis.ipynb* - `Spectrum simulation and fitting `__ (CTA data example with AGN / EBL) | *cta_simulation.ipynb* - `Fitting gammapy spectra with sherpa `__ | *spectrum_fitting_with_sherpa.ipynb* - `Flux point fitting with Gammapy `__ | *sed_fitting_gammacat_fermi.ipynb* 3-dimensional cube analysis: - `Cube analysis with Gammapy (part 1) `__ (compute cubes and mean PSF / EDISP) | *cube_analysis_part1.ipynb* - `Cube analysis with Gammapy (part 2) `__ (likelihood fit) | *cube_analysis_part2.ipynb* Time-related analysis: - `Light curve estimation with Gammapy `__ | *light_curve.ipynb* Extra topics ++++++++++++ These notebooks contain examples on some more specialised functionality in Gammapy. Most users will not need them. It doesn't make much sense that you read through all of them, but maybe browse the list and see if there's something that could be interesting for your work (or contribute to Gammapy if something is missing!). - `Template background model production with Gammapy `__ | *background_model.ipynb* - `Continuous wavelet transform on gamma-ray images `__ | *cwt.ipynb* - `Interpolation using the NDDataArray class `__ | *nddata_demo.ipynb* - `Rapid introduction on using numpy, scipy, matplotlib `__ | *using_numpy.ipynb* Work in progress ++++++++++++++++ The following notebooks are work in progress or broken. Please help make these better, or write new, better ones! - `Astrophysical source population modeling with Gammapy `__ | *source_population_model.ipynb* - `Source catalogs `__ (working with gamma-ray source catalogs) | *source_catalogs.ipynb* - `Diffuse model computation `__ (diffuse model computation) | *diffuse_model_computation.ipynb* - `Fermi Vela model `__ (Fermi Vela model) | *fermi_vela_model.ipynb* - `Simulating and analysing sources and diffuse emission `__ | *source_diffuse_estimation.ipynb* - `Time analysis with Gammapy `__ (not written yet) | *time_analysis.ipynb*