-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📝 Add new notebook 12 to show how to use ipyaladin with planetary body
- Loading branch information
Showing
1 changed file
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "8b1a9d152f4e1c7f", | ||
"metadata": {}, | ||
"source": [ | ||
"# Planetary surveys\n", | ||
"With Aladin Lite, you can display a planetary survey and use all existing features with it. " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "initial_id", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from ipyaladin import Aladin\n", | ||
"from astropy.table import Table" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "60b133f13ce59125", | ||
"metadata": {}, | ||
"source": [ | ||
"First, let's create an Aladin Lite widget with the Mars Viking MDIM21 survey." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "85d284fd3f5cc7bd", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"aladin = Aladin(\n", | ||
" target=\"159.2135528 -58.6241989\",\n", | ||
" survey=\"https://alasky.u-strasbg.fr/Planets/Mars_Viking_MDIM21\",\n", | ||
" fov=10,\n", | ||
")\n", | ||
"aladin" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "34747eb38e0db450", | ||
"metadata": {}, | ||
"source": [ | ||
"Now, let's change the target to Olympus Mons, and get the coordinates as a tuple of floats." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "dbe012440a30b6fe", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"aladin.target = \"Olympus Mons\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "f8bd2e1814b72bd8", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"aladin.target" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "1329063f49da8d52", | ||
"metadata": {}, | ||
"source": [ | ||
"Now create and add a table with the names and positions of the main geological features on Mars." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "5461264f0485d880", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"data = [\n", | ||
" {\"longitude\": 226.2, \"latitude\": 18.65, \"name\": \"Olympus Mons\"},\n", | ||
" {\"longitude\": 70.5, \"latitude\": -42.4, \"name\": \"Hellas Planitia\"},\n", | ||
" {\"longitude\": 250.4, \"latitude\": 40.5, \"name\": \"Alba Mons\"},\n", | ||
" {\"longitude\": -59.2, \"latitude\": -13.9, \"name\": \"Valles Marineris\"},\n", | ||
" {\"longitude\": 147.21, \"latitude\": 25.02, \"name\": \"Elysium Mons\"},\n", | ||
" {\"longitude\": 316.0, \"latitude\": -49.7, \"name\": \"Argyre Basin\"},\n", | ||
" {\"longitude\": 32.53, \"latitude\": 70.0, \"name\": \"Vastitas Borealis\"},\n", | ||
" {\"longitude\": -112.58, \"latitude\": 1.57, \"name\": \"Tharsis Montes\"},\n", | ||
" {\"longitude\": 298.0, \"latitude\": 25.0, \"name\": \"Outflow channels\"},\n", | ||
" {\"longitude\": 30.0, \"latitude\": 19.79, \"name\": \"Arabia Terra\"},\n", | ||
" {\"longitude\": 70.5, \"latitude\": -42.4, \"name\": \"Hellas Basin\"},\n", | ||
" {\"longitude\": 280.0, \"latitude\": 45.0, \"name\": \"Tempe Terra\"},\n", | ||
" {\"longitude\": 87.0, \"latitude\": 12.9, \"name\": \"Isidis Basin\"},\n", | ||
" {\"longitude\": 117.5, \"latitude\": 46.7, \"name\": \"Utopia Basin\"},\n", | ||
" {\"longitude\": 350.0, \"latitude\": -45.0, \"name\": \"Noachis Terra\"},\n", | ||
"]\n", | ||
"\n", | ||
"longitudes = [item[\"longitude\"] for item in data]\n", | ||
"latitudes = [item[\"latitude\"] for item in data]\n", | ||
"names = [item[\"name\"] for item in data]\n", | ||
"\n", | ||
"table = Table([longitudes, latitudes, names], names=(\"Longitude\", \"Latitude\", \"Name\"))\n", | ||
"aladin.add_table(table)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"nbsphinx": { | ||
"execute": "never" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |