Adapt joint tutorials notebook
"from pathlib import Path\n",
"from astropy import units as u\n",
"from astropy.coordinates import SkyCoord\n",
- "from regions import RectangleSkyRegion"
+ "from regions import CircleSkyRegion"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "rectangle = RectangleSkyRegion(\n",
- " geom.center_skydir, width=3 * u.deg, height=0.8 * u.deg\n",
- ")"
+ "region = CircleSkyRegion(spatial_model.position, radius=0.15 * u.deg)"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "datasets[0].plot_residuals(\n",
- " on_region=rectangle, vmin=-1, vmax=1, width=(4 * u.deg, 3 * u.deg)\n",
- ")"
+ "ax_image, ax_spec = datasets[0].plot_residuals(region=region, vmin=-0.5, vmax=0.5, method=\"diff\")"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "datasets[1].plot_residuals(\n",
- " on_region=rectangle, vmin=-1, vmax=1, width=(4 * u.deg, 3 * u.deg)\n",
- ")"
+ "datasets[1].plot_residuals(region=region, vmin=-0.5, vmax=0.5);"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "datasets[2].plot_residuals(\n",
- " on_region=rectangle, vmin=-1, vmax=1, width=(4 * u.deg, 3 * u.deg)\n",
- ")"
+ "datasets[2].plot_residuals(region=region, vmin=-0.5, vmax=0.5);"
]
},
{
" vmin=-1, vmax=1, cmap=\"coolwarm\", add_cbar=True, stretch=\"linear\"\n",
");"
]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
}
],
"metadata": {
