{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Display of a Multi Order Coverage (MOC)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipyaladin import Aladin\n", "from mocpy import MOC\n", "import astropy.units as u\n", "\n", "aladin = Aladin(target=\"15 26 20.534 -57 02 14.74\", fov=135, survey=\"P/Mellinger/color\")\n", "aladin" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## From an URL" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "aladin.add_moc(\n", " \"https://alasky.u-strasbg.fr/footprints/tables/vizier/II_337_vvv1/MOC?nside=256\",\n", " color=\"violet\",\n", " opacity=0.3,\n", ")" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## From a dictionnary" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "moc = {\n", " \"4\": [\n", " 32,\n", " 33,\n", " 36,\n", " 51,\n", " 54,\n", " 55,\n", " 98,\n", " 99,\n", " 102,\n", " 112,\n", " 113,\n", " 116,\n", " 117,\n", " 1101,\n", " 1118,\n", " 1600,\n", " 1638,\n", " 2581,\n", " 2582,\n", " 2588,\n", " 2590,\n", " 2612,\n", " 2614,\n", " 2620,\n", " 2622,\n", " 2708,\n", " 2710,\n", " 2716,\n", " 2718,\n", " 2749,\n", " ],\n", " \"5\": [\n", " 42,\n", " 43,\n", " 150,\n", " 151,\n", " 152,\n", " 153,\n", " 156,\n", " 157,\n", " 194,\n", " 195,\n", " 198,\n", " 199,\n", " 200,\n", " 201,\n", " 203,\n", " 210,\n", " 378,\n", " 379,\n", " 382,\n", " 383,\n", " 387,\n", " 390,\n", " 391,\n", " 402,\n", " 403,\n", " 406,\n", " 407,\n", " 412,\n", " 413,\n", " 456,\n", " 457,\n", " 460,\n", " 461,\n", " 472,\n", " 1470,\n", " 1751,\n", " 1755,\n", " 1756,\n", " 1757,\n", " 1758,\n", " 1766,\n", " 1767,\n", " 1769,\n", " 1770,\n", " 1771,\n", " 1772,\n", " 1773,\n", " 1776,\n", " 1777,\n", " 1778,\n", " 1811,\n", " 1817,\n", " 1818,\n", " 1831,\n", " 1835,\n", " 1836,\n", " 1838,\n", " 1840,\n", " 1920,\n", " 1921,\n", " 1922,\n", " 4188,\n", " 4189,\n", " 4363,\n", " 4366,\n", " 4367,\n", " 4389,\n", " 4400,\n", " 4401,\n", " 4450,\n", " 4451,\n", " 4454,\n", " 4456,\n", " 4457,\n", " 4460,\n", " 4461,\n", " 4463,\n", " 4476,\n", " 4478,\n", " 4479,\n", " 4561,\n", " 4564,\n", " 4565,\n", " 6229,\n", " 6408,\n", " 6409,\n", " 6411,\n", " 6412,\n", " 6414,\n", " 6433,\n", " 6436,\n", " 6438,\n", " 6439,\n", " 6444,\n", " 6445,\n", " 6447,\n", " 6533,\n", " 6544,\n", " 6546,\n", " 6577,\n", " 6579,\n", " 6582,\n", " 6588,\n", " 6590,\n", " 6591,\n", " 6933,\n", " 6935,\n", " 6984,\n", " 6986,\n", " 7008,\n", " 7011,\n", " 7017,\n", " 10321,\n", " 10323,\n", " 10332,\n", " 10333,\n", " 10334,\n", " 10356,\n", " 10358,\n", " 10364,\n", " 10366,\n", " 10445,\n", " 10447,\n", " 10469,\n", " 10477,\n", " 10479,\n", " 10821,\n", " 10823,\n", " 10878,\n", " 10960,\n", " 10961,\n", " 10963,\n", " 10964,\n", " 10966,\n", " 10969,\n", " 10971,\n", " 10972,\n", " 10974,\n", " 10975,\n", " 11004,\n", " 11005,\n", " 11007,\n", " 11176,\n", " 11178,\n", " 11370,\n", " 11373,\n", " 11405,\n", " 11406,\n", " 11407,\n", " 11410,\n", " 11411,\n", " 11412,\n", " 11413,\n", " 11414,\n", " 11416,\n", " 11425,\n", " 11426,\n", " 11427,\n", " 11428,\n", " 11432,\n", " ],\n", "}" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "aladin.add_moc(moc)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## From a mocpy object" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "moc = MOC.from_ring(\n", " lon=231.5855583 * u.deg,\n", " lat=-57.03742777 * u.deg,\n", " internal_radius=10 * u.deg,\n", " external_radius=20 * u.deg,\n", " max_depth=16,\n", ")\n", "aladin.add_moc(\n", " moc, color=\"teal\", edge=True, line_width=3, fill_color=\"teal\", opacity=0.5\n", ")" ] } ], "metadata": { "kernelspec": { "display_name": "base", "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.3" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": false, "sideBar": false, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": false, "toc_window_display": false }, "vscode": { "interpreter": { "hash": "85bb43f988bdbdc027a50b6d744a62eda8a76617af1f4f9b115d38242716dbac" } } }, "nbformat": 4, "nbformat_minor": 4 }