Fix exclusion mask tutorial
"from gammapy.utils.regions import make_region\n",
"from gammapy.catalog import CATALOG_REGISTRY\n",
"from gammapy.datasets import Datasets\n",
- "from gammapy.estimators import ExcessMapEstimator"
+ "from gammapy.estimators import ExcessMapEstimator\n",
+ "from gammapy.modeling.models import FoVBackgroundModel"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "datasets = Datasets.read(\n",
- " \"$GAMMAPY_DATA/fermi-3fhl-crab/\",\n",
- " \"Fermi-LAT-3FHL_datasets.yaml\",\n",
- " \"Fermi-LAT-3FHL_models.yaml\",\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "We want to compute the significance per pixels for the data integrated over energy. We reduce the dataset to a simple image. "
+ "filename = \"$GAMMAPY_DATA/fermi-3fhl-crab/Fermi-LAT-3FHL_datasets.yaml\"\n",
+ "datasets = Datasets.read(filename=filename)"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "dataset = datasets[0].to_image()"
+ "datasets.models = [FoVBackgroundModel(dataset_name=\"Fermi-LAT\")]"
]
},
{
"outputs": [],
"source": [
"estimator = ExcessMapEstimator(\"0.4 deg\", selection_optional=[])\n",
- "result = estimator.run(dataset)"
+ "result = estimator.run(datasets[\"Fermi-LAT\"])"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "mask_map_significance.sum_over_axes().plot()"
+ "mask_map_significance.sum_over_axes().plot();"
]
},
{
