This folder contains the analysis notebooks shown in the Gammapy hands on session at the May 2022 CTAC/CTAO Meeting in Bologna.
These instructions assume that you have previously installed a version of Anaconda or Miniconda on your machine.
We recommend that you install the latest version of gammapy as follows:
curl -O https://gammapy.org/download/install/gammapy-0.20-environment.yml
conda env create -f gammapy-0.20-environment.yml
conda activate gammapy-0.20
To download the tutorials and associated datasets (necessary for the tutorials in this workshop)
gammapy download notebooks --release 0.20
gammapy download datasets
export GAMMAPY_DATA=$PWD/gammapy-datasets
To check that the gammapy environment is working fine, open a new terminal and type
conda activate gammapy-0.20
gammapy info
To further check that you have correctly set up the data folder type
ipython
Then in the ipython window, type
from gammapy.data import DataStore
ds = DataStore.from_dir("$GAMMAPY_DATA/hess-dl3-dr1")
obs = ds.get_observations()
print(len(obs))
If the cells run without any error and prints 105
, Congratulations! You have correctly set-up gammapy
Finally, to get the tutorials for this hands-on gammapy session you can clone this repository on your machine using
git clone https://github.com/luca-giunti/CTAO-CTAC_Meeting_Bologna_2022.git
To access the tutorials:
cd CTAO-CTAC_Meeting_Bologna_2022
jupyter lab
A full 1D (spectral) analysis from A to Z for a point-like extra-Galactic source.
A full 3D analysis from A to Z for an extended Galactic source.