Updated analysis_1 notebook to include excess map
"metadata": {},
"source": [
"### Setting modeling and fitting parameters\n",
- "`Analysis` can perform a few modeling and fitting tasks besides data reduction. Parameters have then to be passed to the configuration object."
+ "`Analysis` can perform a few modeling and fitting tasks besides data reduction. Parameters have then to be passed to the configuration object.\n",
+ "\n",
+ "Here we define the energy range on which to perform the fit. We also set the energy edges used for flux point computation as well as the correlation radius to compute excess and significance maps. "
]
},
{
"source": [
"config.fit.fit_range.min = 1 * u.TeV\n",
"config.fit.fit_range.max = 10 * u.TeV\n",
- "config.flux_points.energy = {\"min\": \"1 TeV\", \"max\": \"10 TeV\", \"nbins\": 3}"
+ "config.flux_points.energy = {\"min\": \"1 TeV\", \"max\": \"10 TeV\", \"nbins\": 3}\n",
+ "config.excess_map.correlation_radius = 0.1 * u.deg"
]
},
{
"counts.smooth(\"0.05 deg\").plot_interactive()"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "We can also compute the map of the sqrt_ts (significance) of the excess counts above the background. The correlation radius to sum counts is defined in the config file."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "analysis.get_excess_map()\n",
+ "analysis.excess_maps[\"sqrt_ts\"].plot(add_cbar=True)"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
"analysis.flux_points.write(filename, overwrite=True)"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "To check the fit is correct, we compute the map of the sqrt_ts of the excess counts above the current model."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "analysis.get_excess_map()\n",
+ "analysis.excess_maps[\"sqrt_ts\"].plot(add_cbar=True)"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
