-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated examples to use latest asset directory; added gedi l2a and l1…
…b example notebooks
- Loading branch information
Showing
13 changed files
with
327 additions
and
18 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
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
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
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
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
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
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,150 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0e7a3594-2353-476d-a42a-b6bf1b279c61", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import time\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"from sliderule import gedi\n", | ||
"from sliderule import earthdata\n", | ||
"import sliderule" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "54acbd2a-23d8-4cb9-ac06-b3893a3b45db", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# initialize client (notebook only processes one granule, so one node is sufficient)\n", | ||
"#gedi.init(\"slideruleearth.io\", verbose=True)\n", | ||
"gedi.init(\"localhost\", verbose=True, organization=None)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "e1421300-b0d1-4139-928e-f8bc612a8ac9", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Specify region of interest from geojson\n", | ||
"poly_fn = 'grandmesa.geojson'\n", | ||
"region = sliderule.toregion(poly_fn)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "720dc13b-c6af-4580-ac55-ab4c5263b96e", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"granules = earthdata.cmr(short_name=\"GEDI01_B\", polygon=region[\"poly\"])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "a46a84ed-05f5-47b8-b4b7-d063dacfddde", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Build GEDI L4A Request Parameters\n", | ||
"parms = {\n", | ||
" \"poly\": region[\"poly\"],\n", | ||
" \"degrade_flag\": 0,\n", | ||
" \"quality_flag\": 1,\n", | ||
" \"beam\": 0\n", | ||
"}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "02682045-e626-4864-b4eb-1ed04d77d778", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Latch Start Time\n", | ||
"perf_start = time.perf_counter()\n", | ||
"\n", | ||
"# Request GEDI Data\n", | ||
"gedi01b = gedi.gedi01bp(parms, resources=['GEDI01_B_2019109210809_O01988_03_T02056_02_005_01_V002.h5'])\n", | ||
" \n", | ||
"# Latch Stop Time\n", | ||
"perf_stop = time.perf_counter()\n", | ||
"\n", | ||
"# Display Statistics\n", | ||
"perf_duration = perf_stop - perf_start\n", | ||
"print(\"Completed in {:.3f} seconds of wall-clock time\".format(perf_duration))\n", | ||
"print(\"Received {} footprints\".format(gedi01b.shape[0]))\n", | ||
"if len(gedi01b) > 0:\n", | ||
" print(\"Beams: {}\".format(gedi01b[\"beam\"].unique()))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "92d482e1-08e2-49a4-9ff7-155b7952e178", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"gedi01b" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "eeade03e-0dc7-42fe-a879-8e59cce8e6af", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# plot elevations\n", | ||
"f, ax = plt.subplots(1, 2, figsize=[12,8])\n", | ||
"ax[0].set_title(\"Elevation of First Bin\")\n", | ||
"ax[0].set_aspect('equal')\n", | ||
"gedi01b.plot(ax=ax[0], column='elevation_start', cmap='inferno', s=0.1)\n", | ||
"ax[1].set_title(\"Elevation of Last Bin\")\n", | ||
"ax[1].set_aspect('equal')\n", | ||
"gedi01b.plot(ax=ax[1], column='elevation_stop', cmap='inferno', s=0.1)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b7243ae5-f3bb-4219-8486-bde773f4effa", | ||
"metadata": {}, | ||
"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.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.