Fix the source position and add the exclusion region
"metadata": {},
"source": [
"We want to use Crab runs from the H.E.S.S. DL3-DR1. We define here the datastore and a cone search of observations pointing with 5 degrees of the Crab nebula.\n",
- "Parameters can be set directly or as a python dict."
+ "Parameters can be set directly or as a python dict.\n",
+ "PS: do not forget to setup your environment variable _GAMMAPY\\_DATA_ to your local directory containing the H.E.S.S. DL3-DR1 (see https://github.com/gammapy/gammapy-data)"
]
},
{
"config.datasets.background.parameters = {\"method\": \"scale\"}"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Setting the exclusion mask"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "In order to properly adjust the background normalisation on regions without gamma-ray signal, one needs to define an exclusion mask for the background normalisation.\n",
+ "For this tutorial, we use the following one $GAMMAPY_DATA/joint-crab/exclusion/exclusion_mask_crab.fits.gz"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "config.datasets.background.exclusion = (\n",
+ " \"$GAMMAPY_DATA/joint-crab/exclusion/exclusion_mask_crab.fits.gz\"\n",
+ ")"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": [
"analysis.get_excess_map()\n",
- "analysis.excess_map[\"sqrt_ts\"].plot(add_cbar=True)"
+ "analysis.excess_map[\"sqrt_ts\"].plot(add_cbar=True);"
]
},
{
" value: 83.63\n",
" unit: deg\n",
" - name: lat_0 \n",
- " value: 22.14 \n",
+ " value: 22.014 \n",
" unit: deg\n",
" spectral:\n",
" type: PowerLawSpectralModel\n",
"outputs": [],
"source": [
"analysis.get_excess_map()\n",
- "analysis.excess_map[\"sqrt_ts\"].plot(add_cbar=True)"
+ "analysis.excess_map[\"sqrt_ts\"].plot(add_cbar=True);"
]
},
{
"description": "Select stretch:",
"description_tooltip": null,
"disabled": false,
- "index": 1.0,
+ "index": 1,
"layout": "IPY_MODEL_4dec76e5bf084cf490b298615ce29203",
"style": "IPY_MODEL_c360071495e048b2aca6c16a6568fd96"
}
"description": "Select energy:",
"description_tooltip": null,
"disabled": false,
- "index": 0.0,
+ "index": 0,
"layout": "IPY_MODEL_4346fce106fc4236b9ba5f0ef7eac4ab",
"orientation": "horizontal",
"readout": true,
}
}
},
- "version_major": 2.0,
- "version_minor": 0.0
+ "version_major": 2,
+ "version_minor": 0
}
}
},
