Skip to content

Commit

Permalink
📝 Add export_view_as_image example in notebook 11
Browse files Browse the repository at this point in the history
  • Loading branch information
Xen0Xys committed Aug 1, 2024
1 parent aa75cb8 commit e38dc23
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions examples/11_Extracting_information_from_the_view.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"id": "998def1f-3963-405b-8be2-6d4ef4012634",
"metadata": {},
"source": [
"If you edit the view either by modifiing the widget through its interface, or programmatically: "
"If you edit the view either by modifiing the widget through its interface, or programmatically:"
]
},
{
Expand Down Expand Up @@ -106,7 +106,7 @@
"id": "f5add3a2-be30-488e-86df-426338b98f5d",
"metadata": {},
"source": [
"If you try to recover the value in the **same cell**, you'll get a `WidgetCommunicationError` error. This is because the calculation of the WCS is done by Aladin Lite *between* cell executions. \n",
"If you try to recover the value in the **same cell**, you'll get a `WidgetCommunicationError` error. This is because the calculation of the WCS is done by Aladin Lite *between* cell executions.\n",
"\n",
"## Getting the field of view\n",
"\n",
Expand Down Expand Up @@ -204,7 +204,7 @@
"metadata": {},
"source": [
"## Getting the view as a fits file\n",
"The following method allow you to retrieve the current view as a fits file. If a `path` is given as a second argument, the fits file will be saved."
"The following method allow you to retrieve the current view as a fits file."
]
},
{
Expand Down Expand Up @@ -247,13 +247,28 @@
"plt.subplot(projection=wcs)\n",
"plt.imshow(fits[0].data, cmap=\"binary_r\", norm=\"asinh\", vmin=0.001)"
]
},
{
"cell_type": "markdown",
"id": "c64190a2757b707",
"metadata": {},
"source": [
"## Saving the view as an image file\n",
"The following method allow you to save the current view as an image file. The first argument is the path to the file, the second is the format (png, jpg, pdf, svg, eps), and the third is a boolean to indicate if you want to include the Aladin Lite logo in the image."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "85f40dc5e6af3ae1",
"metadata": {},
"outputs": [],
"source": [
"aladin.export_view_as_image(\"./image.png\", \"png\", True)"
]
}
],
"metadata": {
"nbsphinx": {
"execute": "never"
}
},
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit e38dc23

Please sign in to comment.