Tutorials¶
This page lists the Gammapy tutorials that are available as Jupyter notebooks.
You can read them here, or execute them using a temporary cloud server in Binder.
To execute them locally, you have to first install Gammapy locally (see
Installation) and download the tutorial notebooks and example datasets (see
Getting Started). Once Gammapy is installed, remember that you can always
use gammapy info
to check your setup.
Gammapy is a Python package built on Numpy and Astropy, so to use it effectively, you have to learn the basics. Many good free resources are available, e.g. A Whirlwind tour of Python, the Python data science handbook and the Astropy Hands-On Tutorial.
Getting started¶
The following tutorials show how to use gammapy to perform a complete data analysis, here a simple 3D cube analysis of the Crab. They show the gammapy workflow from data selection to data reduction and finally modeling and fitting.
First, we show how to do it with the high level interface in configuration-driven approach. The second tutorial exposes the same analysis, this time using the medium level API, showing what is happening ‘under-the-hood’:
Configuration driven analysis | analysis_1.ipynb
Lower level analysis | analysis_2.ipynb
Core tutorials¶
The following tutorials expose common analysis tasks.
Accessing and exploring DL3 data
Overview | overview.ipynb
CTA with Gammapy | cta.ipynb
H.E.S.S. with Gammapy | hess.ipynb
1-dim spectral analysis
Spectral analysis | spectrum_analysis.ipynb
Flux point fitting | sed_fitting.ipynb
2-dim sky image analysis
Ring background map creation | ring_background.ipynb
2D map fitting | modeling_2D.ipynb
3-dim sky cube analysis
CTA data analysis | cta_data_analysis.ipynb
3D analysis | analysis_3d.ipynb
Time-dependent analysis
Light curves | light_curve.ipynb
Light curves for flares | light_curve_flare.ipynb
Simulating and fiting a time varying source | light_curve_simulation.ipynb
Simulations
1D spectrum simulation | spectrum_simulation.ipynb
3D map simulation | simulate_3d.ipynb
Event sampling | event_sampling.ipynb
Advanced tutorials¶
The following tutorials expose how to perform more complex analyses or they demonstrate how to use the Gammapy API.
Exclusion masks
How to create an exclusion mask | exclusion_mask.ipynb
Source detection
Source detection and significance maps | detect.ipynb
Spectral analysis
Spectral analysis of extended sources | extended_source_spectral_analysis.ipynb
Multi-instrument analysis
Multi instrument joint 3D and 1D analysis | analysis_mwl.ipynb
A Fermi-LAT analysis with Gammapy | fermi_lat.ipynb
Sensitivity estimation
Point source sensitivity | cta_sensitivity.ipynb
Modeling and fitting in gammapy
Modeling and Fitting | modeling.ipynb
Models | models.ipynb
Working with catalogs
Source catalogs | catalog.ipynb
Working with gammapy maps
Maps | maps.ipynb
Extra topics¶
These notebooks contain examples on some more specialised functionality in Gammapy.
Dark matter spatial and spectral models | astro_dark_matter.ipynb
Make template background model | background_model.ipynb
MCMC sampling of Gammapy models using the emcee package | mcmc_sampling.ipynb
Pulsar analysis with Gammapy | pulsar_analysis.ipynb