Skip to content

Commit b5d29bb

Browse files
authored
Merge pull request #80 from NASA-PDS/reorg
Re-arrange the folders, and add peppi to the Galileo notebook
2 parents 013cbe3 + 94fc7b1 commit b5d29bb

35 files changed

+1542
-1683
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,6 @@ dmypy.json
128128

129129
# Pyre type checker
130130
.pyre/
131+
132+
# local spice kernels
133+
.spice_kernels/

notebooks/geo/DEM_MapVisualization.ipynb

+8-68
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
{
1111
"cell_type": "code",
12-
"execution_count": 1,
12+
"execution_count": null,
1313
"metadata": {
1414
"ExecuteTime": {
1515
"end_time": "2023-08-16T18:53:04.812077Z",
@@ -52,7 +52,7 @@
5252
},
5353
{
5454
"cell_type": "code",
55-
"execution_count": 2,
55+
"execution_count": null,
5656
"metadata": {
5757
"ExecuteTime": {
5858
"end_time": "2023-08-21T19:38:32.068756Z",
@@ -77,7 +77,7 @@
7777
},
7878
{
7979
"cell_type": "code",
80-
"execution_count": 3,
80+
"execution_count": null,
8181
"metadata": {
8282
"ExecuteTime": {
8383
"end_time": "2023-08-16T18:53:12.615317Z",
@@ -89,19 +89,7 @@
8989
},
9090
"tags": []
9191
},
92-
"outputs": [
93-
{
94-
"data": {
95-
"text/plain": [
96-
"[['https://pds-geosciences.wustl.edu/messenger/urn-nasa-pds-izenberg_pdart14_meap/data_tnmap/thermal_neutron_map.xml'],\n",
97-
" ['https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_dem.xml'],\n",
98-
" ['https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_map.xml']]"
99-
]
100-
},
101-
"metadata": {},
102-
"output_type": "display_data"
103-
}
104-
],
92+
"outputs": [],
10593
"source": [
10694
"display(xml_urls)"
10795
]
@@ -127,48 +115,15 @@
127115
},
128116
"tags": []
129117
},
130-
"outputs": [
131-
{
132-
"name": "stdout",
133-
"output_type": "stream",
134-
"text": [
135-
"Warning: Detected IPython with module://matplotlib_inline.backend_inline backend initialized. PDS4 Viewer requires a TK backend. \n",
136-
"If PDS4 Viewer will not open, follow the steps below: \n",
137-
" 1) Avoid %matplotlib or %gui statements prior running PDS4 Viewer. \n",
138-
" 2) If issue persists, use ipython --quick to skip loading config files.\n",
139-
"Processing label: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_dem.xml\n",
140-
"Downloading URL: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_dem.xml ... "
141-
]
142-
},
143-
{
144-
"name": "stderr",
145-
"output_type": "stream",
146-
"text": [
147-
"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"
148-
]
149-
},
150-
{
151-
"name": "stdout",
152-
"output_type": "stream",
153-
"text": [
154-
"done\n",
155-
"Found a Header structure: ODL3_Header\n",
156-
"Found a Header structure: VICAR_Header\n",
157-
"Found a Array_2D_Image structure: m20_orbital_dem\n",
158-
"Now processing a Array_2D_Image structure: m20_orbital_dem\n",
159-
"Downloading URL: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_dem.img ... \n",
160-
"100% [==================================================] (109.43 / 109.43 MB)\n"
161-
]
162-
}
163-
],
118+
"outputs": [],
164119
"source": [
165120
"#Orbital DEM\n",
166121
"pds4_tools.view(xml_urls[1][0])\n"
167122
]
168123
},
169124
{
170125
"cell_type": "code",
171-
"execution_count": 5,
126+
"execution_count": null,
172127
"metadata": {
173128
"ExecuteTime": {
174129
"start_time": "2023-08-16T18:54:13.359866Z"
@@ -178,22 +133,7 @@
178133
"outputs_hidden": false
179134
}
180135
},
181-
"outputs": [
182-
{
183-
"name": "stdout",
184-
"output_type": "stream",
185-
"text": [
186-
"Processing label: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_map.xml\n",
187-
"Downloading URL: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_map.xml ... done\n",
188-
"Found a Header structure: ODL3_Header\n",
189-
"Found a Header structure: VICAR_Header\n",
190-
"Found a Array_2D_Image structure: m20_orbital_map\n",
191-
"Now processing a Array_2D_Image structure: m20_orbital_map\n",
192-
"Downloading URL: https://pds-geosciences.wustl.edu/m2020/urn-nasa-pds-mars2020_rover_places/data_maps/m20_orbital_map.img ... \n",
193-
"100% [==================================================] (437.58 / 437.58 MB)\n"
194-
]
195-
}
196-
],
136+
"outputs": [],
197137
"source": [
198138
"#Orbital Map\n",
199139
"pds4_tools.view(xml_urls[0][0])"
@@ -228,7 +168,7 @@
228168
"name": "python",
229169
"nbconvert_exporter": "python",
230170
"pygments_lexer": "ipython3",
231-
"version": "3.9.17"
171+
"version": "3.11.4"
232172
}
233173
},
234174
"nbformat": 4,

notebooks/geo/messenger-radio-science-with-pdr.ipynb

+59-9
Large diffs are not rendered by default.

notebooks/img/leafmap_mess.ipynb

+75-47
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 160,
5+
"execution_count": null,
66
"id": "968e2771",
77
"metadata": {
88
"collapsed": false,
@@ -47,23 +47,34 @@
4747
},
4848
{
4949
"cell_type": "markdown",
50+
"id": "e0f33aa6",
51+
"metadata": {
52+
"pycharm": {
53+
"name": "#%% md\n"
54+
}
55+
},
5056
"source": [
5157
"### Load the 1001 collection of elevation models\n",
5258
"\n",
5359
"The following block extracts the browse and data collection's product and joins them together. \n",
5460
"\n",
5561
"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."
56-
],
57-
"metadata": {
58-
"collapsed": false,
59-
"pycharm": {
60-
"name": "#%% md\n"
61-
}
62-
}
62+
]
6363
},
6464
{
6565
"cell_type": "code",
6666
"execution_count": null,
67+
"id": "e2f96485",
68+
"metadata": {
69+
"collapsed": false,
70+
"jupyter": {
71+
"outputs_hidden": false
72+
},
73+
"pycharm": {
74+
"name": "#%%\n"
75+
},
76+
"tags": []
77+
},
6778
"outputs": [],
6879
"source": [
6980
"client = pep.PDSRegistryClient()\n",
@@ -91,32 +102,37 @@
91102
" on=\"lid\",\n",
92103
" lsuffix='_prod', rsuffix='_browse'\n",
93104
")"
94-
],
95-
"metadata": {
96-
"collapsed": false,
97-
"pycharm": {
98-
"name": "#%%\n"
99-
}
100-
}
105+
]
101106
},
102107
{
103108
"cell_type": "markdown",
109+
"id": "f8359d51",
110+
"metadata": {
111+
"pycharm": {
112+
"name": "#%% md\n"
113+
}
114+
},
104115
"source": [
105116
"# Step 2: Visualize data on basemap\n",
106117
"\n",
107118
"### Convert pandas dataframes into geodata geometry\n",
108119
"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. "
109-
],
110-
"metadata": {
111-
"collapsed": false,
112-
"pycharm": {
113-
"name": "#%% md\n"
114-
}
115-
}
120+
]
116121
},
117122
{
118123
"cell_type": "code",
119124
"execution_count": null,
125+
"id": "8cc1572e",
126+
"metadata": {
127+
"collapsed": false,
128+
"jupyter": {
129+
"outputs_hidden": false
130+
},
131+
"pycharm": {
132+
"name": "#%%\n"
133+
},
134+
"tags": []
135+
},
120136
"outputs": [],
121137
"source": [
122138
"from shapely import Point, LineString, Polygon\n",
@@ -154,9 +170,6 @@
154170
" return f\"<a target='_blank' href='{data_link}'> Download </a>\"\n",
155171
" return \"N/A\"\n",
156172
"\n",
157-
"polygons = df_4001.apply(polygon, axis=1)\n",
158-
"gdf_4001 = gpd.GeoDataFrame(geometry=polygons)\n",
159-
"\n",
160173
"\n",
161174
"df_1001 = df_1001[3:] #skip the first 2 products because we do not want to visualize these images\n",
162175
"#Sort the values based on the east longitude coordinate - this is for the sake of layer visibility\n",
@@ -169,30 +182,51 @@
169182
"gdf_1001[\"product_data\"] = df_1001.apply(data_product_link, axis=1)\n",
170183
"\n",
171184
"\n"
172-
],
173-
"metadata": {
174-
"collapsed": false,
175-
"pycharm": {
176-
"name": "#%%\n"
177-
}
178-
}
185+
]
179186
},
180187
{
181188
"cell_type": "markdown",
182-
"source": [
183-
"### Instantiate basemap layers, convert geo data frames to geojson data and add them to the leafmap layer"
184-
],
189+
"id": "0c0ae497",
185190
"metadata": {
186-
"collapsed": false,
187191
"pycharm": {
188192
"name": "#%% md\n"
189193
}
190-
}
194+
},
195+
"source": [
196+
"### Instantiate basemap layers, convert geo data frames to geojson data and add them to the leafmap layer"
197+
]
191198
},
192199
{
193200
"cell_type": "code",
194-
"execution_count": null,
195-
"outputs": [],
201+
"execution_count": 6,
202+
"id": "7848a6ec",
203+
"metadata": {
204+
"collapsed": false,
205+
"jupyter": {
206+
"outputs_hidden": false
207+
},
208+
"pycharm": {
209+
"name": "#%%\n"
210+
},
211+
"tags": []
212+
},
213+
"outputs": [
214+
{
215+
"data": {
216+
"application/vnd.jupyter.widget-view+json": {
217+
"model_id": "9da672d9551847b28b24ade6f24fddc6",
218+
"version_major": 2,
219+
"version_minor": 0
220+
},
221+
"text/plain": [
222+
"Map(center=[0, 0], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_text'…"
223+
]
224+
},
225+
"execution_count": 6,
226+
"metadata": {},
227+
"output_type": "execute_result"
228+
}
229+
],
196230
"source": [
197231
"wmsLayer = WMSLayer(\n",
198232
" url='https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/mercury/mercury_simp_cyl.map',\n",
@@ -221,13 +255,7 @@
221255
"merc_map.add_geojson(gdf1001_geojson, layer_name=\"1001 Collection\", style = style, hover_style = hover_style)\n",
222256
"\n",
223257
"merc_map"
224-
],
225-
"metadata": {
226-
"collapsed": false,
227-
"pycharm": {
228-
"name": "#%%\n"
229-
}
230-
}
258+
]
231259
},
232260
{
233261
"cell_type": "code",
@@ -263,4 +291,4 @@
263291
},
264292
"nbformat": 4,
265293
"nbformat_minor": 5
266-
}
294+
}

0 commit comments

Comments
 (0)