Skip to content

Commit

Permalink
Merge pull request #80 from NASA-PDS/reorg
Browse files Browse the repository at this point in the history
Re-arrange the folders, and add peppi to the Galileo notebook
  • Loading branch information
jordanpadams authored Dec 31, 2024
2 parents 013cbe3 + 94fc7b1 commit b5d29bb
Show file tree
Hide file tree
Showing 35 changed files with 1,542 additions and 1,683 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dmypy.json

# Pyre type checker
.pyre/

# local spice kernels
.spice_kernels/
76 changes: 8 additions & 68 deletions notebooks/geo/DEM_MapVisualization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-08-16T18:53:04.812077Z",
Expand Down Expand Up @@ -52,7 +52,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-08-21T19:38:32.068756Z",
Expand All @@ -77,7 +77,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-08-16T18:53:12.615317Z",
Expand All @@ -89,19 +89,7 @@
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"[['https://pds-geosciences.wustl.edu/messenger/urn-nasa-pds-izenberg_pdart14_meap/data_tnmap/thermal_neutron_map.xml'],\n",
" ['https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_dem.xml'],\n",
" ['https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_map.xml']]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"display(xml_urls)"
]
Expand All @@ -127,48 +115,15 @@
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Warning: Detected IPython with module://matplotlib_inline.backend_inline backend initialized. PDS4 Viewer requires a TK backend. \n",
"If PDS4 Viewer will not open, follow the steps below: \n",
" 1) Avoid %matplotlib or %gui statements prior running PDS4 Viewer. \n",
" 2) If issue persists, use ipython --quick to skip loading config files.\n",
"Processing label: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_dem.xml\n",
"Downloading URL: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_dem.xml ... "
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-09-07 11:01:28.535 Python[920:2166267] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/t7/tdt4vrqj57x7cdkbnm27lcbw0000gq/T/org.python.python.savedState\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"done\n",
"Found a Header structure: ODL3_Header\n",
"Found a Header structure: VICAR_Header\n",
"Found a Array_2D_Image structure: m20_orbital_dem\n",
"Now processing a Array_2D_Image structure: m20_orbital_dem\n",
"Downloading URL: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_dem.img ... \n",
"100% [==================================================] (109.43 / 109.43 MB)\n"
]
}
],
"outputs": [],
"source": [
"#Orbital DEM\n",
"pds4_tools.view(xml_urls[1][0])\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {
"ExecuteTime": {
"start_time": "2023-08-16T18:54:13.359866Z"
Expand All @@ -178,22 +133,7 @@
"outputs_hidden": false
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Processing label: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_map.xml\n",
"Downloading URL: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_map.xml ... done\n",
"Found a Header structure: ODL3_Header\n",
"Found a Header structure: VICAR_Header\n",
"Found a Array_2D_Image structure: m20_orbital_map\n",
"Now processing a Array_2D_Image structure: m20_orbital_map\n",
"Downloading URL: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_map.img ... \n",
"100% [==================================================] (437.58 / 437.58 MB)\n"
]
}
],
"outputs": [],
"source": [
"#Orbital Map\n",
"pds4_tools.view(xml_urls[0][0])"
Expand Down Expand Up @@ -228,7 +168,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.17"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
68 changes: 59 additions & 9 deletions notebooks/geo/messenger-radio-science-with-pdr.ipynb

Large diffs are not rendered by default.

122 changes: 75 additions & 47 deletions notebooks/img/leafmap_mess.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 160,
"execution_count": null,
"id": "968e2771",
"metadata": {
"collapsed": false,
Expand Down Expand Up @@ -47,23 +47,34 @@
},
{
"cell_type": "markdown",
"id": "e0f33aa6",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"### Load the 1001 collection of elevation models\n",
"\n",
"The following block extracts the browse and data collection's product and joins them together. \n",
"\n",
"Note: by an extra-ordinary circumptance, for collection 1001, none of the ref_lid_data in the browse collection matches the lid of the data product collection."
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
}
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e2f96485",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
"tags": []
},
"outputs": [],
"source": [
"client = pep.PDSRegistryClient()\n",
Expand Down Expand Up @@ -91,32 +102,37 @@
" on=\"lid\",\n",
" lsuffix='_prod', rsuffix='_browse'\n",
")"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
]
},
{
"cell_type": "markdown",
"id": "f8359d51",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Step 2: Visualize data on basemap\n",
"\n",
"### Convert pandas dataframes into geodata geometry\n",
"The product information is viewable in an HTML widget using the geojson function in leafmap. The below code embeds the image URLS and product HTTPS into text that can be interacted with in the widget. "
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
}
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8cc1572e",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
"tags": []
},
"outputs": [],
"source": [
"from shapely import Point, LineString, Polygon\n",
Expand Down Expand Up @@ -154,9 +170,6 @@
" return f\"<a target='_blank' href='{data_link}'> Download </a>\"\n",
" return \"N/A\"\n",
"\n",
"polygons = df_4001.apply(polygon, axis=1)\n",
"gdf_4001 = gpd.GeoDataFrame(geometry=polygons)\n",
"\n",
"\n",
"df_1001 = df_1001[3:] #skip the first 2 products because we do not want to visualize these images\n",
"#Sort the values based on the east longitude coordinate - this is for the sake of layer visibility\n",
Expand All @@ -169,30 +182,51 @@
"gdf_1001[\"product_data\"] = df_1001.apply(data_product_link, axis=1)\n",
"\n",
"\n"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
]
},
{
"cell_type": "markdown",
"source": [
"### Instantiate basemap layers, convert geo data frames to geojson data and add them to the leafmap layer"
],
"id": "0c0ae497",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
}
},
"source": [
"### Instantiate basemap layers, convert geo data frames to geojson data and add them to the leafmap layer"
]
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"execution_count": 6,
"id": "7848a6ec",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
"tags": []
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9da672d9551847b28b24ade6f24fddc6",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[0, 0], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_text'…"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wmsLayer = WMSLayer(\n",
" url='https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/mercury/mercury_simp_cyl.map',\n",
Expand Down Expand Up @@ -221,13 +255,7 @@
"merc_map.add_geojson(gdf1001_geojson, layer_name=\"1001 Collection\", style = style, hover_style = hover_style)\n",
"\n",
"merc_map"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -263,4 +291,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
Loading

0 comments on commit b5d29bb

Please sign in to comment.