From 6cdc6149cec4e3481a1d39289e530e2a02e870eb Mon Sep 17 00:00:00 2001 From: Xen0Xys Date: Thu, 8 Aug 2024 11:29:46 +0200 Subject: [PATCH] :memo: Add documentation and update changelog --- CHANGELOG.md | 1 + examples/02_Base_Commands.ipynb | 77 +++++++++++++++------------------ 2 files changed, 36 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32ae3aeb..b7c3bb27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add selected sources export as `astropy.Table` list with property `selected_objects` (#100) - Add function `get_view_as_fits` to export the view as a `astropy.io.fits.HDUList` (#86) - Add function `save_view_as_image` to save the view as an image file (#108) +- Add function `add_marker` to add a marker on the view (#111) ### Deprecated diff --git a/examples/02_Base_Commands.ipynb b/examples/02_Base_Commands.ipynb index 6c2ae00d..f06f6ec7 100644 --- a/examples/02_Base_Commands.ipynb +++ b/examples/02_Base_Commands.ipynb @@ -15,6 +15,7 @@ "outputs": [], "source": [ "from ipyaladin import Aladin\n", + "from ipyaladin.utils.marker import Marker\n", "from pathlib import Path" ] }, @@ -64,9 +65,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "aladin.target = \"sgr a*\"" @@ -74,12 +73,12 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "aladin.target" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -91,9 +90,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "aladin.fov = 2" @@ -118,9 +115,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "aladin.overlay_survey = \"P/allWISE/color\"\n", @@ -137,9 +132,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "aladin.coo_frame = \"ICRSd\" # ICRS, and angles expressed in degrees" @@ -163,12 +156,12 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from astropy.coordinates import Angle, SkyCoord" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", @@ -204,32 +197,32 @@ "source": [ "aladin.add_fits(Path(\"images/m31.fits\"), name=\"M31\", opacity=0.5)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can add markers to the view of the widget with custom popup title and description!\n", + "Here we will add markers for Messier objects M1 to M10." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "markers = []\n", + "for i in range(1, 11):\n", + " name = f\"M{i}\"\n", + " markers.append(Marker(name, name, f\"This is Messier {i}\"))\n", + "aladin.add_marker(markers, name=\"M1-M10\")\n", + "aladin.target = \"M1\"\n", + "aladin.fov = 0.2" + ] } ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "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" - }, - "vscode": { - "interpreter": { - "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" - } - } - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 4 }