From 148eb5fbc012028c26f64d0916e3da7266fce87e Mon Sep 17 00:00:00 2001 From: MARCHAND MANON Date: Wed, 31 Jul 2024 12:22:23 +0200 Subject: [PATCH] docs: edit plot instructions --- ...Extracting_information_from_the_view.ipynb | 127 +++++++++--------- 1 file changed, 61 insertions(+), 66 deletions(-) diff --git a/examples/11_Extracting_information_from_the_view.ipynb b/examples/11_Extracting_information_from_the_view.ipynb index ed3afb69..a23d456a 100644 --- a/examples/11_Extracting_information_from_the_view.ipynb +++ b/examples/11_Extracting_information_from_the_view.ipynb @@ -15,8 +15,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "initial_id", "metadata": {}, + "outputs": [], "source": [ "from astropy.coordinates import SkyCoord\n", "import astropy.units as u\n", @@ -26,20 +28,18 @@ "import matplotlib.pyplot as plt\n", "\n", "from ipyaladin import Aladin" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "2e62d34eb8543145", "metadata": {}, + "outputs": [], "source": [ "aladin = Aladin(fov=5, height=600, target=\"M31\")\n", "aladin" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -53,13 +53,13 @@ }, { "cell_type": "code", + "execution_count": null, "id": "84153657cb7cd837", "metadata": {}, + "outputs": [], "source": [ "aladin.wcs # Recover the current WCS" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -71,17 +71,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "a63f210b-3a64-4860-8e70-42a4c66378fa", "metadata": {}, + "outputs": [], "source": [ "aladin.height = 800\n", "aladin.survey = \"CDS/P/PLANCK/R2/HFI/color\"\n", "aladin.target = \"LMC\"\n", "aladin.frame = \"Galactic\"\n", "aladin.fov = 50" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -93,13 +93,13 @@ }, { "cell_type": "code", + "execution_count": null, "id": "2ddc9637-b5c3-4412-8435-2302b6d86816", "metadata": {}, + "outputs": [], "source": [ "aladin.wcs" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -115,13 +115,13 @@ }, { "cell_type": "code", + "execution_count": null, "id": "9595ae02388b245a", "metadata": {}, + "outputs": [], "source": [ "aladin.fov_xy # Recover the current field of view for the x and y axis" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -134,8 +134,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "bb48cb19a597e262", "metadata": {}, + "outputs": [], "source": [ "m1 = SkyCoord.from_name(\"m1\")\n", "\n", @@ -144,23 +146,21 @@ "usno = Vizier(catalog=\"I/284/out\", row_limit=-1).query_region(m1, radius=0.05 * u.deg)[\n", " 0\n", "]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "0030a996", "metadata": {}, + "outputs": [], "source": [ "aladin.add_table(simbad, name=\"simbad\", color=\"purple\", shape=\"circle\", source_size=20)\n", "aladin.add_table(usno, name=\"usno\", color=\"teal\", shape=\"square\", source_size=20)\n", "aladin.target = m1\n", "aladin.fov = 0.3\n", "aladin.survey = \"CDS/P/PanSTARRS/DR1/g\"" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -172,13 +172,13 @@ }, { "cell_type": "code", + "execution_count": null, "id": "3efb33016d863bf7", "metadata": {}, + "outputs": [], "source": [ "aladin.selection(\"circle\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -190,74 +190,69 @@ }, { "cell_type": "code", + "execution_count": null, "id": "cda32891dd654568", "metadata": {}, + "outputs": [], "source": [ "aladin.selected_objects" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "c84e856d82dbde63", + "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." - ], - "id": "c84e856d82dbde63" + ] }, { - "metadata": {}, "cell_type": "code", - "source": "fits = aladin.get_view_as_fits()", + "execution_count": null, "id": "6b0d3e2131e9faa2", + "metadata": {}, "outputs": [], - "execution_count": null + "source": [ + "fits = aladin.get_view_as_fits()" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "020d2c7f", "metadata": {}, - "cell_type": "markdown", - "source": "Display the fits file using matplotlib:", - "id": "36a996b424529c09" + "outputs": [], + "source": [ + "fits[0].header" + ] }, { + "cell_type": "markdown", + "id": "36a996b424529c09", "metadata": {}, + "source": [ + "Display the fits file using matplotlib:" + ] + }, + { "cell_type": "code", + "execution_count": null, + "id": "8327802bad8e8c87", + "metadata": {}, + "outputs": [], "source": [ - "wcs = WCS(fits[0].header).dropaxis(2)\n", + "wcs = WCS(fits[0].header)\n", "\n", "plt.subplot(projection=wcs)\n", - "plt.imshow(fits[0].data[0, :, :], cmap=\"gray\")" - ], - "id": "8327802bad8e8c87", - "outputs": [], - "execution_count": null + "plt.imshow(fits[0].data, cmap=\"binary_r\", norm=\"asinh\", vmin=0.001)" + ] } ], "metadata": { - "nbsphinx": { - "execute": "never" - }, - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.8" - }, - "version_major": 2, - "version_minor": 0 + "name": "python" + } }, "nbformat": 4, "nbformat_minor": 5