-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BepiColombo and 2020Rover DEM Notebook Additions #28
Changes from all commits
1f39d8c
b5cb2dd
19a8215
9980291
917185b
dcff40b
e186cd0
76bef45
c85e3ed
eda5cb8
3c9fa0b
79b9290
ae66d57
b7a2c3d
7ab7587
446f125
b7f5d90
7bc16e5
a7849bb
fff3870
7f5d1d0
a380ef1
9637245
b5d4372
d46cdfd
7b2a05d
00285c3
169ed0c
549ea23
665ca4f
68b194d
d769fd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,236 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line #7. xml_urls.append([prod['properties']['ops:Label_File_Info.ops:file_ref'][0]]) It sounds like the order of the images differs depending on the request run. Maybe you should create a dictionnary with the lidvid as a key:
xml_urls = {prod['properties']['lidvid'][0]:prod['properties']['ops:Label_File_Info.ops:file_ref'][0] for prod in resp_data} Reply via ReviewNB There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That might help to tell that a popup window will open and that one need to click 'image' button to see the map.
Is there a way to zoom out ? Reply via ReviewNB There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line #2. pds4_tools.view(xml_urls[0][0]) When I run the pds4_tools the second time it takes forever and then python crashes. Reply via ReviewNB |
||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Step 0: Import Libraries" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": { | ||
"ExecuteTime": { | ||
"end_time": "2023-08-16T18:53:04.812077Z", | ||
"start_time": "2023-08-16T18:53:03.136374Z" | ||
}, | ||
"collapsed": false, | ||
"jupyter": { | ||
"outputs_hidden": false | ||
}, | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import requests\n", | ||
"from io import BytesIO\n", | ||
"from PIL import Image\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"import pds4_tools\n", | ||
"\n", | ||
"from astropy.io import fits" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Step 1: Search for pds4 rover images and load them using pds4_tools\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Below demonstrates how the rover image data was identified in PDS4 using 4 search parameters.\n", | ||
"1. Identification Area: to limit search results to observational products\n", | ||
"2. Harvest_Info: to look at products in the geo sciences node\n", | ||
"3. Array_2d_Image: to identify image data products\n", | ||
"4. Primary_Result_Summary: to identify processed data products" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": { | ||
"ExecuteTime": { | ||
"end_time": "2023-08-21T19:38:32.068756Z", | ||
"start_time": "2023-08-21T19:38:31.468572Z" | ||
}, | ||
"collapsed": false, | ||
"jupyter": { | ||
"outputs_hidden": false | ||
}, | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"response = requests.get('https://pds.nasa.gov/api/search/1/products?q=((pds:Identification_Area.pds:product_class eq \"Product_Observational\") and (ops:Harvest_Info.ops:node_name eq \"PDS_GEO\") and (pds:Array_2D_Image.pds:axes eq \"2\") and (pds:Primary_Result_Summary.pds:processing_level eq \"Derived\") )&start=0&limit=3000')\n", | ||
"\n", | ||
"resp_data = response.json()['data']\n", | ||
"\n", | ||
"xml_urls = []\n", | ||
"for prod in resp_data:\n", | ||
" xml_urls.append([prod['properties']['ops:Label_File_Info.ops:file_ref'][0]])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": { | ||
"ExecuteTime": { | ||
"end_time": "2023-08-16T18:53:12.615317Z", | ||
"start_time": "2023-08-16T18:53:12.579058Z" | ||
}, | ||
"collapsed": false, | ||
"jupyter": { | ||
"outputs_hidden": false | ||
}, | ||
"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" | ||
} | ||
], | ||
"source": [ | ||
"display(xml_urls)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"We want to visualize the orbital DEM and the orbital map, so we will grab the last two elements and then visualize them with pds4_tools." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"ExecuteTime": { | ||
"end_time": "2023-08-16T18:54:13.352719Z", | ||
"start_time": "2023-08-16T18:53:22.178387Z" | ||
}, | ||
"collapsed": false, | ||
"jupyter": { | ||
"outputs_hidden": false | ||
}, | ||
"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" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"#Orbital DEM\n", | ||
"pds4_tools.view(xml_urls[1][0])\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": { | ||
"ExecuteTime": { | ||
"start_time": "2023-08-16T18:54:13.359866Z" | ||
}, | ||
"collapsed": false, | ||
"jupyter": { | ||
"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" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"#Orbital Map\n", | ||
"pds4_tools.view(xml_urls[0][0])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false, | ||
"jupyter": { | ||
"outputs_hidden": false | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"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.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I missed that earlier. I think we need to revise the way we select the data after we found him. Like to pretend we know how to use the PDS4 model from the beginning.
I believe this request should work:
http://pds.nasa.gov/api/search/1/products/urn:nasa:pds:mars2020_rover_places:data_maps::7.0/members
Reply via ReviewNB