Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4a098af

Browse files
committed
updated phoreal example for atl08 ancillary data
1 parent f73e086 commit 4a098af

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

examples/phoreal.ipynb

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@
3030
"import matplotlib.pyplot as plt\n",
3131
"import matplotlib\n",
3232
"import geopandas\n",
33+
"import logging\n",
3334
"import sliderule\n",
3435
"from sliderule import icesat2"
3536
]
3637
},
3738
{
3839
"cell_type": "markdown",
3940
"id": "a9cdeed4-810c-4540-869b-78e09591b68c",
40-
"metadata": {},
41+
"metadata": {
42+
"user_expressions": []
43+
},
4144
"source": [
4245
"#### Initialize Client\n",
4346
"* Organization currently set to \"utexas\"; if you want to be a member of the utexas SlideRule organization, make a request through the SlideRule provisioning system (https://ps.slideruleearth.io); otherwise, remove the organization parameter to default to the public SlideRule cluster.\n",
@@ -53,19 +56,23 @@
5356
},
5457
"outputs": [],
5558
"source": [
56-
"icesat2.init(\"slideruleearth.io\", verbose=False)"
59+
"logging.basicConfig(level=logging.INFO)\n",
60+
"icesat2.init(\"slideruleearth.io\", verbose=True, loglevel=logging.INFO)"
5761
]
5862
},
5963
{
6064
"cell_type": "markdown",
6165
"id": "f4c96101-53cf-4614-80a2-e50afcf65a03",
62-
"metadata": {},
66+
"metadata": {
67+
"user_expressions": []
68+
},
6369
"source": [
6470
"#### Processing parameters\n",
6571
"* 100m segments stepped every 100m\n",
6672
"* Subsetted to the Grand Mesa region\n",
6773
"* Time range is one day, Nov 14, 2019\n",
6874
"* Only processing ground, canopy, and top of canopy photons\n",
75+
"* Request the \"h_dif_ref\" variable as an ancillary field to be included in the results\n",
6976
"* Running PhoREAL algorithm using a binsize of 1m, and geolocating each segment at the center of the segment\n",
7077
"* Sending reconstructed waveforms along with metrics (for diagnostics and demonstration purposes only)"
7178
]
@@ -88,14 +95,17 @@
8895
" \"res\": 100,\n",
8996
" \"pass_invalid\": True, \n",
9097
" \"atl08_class\": [\"atl08_ground\", \"atl08_canopy\", \"atl08_top_of_canopy\"],\n",
98+
" \"atl08_fields\": [\"h_dif_ref\"],\n",
9199
" \"phoreal\": {\"binsize\": 1.0, \"geoloc\": \"center\", \"use_abs_h\": False, \"send_waveform\": True}\n",
92100
"}"
93101
]
94102
},
95103
{
96104
"cell_type": "markdown",
97105
"id": "e9bd5e72-f5d5-4686-94b2-c65f6715a877",
98-
"metadata": {},
106+
"metadata": {
107+
"user_expressions": []
108+
},
99109
"source": [
100110
"#### Make Atl08 Request"
101111
]
@@ -115,7 +125,9 @@
115125
{
116126
"cell_type": "markdown",
117127
"id": "60702b08-c333-4502-b948-26015c1520d5",
118-
"metadata": {},
128+
"metadata": {
129+
"user_expressions": []
130+
},
119131
"source": [
120132
"#### Print Resulting GeoDataFrame"
121133
]
@@ -135,7 +147,9 @@
135147
{
136148
"cell_type": "markdown",
137149
"id": "23a8280a-844e-4405-a8a2-53e2dd51f5e0",
138-
"metadata": {},
150+
"metadata": {
151+
"user_expressions": []
152+
},
139153
"source": [
140154
"#### Plot Canopy Height"
141155
]
@@ -156,7 +170,9 @@
156170
{
157171
"cell_type": "markdown",
158172
"id": "d3665d73-2745-4ba6-b209-5cf7a6abe693",
159-
"metadata": {},
173+
"metadata": {
174+
"user_expressions": []
175+
},
160176
"source": [
161177
"#### Plot Landcover"
162178
]
@@ -176,7 +192,9 @@
176192
{
177193
"cell_type": "markdown",
178194
"id": "6fc1e14d-8936-4f26-a6ca-a2361f54ef4d",
179-
"metadata": {},
195+
"metadata": {
196+
"user_expressions": []
197+
},
180198
"source": [
181199
"#### Create and Plot 75th percentile Across All Ground Tracks"
182200
]
@@ -191,13 +209,15 @@
191209
"outputs": [],
192210
"source": [
193211
"atl08['75'] = atl08.apply(lambda row : row[\"canopy_h_metrics\"][icesat2.P['75']], axis = 1)\n",
194-
"atl08.plot.scatter(x='distance', y='75')"
212+
"atl08.plot.scatter(x='x_atc', y='75')"
195213
]
196214
},
197215
{
198216
"cell_type": "markdown",
199217
"id": "22804320-47c7-4965-a4d2-afc855cfd1b9",
200-
"metadata": {},
218+
"metadata": {
219+
"user_expressions": []
220+
},
201221
"source": [
202222
"#### Create Sample Waveform Plots"
203223
]
@@ -222,7 +242,9 @@
222242
{
223243
"cell_type": "markdown",
224244
"id": "5da80824-8569-4d87-9544-6bc409956893",
225-
"metadata": {},
245+
"metadata": {
246+
"user_expressions": []
247+
},
226248
"source": [
227249
"#### Make Atl06 Request\n",
228250
"* Below we run an ATL06-SR processing request on the same source data using the same parameters. Because the `keep_id` argument is set to true here and above when we made the ATL08 request, we can merge the resulting dataframes and have a single table of both elevation data using the customized ATL06-SR algorithm, and vegatation data using the PhoREAL algorithm."
@@ -243,7 +265,9 @@
243265
{
244266
"cell_type": "markdown",
245267
"id": "fd03f4ab-163a-49e3-b810-2f7d3bb37ffc",
246-
"metadata": {},
268+
"metadata": {
269+
"user_expressions": []
270+
},
247271
"source": [
248272
"#### Merge Atl06 and Atl08 GeoDataFrames"
249273
]
@@ -272,9 +296,9 @@
272296
],
273297
"metadata": {
274298
"kernelspec": {
275-
"display_name": "Python 3 (ipykernel)",
299+
"display_name": "IPython - SlideRule",
276300
"language": "python",
277-
"name": "python3"
301+
"name": "sliderule_env"
278302
},
279303
"language_info": {
280304
"codemirror_mode": {
@@ -286,7 +310,7 @@
286310
"name": "python",
287311
"nbconvert_exporter": "python",
288312
"pygments_lexer": "ipython3",
289-
"version": "3.11.3"
313+
"version": "3.11.4"
290314
}
291315
},
292316
"nbformat": 4,

0 commit comments

Comments
 (0)