Skip to content
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

Merged
merged 32 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1f39d8c
Added data layer separation and naming
joaq-ram Aug 3, 2023
b5cb2dd
readded code that was lost on restarted and fixed search request
joaq-ram Aug 8, 2023
19a8215
formatting
joaq-ram Aug 8, 2023
9980291
added search for .fits data
joaq-ram Aug 8, 2023
917185b
plotting additions
joaq-ram Aug 9, 2023
dcff40b
reading in mars images
joaq-ram Aug 9, 2023
e186cd0
Added image looping to notebook
joaq-ram Aug 10, 2023
76bef45
Added data layer separation and naming
joaq-ram Aug 3, 2023
c85e3ed
readded code that was lost on restarted and fixed search request
joaq-ram Aug 8, 2023
eda5cb8
formatting
joaq-ram Aug 8, 2023
3c9fa0b
added search for .fits data
joaq-ram Aug 8, 2023
79b9290
plotting additions
joaq-ram Aug 9, 2023
ae66d57
reading in mars images
joaq-ram Aug 9, 2023
b7a2c3d
Added image looping to notebook
joaq-ram Aug 10, 2023
7ab7587
adding more robust visualization
joaq-ram Aug 14, 2023
446f125
Merge remote-tracking branch 'origin/image-aggregate-tool' into image…
joaq-ram Aug 14, 2023
b7f5d90
adding flyby search
joaq-ram Aug 16, 2023
7bc16e5
Fixed data product view
joaq-ram Aug 16, 2023
a7849bb
added pages argument
joaq-ram Aug 17, 2023
fff3870
refactoring and adjusting table layout
joaq-ram Aug 17, 2023
7f5d1d0
fixed more formatting with the tables and changed image titles to mat…
joaq-ram Aug 17, 2023
a380ef1
Memory tracking
joaq-ram Aug 18, 2023
9637245
optimized run time slightly
joaq-ram Aug 18, 2023
b5d4372
Fixed formatting and cleaned up comments
joaq-ram Aug 21, 2023
d46cdfd
Addressed all pull request comments. However, the original request is…
joaq-ram Aug 31, 2023
7b2a05d
Addressed all pull request comments. However, the original request is…
joaq-ram Aug 31, 2023
00285c3
formatting
joaq-ram Sep 5, 2023
169ed0c
formatting
joaq-ram Sep 5, 2023
549ea23
Changed timeline and solar system view settings in mag notebook
joaq-ram Sep 5, 2023
665ca4f
Changed timeline and solar system view settings in mag notebook
joaq-ram Sep 5, 2023
68b194d
Changed timeline and solar system view settings in mag notebook
joaq-ram Sep 5, 2023
d769fd2
formatting things in the notebook
joaq-ram Sep 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 207 additions & 0 deletions notebooks/geo/BepiColombo_FlybyVisualization.ipynb

Large diffs are not rendered by default.

236 changes: 236 additions & 0 deletions notebooks/geo/DEM_MapVisualization.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
{
Copy link
Member

@tloubrieu-jpl tloubrieu-jpl Aug 29, 2023

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

Copy link
Member

@tloubrieu-jpl tloubrieu-jpl Aug 29, 2023

Choose a reason for hiding this comment

The 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

Copy link
Member

@tloubrieu-jpl tloubrieu-jpl Aug 29, 2023

Choose a reason for hiding this comment

The 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

Copy link
Member

@tloubrieu-jpl tloubrieu-jpl Aug 29, 2023

Choose a reason for hiding this comment

The 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
}
Loading