Improve maks_fit handling in analysis_3d notebook
"\n",
"We choose a point source model with an exponential cutoff power-law spectrum.\n",
"\n",
- "To select a certain energy range for the fit we can create a fit mask:"
+ "To perform the fit on a restricted energy range, we can create a *fit mask*. \n",
+ "The fit mask is a `Map` sharing the same geometry as the `MapDataset` and \n",
+ "containing boolean data. \n",
+ "\n",
+ "To create a mask to limit the fit within a restricted energy range, one can \n",
+ "rely on the `~gammapy.maps.Geom.energy_mask()` method."
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "coords = dataset_stacked.counts.geom.get_coord()\n",
- "mask_energy = coords[\"energy\"] > 0.3 * u.TeV\n",
- "dataset_stacked.mask_fit = Map.from_geom(\n",
- " geom=dataset_stacked.counts.geom, data=mask_energy\n",
- ")"
+ "dataset_stacked.mask_fit = dataset_stacked.counts.geom.energy_mask(energy_min=0.3*u.TeV,\n",
+ " energy_max=None)"
]
},
{
