|
11 | 11 | "Demonstrate how to sample the ArcticDEM at generated ATL06-SR points" |
12 | 12 | ] |
13 | 13 | }, |
| 14 | + { |
| 15 | + "cell_type": "markdown", |
| 16 | + "id": "e29fa51f-77bf-4c55-a99e-a4f166833755", |
| 17 | + "metadata": {}, |
| 18 | + "source": [ |
| 19 | + "#### Import Packages" |
| 20 | + ] |
| 21 | + }, |
14 | 22 | { |
15 | 23 | "cell_type": "code", |
16 | 24 | "execution_count": null, |
17 | | - "id": "b92cf7a1-67a3-485f-b170-72d2db8727a2", |
| 25 | + "id": "9dada6f9-e621-4a3a-825b-065ef6846645", |
18 | 26 | "metadata": {}, |
19 | 27 | "outputs": [], |
20 | 28 | "source": [ |
21 | | - "#\n", |
22 | | - "# Import Packages\n", |
23 | | - "#\n", |
24 | 29 | "import matplotlib.pyplot as plt\n", |
25 | 30 | "import matplotlib\n", |
26 | 31 | "import sliderule\n", |
27 | 32 | "from sliderule import icesat2" |
28 | 33 | ] |
29 | 34 | }, |
| 35 | + { |
| 36 | + "cell_type": "markdown", |
| 37 | + "id": "53e68348-2d49-4e22-b665-1acd8b367dcf", |
| 38 | + "metadata": {}, |
| 39 | + "source": [ |
| 40 | + "#### Initialize SlideRule Python Client" |
| 41 | + ] |
| 42 | + }, |
30 | 43 | { |
31 | 44 | "cell_type": "code", |
32 | 45 | "execution_count": null, |
33 | | - "id": "b8167cbe-3fe3-4dc9-a5ad-0cbba51c8a07", |
| 46 | + "id": "93edfc47-1cd5-4927-962c-fd447c9e807a", |
34 | 47 | "metadata": {}, |
35 | 48 | "outputs": [], |
36 | 49 | "source": [ |
37 | | - "#\n", |
38 | | - "# Initialize SlideRule Python Client\n", |
39 | | - "#\n", |
40 | 50 | "icesat2.init(\"slideruleearth.io\", verbose=True)" |
41 | 51 | ] |
42 | 52 | }, |
| 53 | + { |
| 54 | + "cell_type": "markdown", |
| 55 | + "id": "c588e3ea-8ab8-452b-8f5a-9fd8d6364ca9", |
| 56 | + "metadata": { |
| 57 | + "tags": [] |
| 58 | + }, |
| 59 | + "source": [ |
| 60 | + "#### Make Processing Request to SlideRule\n", |
| 61 | + "ATL06-SR request includes the `samples` parameter to specify that ArcticDEM Mosiac dataset should be sampled at each generated ATL06 elevation." |
| 62 | + ] |
| 63 | + }, |
43 | 64 | { |
44 | 65 | "cell_type": "code", |
45 | 66 | "execution_count": null, |
46 | | - "id": "98ef750a-e88b-4125-b951-d1e29ce50ce2", |
| 67 | + "id": "4ebef6dc-c05d-4b97-973c-05da9565e841", |
47 | 68 | "metadata": { |
48 | 69 | "tags": [] |
49 | 70 | }, |
50 | 71 | "outputs": [], |
51 | 72 | "source": [ |
52 | | - "#\n", |
53 | | - "# Make Processing Request to SlideRule - ATL06-SR with corresponding ArcticDEM Mosiac Samples\n", |
54 | | - "#\n", |
55 | 73 | "asset = \"nsidc-s3\"\n", |
56 | 74 | "resource = \"ATL03_20190314093716_11600203_005_01.h5\"\n", |
57 | 75 | "region = sliderule.toregion(\"../tests/data/dicksonfjord.geojson\")\n", |
|
66 | 84 | "gdf = icesat2.atl06p(parms, asset=asset, resources=[resource])" |
67 | 85 | ] |
68 | 86 | }, |
| 87 | + { |
| 88 | + "cell_type": "markdown", |
| 89 | + "id": "b779ddf2-f9ea-41c2-bb9a-1db92e277fe7", |
| 90 | + "metadata": {}, |
| 91 | + "source": [ |
| 92 | + "#### Display GeoDataFrame\n", |
| 93 | + "Notice the columns that start with \"mosaic\"" |
| 94 | + ] |
| 95 | + }, |
69 | 96 | { |
70 | 97 | "cell_type": "code", |
71 | 98 | "execution_count": null, |
72 | | - "id": "da7f3823-c32b-4ad7-a7de-cfb99d5ab858", |
| 99 | + "id": "e19bae20-140e-4d55-bb73-64a9630096d1", |
73 | 100 | "metadata": {}, |
74 | 101 | "outputs": [], |
75 | 102 | "source": [ |
76 | | - "#\n", |
77 | | - "# Display GeoDataFrame\n", |
78 | | - "#\n", |
79 | 103 | "gdf" |
80 | 104 | ] |
81 | 105 | }, |
| 106 | + { |
| 107 | + "cell_type": "markdown", |
| 108 | + "id": "6178683e-2d08-4ccb-a80e-4bb997876330", |
| 109 | + "metadata": {}, |
| 110 | + "source": [ |
| 111 | + "#### Print Out File Directory\n", |
| 112 | + "When a GeoDataFrame includes samples from rasters, each sample value has a file id that is used to look up the file name of the source raster for that value." |
| 113 | + ] |
| 114 | + }, |
82 | 115 | { |
83 | 116 | "cell_type": "code", |
84 | 117 | "execution_count": null, |
85 | | - "id": "690b44ac-5257-4d2e-a8fd-8f74c6533ea0", |
| 118 | + "id": "b4c99349-c44e-4e59-bd31-ad6121df2f80", |
86 | 119 | "metadata": {}, |
87 | 120 | "outputs": [], |
88 | 121 | "source": [ |
89 | | - "#\n", |
90 | | - "# Print Out File Directory\n", |
91 | | - "#\n", |
92 | 122 | "gdf.attrs['file_directory']" |
93 | 123 | ] |
94 | 124 | }, |
| 125 | + { |
| 126 | + "cell_type": "markdown", |
| 127 | + "id": "13185f3c-23f8-4334-a300-68c39284711c", |
| 128 | + "metadata": {}, |
| 129 | + "source": [ |
| 130 | + "#### Demonstrate How To Access Source Raster Filename for Entry in GeoDataFrame" |
| 131 | + ] |
| 132 | + }, |
95 | 133 | { |
96 | 134 | "cell_type": "code", |
97 | 135 | "execution_count": null, |
98 | | - "id": "d2fa07bb-1b89-446c-adb0-916b24eed74e", |
| 136 | + "id": "02ddb59c-b63b-4fef-b8c4-ec4b3d7580c6", |
99 | 137 | "metadata": {}, |
100 | 138 | "outputs": [], |
101 | 139 | "source": [ |
102 | | - "#\n", |
103 | | - "# Demonstrate How To Access Source Raster Filename for Entry in GeoDataFrame\n", |
104 | | - "#\n", |
105 | 140 | "filedir = gdf.attrs['file_directory']\n", |
106 | 141 | "filedir[gdf['mosaic.file_id'][0]]" |
107 | 142 | ] |
108 | 143 | }, |
| 144 | + { |
| 145 | + "cell_type": "markdown", |
| 146 | + "id": "88c529c1-9d72-4628-8b34-d850ae9e262d", |
| 147 | + "metadata": {}, |
| 148 | + "source": [ |
| 149 | + "#### Difference the Sampled Value from ArcticDEM with SlideRule ATL06-SR" |
| 150 | + ] |
| 151 | + }, |
109 | 152 | { |
110 | 153 | "cell_type": "code", |
111 | 154 | "execution_count": null, |
112 | | - "id": "59ea096b-3443-4b9a-b114-e818f143ca45", |
| 155 | + "id": "f3476592-b5b2-470e-bd35-d63e23e42ca0", |
113 | 156 | "metadata": {}, |
114 | 157 | "outputs": [], |
115 | 158 | "source": [ |
116 | | - "#\n", |
117 | | - "# Difference the Sampled Value from ArcticDEM with SlideRule ATL06-SR\n", |
118 | | - "#\n", |
119 | 159 | "gdf[\"value_delta\"] = gdf[\"h_mean\"] - gdf[\"mosaic.value\"]\n", |
120 | 160 | "gdf[\"value_delta\"].describe()" |
121 | 161 | ] |
122 | 162 | }, |
| 163 | + { |
| 164 | + "cell_type": "markdown", |
| 165 | + "id": "5447dd00-69fa-4ab7-a2f3-674bf72126e9", |
| 166 | + "metadata": {}, |
| 167 | + "source": [ |
| 168 | + "#### Difference the Zonal Statistic Mean from ArcticDEM with SlideRule ATL06-SR" |
| 169 | + ] |
| 170 | + }, |
123 | 171 | { |
124 | 172 | "cell_type": "code", |
125 | 173 | "execution_count": null, |
126 | | - "id": "f80cd750-9b91-406a-ac6a-dc04937cd811", |
| 174 | + "id": "54621607-cdbc-4849-8e65-530957c2adc9", |
127 | 175 | "metadata": {}, |
128 | 176 | "outputs": [], |
129 | 177 | "source": [ |
130 | | - "#\n", |
131 | | - "# Difference the Zonal Statistic Mean from ArcticDEM with SlideRule ATL06-SR\n", |
132 | | - "#\n", |
133 | 178 | "gdf[\"mean_delta\"] = gdf[\"h_mean\"] - gdf[\"mosaic.mean\"]\n", |
134 | 179 | "gdf[\"mean_delta\"].describe()" |
135 | 180 | ] |
136 | 181 | }, |
| 182 | + { |
| 183 | + "cell_type": "markdown", |
| 184 | + "id": "279dded2-5165-4b88-b28d-971fa303966d", |
| 185 | + "metadata": {}, |
| 186 | + "source": [ |
| 187 | + "#### Difference the Zonal Statistic Mdeian from ArcticDEM with SlideRule ATL06-SR" |
| 188 | + ] |
| 189 | + }, |
137 | 190 | { |
138 | 191 | "cell_type": "code", |
139 | 192 | "execution_count": null, |
140 | | - "id": "4e8fe135-bc15-4b8b-887f-ae16ac81487f", |
| 193 | + "id": "fafc2593-f6b4-44c1-8fb9-a9d345c6561e", |
141 | 194 | "metadata": {}, |
142 | 195 | "outputs": [], |
143 | 196 | "source": [ |
144 | | - "#\n", |
145 | | - "# Difference the Zonal Statistic Mdeian from ArcticDEM with SlideRule ATL06-SR\n", |
146 | | - "#\n", |
147 | 197 | "gdf[\"median_delta\"] = gdf[\"h_mean\"] - gdf[\"mosaic.median\"]\n", |
148 | 198 | "gdf[\"median_delta\"].describe()" |
149 | 199 | ] |
150 | 200 | }, |
| 201 | + { |
| 202 | + "cell_type": "markdown", |
| 203 | + "id": "32beb064-f10f-46e1-8756-a03756e069fd", |
| 204 | + "metadata": {}, |
| 205 | + "source": [ |
| 206 | + "#### Plot the Different ArcticDEM Values against the SlideRule ATL06-SR Values" |
| 207 | + ] |
| 208 | + }, |
151 | 209 | { |
152 | 210 | "cell_type": "code", |
153 | 211 | "execution_count": null, |
154 | | - "id": "d6785ed8-cb0d-49cb-9de1-30ac5792884a", |
| 212 | + "id": "12645d05-fda6-44bd-878b-37b0aa217065", |
155 | 213 | "metadata": {}, |
156 | 214 | "outputs": [], |
157 | 215 | "source": [ |
158 | | - "#\n", |
159 | | - "# Plot the Different ArcticDEM Values against the SlideRule ATL06-SR Values\n", |
160 | | - "\n", |
161 | 216 | "# Setup Plot\n", |
162 | 217 | "fig,ax = plt.subplots(num=None, figsize=(10, 8))\n", |
163 | 218 | "fig.set_facecolor('white')\n", |
|
189 | 244 | "plt.show()" |
190 | 245 | ] |
191 | 246 | }, |
| 247 | + { |
| 248 | + "cell_type": "markdown", |
| 249 | + "id": "343ad4b0-e94b-48bb-ae23-ca57867597fb", |
| 250 | + "metadata": {}, |
| 251 | + "source": [ |
| 252 | + "#### Plot the Sampled Value and Zonal Statistic Mean Deltas to SlideRule ATL06-SR Values" |
| 253 | + ] |
| 254 | + }, |
192 | 255 | { |
193 | 256 | "cell_type": "code", |
194 | 257 | "execution_count": null, |
195 | | - "id": "82c65e28-468e-463e-9afe-2b52064e7bae", |
| 258 | + "id": "7154e9db-ff4d-4b17-ac8c-62c3d12d7d54", |
196 | 259 | "metadata": {}, |
197 | 260 | "outputs": [], |
198 | 261 | "source": [ |
199 | | - "#\n", |
200 | | - "# Plot the Sampled Value and Zonal Statistic Mean Deltas to SlideRule ATL06-SR Values\n", |
201 | | - "#\n", |
202 | | - "\n", |
203 | 262 | "# Setup Plot\n", |
204 | 263 | "fig,ax = plt.subplots(num=None, figsize=(10, 8))\n", |
205 | 264 | "fig.set_facecolor('white')\n", |
|
0 commit comments