-
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.
Merge branch 'development' of github.com:ICESat2-SlideRule/sliderule-…
…python into development
- Loading branch information
Showing
16 changed files
with
517 additions
and
162 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "acb12a75-1636-471a-9649-48a408801d4f", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from sliderule import icesat2\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"import matplotlib\n", | ||
"import geopandas" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b8167cbe-3fe3-4dc9-a5ad-0cbba51c8a07", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"icesat2.init(\"slideruleearth.io\", verbose=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "98ef750a-e88b-4125-b951-d1e29ce50ce2", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"asset = \"nsidc-s3\"\n", | ||
"resource = \"ATL03_20190314093716_11600203_005_01.h5\"\n", | ||
"region = icesat2.toregion(\"../tests/data/dicksonfjord.geojson\")\n", | ||
"parms = { \"poly\": region['poly'],\n", | ||
" \"cnf\": \"atl03_high\",\n", | ||
" \"ats\": 5.0,\n", | ||
" \"cnt\": 5,\n", | ||
" \"len\": 20.0,\n", | ||
" \"res\": 10.0,\n", | ||
" \"maxi\": 1,\n", | ||
" \"samples\": {\"mosaic\": {\"asset\": \"arcticdem-mosaic\", \"radius\": 10.0, \"zonal_stats\": True}} }\n", | ||
"gdf = icesat2.atl06p(parms, asset=asset, resources=[resource])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "fd15bf14-ab10-4cf6-9524-592962a8f8b2", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"gdf" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "59ea096b-3443-4b9a-b114-e818f143ca45", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"gdf[\"value_delta\"] = gdf[\"h_mean\"] - gdf[\"mosaic.value\"]\n", | ||
"gdf[\"value_delta\"].describe()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "f80cd750-9b91-406a-ac6a-dc04937cd811", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"gdf[\"mean_delta\"] = gdf[\"h_mean\"] - gdf[\"mosaic.mean\"]\n", | ||
"gdf[\"mean_delta\"].describe()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4e8fe135-bc15-4b8b-887f-ae16ac81487f", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"gdf[\"median_delta\"] = gdf[\"h_mean\"] - gdf[\"mosaic.median\"]\n", | ||
"gdf[\"median_delta\"].describe()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "d6785ed8-cb0d-49cb-9de1-30ac5792884a", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Setup Plot\n", | ||
"fig,ax = plt.subplots(num=None, figsize=(10, 8))\n", | ||
"fig.set_facecolor('white')\n", | ||
"fig.canvas.header_visible = False\n", | ||
"ax.set_title(\"SlideRule vs. ArcticDEM Elevations\")\n", | ||
"ax.set_xlabel('UTC')\n", | ||
"ax.set_ylabel('height (m)')\n", | ||
"legend_elements = []\n", | ||
"\n", | ||
"# Plot SlideRule ATL06 Elevations\n", | ||
"df = gdf[(gdf['rgt'] == 1160) & (gdf['gt'] == 10) & (gdf['cycle'] == 2)]\n", | ||
"sc1 = ax.scatter(df.index.values, df[\"h_mean\"].values, c='red', s=2.5)\n", | ||
"legend_elements.append(matplotlib.lines.Line2D([0], [0], color='red', lw=6, label='ATL06-SR'))\n", | ||
"\n", | ||
"# Plot ArcticDEM Elevations\n", | ||
"sc2 = ax.scatter(df.index.values, df[\"mosaic.value\"].values, c='blue', s=2.5)\n", | ||
"legend_elements.append(matplotlib.lines.Line2D([0], [0], color='blue', lw=6, label='ArcticDEM'))\n", | ||
"\n", | ||
"# Plot ArcticDEM Mean Elevations\n", | ||
"sc2 = ax.scatter(df.index.values, df[\"mosaic.value\"].values, c='green', s=2.5)\n", | ||
"legend_elements.append(matplotlib.lines.Line2D([0], [0], color='green', lw=6, label='ArcticDEM'))\n", | ||
"\n", | ||
"# Display Legend\n", | ||
"lgd = ax.legend(handles=legend_elements, loc=3, frameon=True)\n", | ||
"lgd.get_frame().set_alpha(1.0)\n", | ||
"lgd.get_frame().set_edgecolor('white')\n", | ||
"\n", | ||
"# Show Plot\n", | ||
"plt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "82c65e28-468e-463e-9afe-2b52064e7bae", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Setup Plot\n", | ||
"fig,ax = plt.subplots(num=None, figsize=(10, 8))\n", | ||
"fig.set_facecolor('white')\n", | ||
"fig.canvas.header_visible = False\n", | ||
"ax.set_title(\"Delta Elevations between SlideRule and ArcticDEM\")\n", | ||
"ax.set_xlabel('UTC')\n", | ||
"ax.set_ylabel('height (m)')\n", | ||
"ax.yaxis.grid(True)\n", | ||
"\n", | ||
"# Plot Deltas\n", | ||
"df1 = gdf[(gdf['rgt'] == 1160) & (gdf['gt'] == 10) & (gdf['cycle'] == 2)]\n", | ||
"sc1 = ax.scatter(df1.index.values, df1[\"value_delta\"].values, c='blue', s=2.5)\n", | ||
"\n", | ||
"# Plot Deltas\n", | ||
"df2 = gdf[(gdf['rgt'] == 1160) & (gdf['gt'] == 10) & (gdf['cycle'] == 2)]\n", | ||
"sc2 = ax.scatter(df2.index.values, df2[\"mean_delta\"].values, c='green', s=2.5)\n", | ||
"\n", | ||
"# Show Plot\n", | ||
"plt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "eed8f243-dd0c-4473-a952-fcb2bb863e3c", | ||
"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.8.15" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ numpy | |
fiona | ||
geopandas | ||
shapely | ||
scikit-learn | ||
scikit-learn | ||
pyarrow |
Oops, something went wrong.