Adapt mask map tutorial
"\n",
"One might also exclude some specific part of the sky for the fit. For instance, if one wants not to model a specific source in the region of interest, or if one want to reduce the region of interest in the dataset `Geom`.\n",
"\n",
- "In the following we restrict the fit region to a square around the Crab nebula. Here we use the `regions` API to create a region from a ds9-like strings.\n",
- "\n",
- "Note: the dataset geometry is aligned on the galactic frame, we use the same frame to define the box to ensure a correct alignment."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "regions = Regions.parse(\"galactic;box(184.55, -5.78, 3.0, 3.0)\", format=\"ds9\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "#### Create the mask map \n",
- "\n",
- "We can now create the map. We use the `WcsGeom.region_mask` method putting all pixels outside the regions to False (because we only want to consider pixels inside the region. "
+ "In the following we restrict the fit region to a square around the Crab nebula. **Note**: the dataset geometry is aligned on the galactic frame, we use the same frame to define the box to ensure a correct alignment. \n",
+ "We can now create the map. We use the `WcsGeom.region_mask` method putting all pixels outside the regions to False (because we only want to consider pixels inside the region. For convenience we can directly pass a ds9 region string to the method:"
]
},
{
"metadata": {},
"outputs": [],
"source": [
+ "regions = \"galactic;box(184.55, -5.78, 3.0, 3.0)\"\n",
"mask_map = dataset.counts.geom.region_mask(regions)"
]
},
