diff --git a/examples/11_Extracting_information_from_the_view.ipynb b/examples/11_Extracting_information_from_the_view.ipynb index 4b301e7..c3653e9 100644 --- a/examples/11_Extracting_information_from_the_view.ipynb +++ b/examples/11_Extracting_information_from_the_view.ipynb @@ -26,6 +26,7 @@ "from astroquery.simbad import Simbad\n", "from astroquery.vizier import Vizier\n", "import matplotlib.pyplot as plt\n", + "import numpy as np\n", "\n", "from ipyaladin import Aladin" ] @@ -255,7 +256,8 @@ "source": [ "## Saving the view as an image file\n", "\n", - "In `save_view_as_image`, the first argument is the path to the file, the second is the format (\"png\", \"jpeg\", \"webp\"), and the third is a boolean to indicate if you want to include the Aladin Lite logo in the image." + "`save_view_as_image` takes a screenshot of the widget. The first argument is the path where the file should be written, the second is the format (\"png\", \"jpeg\", \"webp\"), and the third is a boolean to indicate if you want to include the Aladin Lite logo in the image. \n", + "These data are reflecting the pixels on the screen. For scientific use cases, opt for `get_view_as_fits` that is a bit longer since it retrieves the actual survey from a server." ] }, { @@ -265,6 +267,7 @@ "metadata": {}, "outputs": [], "source": [ + "screenshot_wcs = aladin.wcs\n", "aladin.save_view_as_image(path=\"./crab.png\", image_format=\"png\", with_logo=True)" ] }, @@ -278,6 +281,28 @@ "img = plt.imread(\"./crab.png\")\n", "plt.imshow(img)" ] + }, + { + "cell_type": "markdown", + "id": "dde7fe44", + "metadata": {}, + "source": [ + "And with the WCS that we stored at the same time than the screenshot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "89d8f226", + "metadata": {}, + "outputs": [], + "source": [ + "img = plt.imread(\"./crab.png\")\n", + "plt.subplot(projection=screenshot_wcs)\n", + "plt.imshow(\n", + " np.flipud(img)\n", + ") # in FITS, the lines of pixels are flipped, so we have to mimic this" + ] } ], "metadata": {