|
141 | 141 | "source": [
|
142 | 142 | "# dropdown menu for setting asset\n",
|
143 | 143 | "AssetDropdown = widgets.Dropdown(\n",
|
144 |
| - " options=['atlas-local', 'atlas-s3'],\n", |
| 144 | + " options=['atlas-local', 'atlas-s3', 'nsidc-s3'],\n", |
145 | 145 | " value='atlas-s3',\n",
|
146 | 146 | " description='Asset:',\n",
|
147 | 147 | " disabled=False,\n",
|
|
198 | 198 | " readout_format='d'\n",
|
199 | 199 | ")\n",
|
200 | 200 | "\n",
|
| 201 | + "# selection for land surface classifications\n", |
| 202 | + "land_options = [\n", |
| 203 | + " 'atl08_noise',\n", |
| 204 | + " 'atl08_ground',\n", |
| 205 | + " 'atl08_canopy',\n", |
| 206 | + " 'atl08_top_of_canopy',\n", |
| 207 | + " 'atl08_unclassified'\n", |
| 208 | + "]\n", |
| 209 | + "ClassSelect = widgets.SelectMultiple(\n", |
| 210 | + " options=land_options,\n", |
| 211 | + " description='Land Class:',\n", |
| 212 | + " disabled=False\n", |
| 213 | + ")\n", |
| 214 | + "\n", |
201 | 215 | "# slider for setting maximum number of iterations\n",
|
202 | 216 | "# (not including initial least-squares-fit selection)\n",
|
203 | 217 | "IterationSlider = widgets.IntSlider(\n",
|
|
275 | 289 | " LengthSlider,\n",
|
276 | 290 | " StepSlider,\n",
|
277 | 291 | " ConfSlider,\n",
|
| 292 | + " ClassSelect,\n", |
278 | 293 | " IterationSlider,\n",
|
279 | 294 | " SpreadSlider,\n",
|
280 | 295 | " CountSlider,\n",
|
|
312 | 327 | " \"res\": StepSlider.value,\n",
|
313 | 328 | " # confidence level for PE selection (default: 4)\n",
|
314 | 329 | " \"cnf\": ConfSlider.value,\n",
|
| 330 | + " # ATL08 land surface classifications\n", |
| 331 | + " \"atl08_class\": list(ClassSelect.value),\n", |
315 | 332 | " # maximum iterations, not including initial least-squares-fit selection (default: 1)\n",
|
316 | 333 | " \"maxi\": IterationSlider.value,\n",
|
317 | 334 | " # minimum along track spread (default: 20.0)\n",
|
|
359 | 376 | "# adjust subplot within figure\n",
|
360 | 377 | "f1.subplots_adjust(left=0.02,right=0.98,bottom=0.05,top=0.98)\n",
|
361 | 378 | "\n",
|
362 |
| - "# output plot of fit height for each segment\n", |
363 |
| - "spots = rsps['spot'].unique()\n", |
364 |
| - "f2, ax2 = plt.subplots(num=2,ncols=len(spots),sharey=True,figsize=(8,6))\n", |
365 |
| - "for j,spot in enumerate(spots):\n", |
366 |
| - " rsps_per_spot = rsps[rsps[\"spot\"]==spot]\n", |
367 |
| - " ax2[j].plot(rsps_per_spot['segment_id'],rsps_per_spot['h_mean'],'r')\n", |
368 |
| - " ax2[j].set_xlabel('Segment ID')\n", |
369 |
| - " ax2[j].set_title('Spot {0:d}'.format(spot))\n", |
370 |
| - "ax2[0].set_ylabel('Along Track Elevation [m]')\n", |
371 |
| - "title = 'SlideRule ATL06 Segment Fits\\nSegment Length {0:d}m, Step Size {1:d}m'\n", |
372 |
| - "f2.suptitle(title.format(LengthSlider.value,StepSlider.value))\n", |
373 |
| - "f2.subplots_adjust(wspace=0.05)\n", |
374 |
| - "\n", |
375 |
| - "# show plots\n", |
| 379 | + "# output map of heights\n", |
| 380 | + "f2, ax2 = plt.subplots(num=2, nrows=1, ncols=1, figsize=(10,6),\n", |
| 381 | + " subplot_kw=dict(projection=cartopy.crs.PlateCarree()))\n", |
| 382 | + "# create scatter plot of elevations\n", |
| 383 | + "sc = ax2.scatter(gdf.geometry.x,gdf.geometry.y,c=gdf.h_mean,\n", |
| 384 | + " s=1,edgecolor='none',cmap=plt.cm.viridis,\n", |
| 385 | + " transform=cartopy.crs.PlateCarree())\n", |
| 386 | + "# extract latitude and longitude of polygon\n", |
| 387 | + "lon = [r['lon'] for r in regions[0]]\n", |
| 388 | + "lat = [r['lat'] for r in regions[0]]\n", |
| 389 | + "ax2.plot(lon, lat, 'r', lw=1.5, transform=cartopy.crs.PlateCarree())\n", |
| 390 | + "# add coastlines with filled land and lakes\n", |
| 391 | + "ax2.add_feature(cartopy.feature.LAND, zorder=0, edgecolor='black')\n", |
| 392 | + "ax2.add_feature(cartopy.feature.LAKES)\n", |
| 393 | + "#-- Add colorbar axes at position rect [left, bottom, width, height]\n", |
| 394 | + "cbar_ax = f2.add_axes([0.87, 0.015, 0.0325, 0.94])\n", |
| 395 | + "#-- add extension triangles to upper and lower bounds\n", |
| 396 | + "cbar = f2.colorbar(sc, cax=cbar_ax, extend='both', extendfrac=0.0375,\n", |
| 397 | + " drawedges=False, orientation='vertical')\n", |
| 398 | + "#-- rasterized colorbar to remove lines\n", |
| 399 | + "cbar.solids.set_rasterized(True)\n", |
| 400 | + "#-- Add label to the colorbar and adjust coordinates\n", |
| 401 | + "cbar.ax.set_ylabel('Height above WGS84 Ellipsoid',labelpad=10)\n", |
| 402 | + "cbar.ax.set_xlabel('m', rotation=0)\n", |
| 403 | + "cbar.ax.xaxis.set_label_coords(0.5, 1.05)\n", |
| 404 | + "cbar.ax.tick_params(which='both', width=1, direction='in')\n", |
| 405 | + "# stronger linewidth on frame\n", |
| 406 | + "ax2.spines['geo'].set_linewidth(2.0)\n", |
| 407 | + "ax2.spines['geo'].set_capstyle('projecting')\n", |
| 408 | + "# adjust subplot within figure\n", |
| 409 | + "f2.subplots_adjust(left=0.02,right=0.86,bottom=0.05,top=0.98)\n", |
| 410 | + "# show the figures\n", |
376 | 411 | "plt.show()"
|
377 | 412 | ],
|
378 | 413 | "outputs": [],
|
379 | 414 | "metadata": {}
|
380 |
| - }, |
381 |
| - { |
382 |
| - "cell_type": "code", |
383 |
| - "execution_count": null, |
384 |
| - "source": [], |
385 |
| - "outputs": [], |
386 |
| - "metadata": {} |
387 | 415 | }
|
388 | 416 | ],
|
389 | 417 | "metadata": {
|
|
0 commit comments