Boulder Watershed Demo¶
Process ATL03 data from the Boulder Watershed region and produce a customized ATL06 elevation dataset.
What is demonstrated¶
- The
icesat2.atl06p
API is used to perform a SlideRule parallel processing request of the Boulder Watershed region - The
matplotlib
andgeopandas
packages are used to plot the data returned by SlideRule
Points of interest¶
This is a simple notebook showing how a region of interest can be processed by SlideRule and the results analyzed using pandas DataFrames and Matplotlib.
In [1]:
import logging
import geopandas as gpd
import matplotlib.pyplot as plt
from sliderule import icesat2
SlideRule Configuration¶
In [2]:
# Configure ICESat-2 API
icesat2.init("slideruleearth.io")
# Configure Region of Interest
region = [ {"lon":-105.82971551223244, "lat": 39.81983728534918},
{"lon":-105.30742121965137, "lat": 39.81983728534918},
{"lon":-105.30742121965137, "lat": 40.164048017973755},
{"lon":-105.82971551223244, "lat": 40.164048017973755},
{"lon":-105.82971551223244, "lat": 39.81983728534918} ]
Execute ATL06 Algorithm using SlideRule¶
In [3]:
%%time
# Build ATL06 Request
parms = {
"poly": region,
"srt": icesat2.SRT_LAND,
"cnf": icesat2.CNF_SURFACE_HIGH,
"ats": 10.0,
"cnt": 10,
"len": 40.0,
"res": 20.0
}
# Request ATL06 Data
gdf = icesat2.atl06p(parms)
# Display Statistics
print("Reference Ground Tracks: {}".format(gdf["rgt"].unique()))
print("Cycles: {}".format(gdf["cycle"].unique()))
print("Received {} elevations".format(len(gdf)))
Reference Ground Tracks: [554 973 996 28 531 51] Cycles: [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21] Received 308983 elevations CPU times: user 12 s, sys: 283 ms, total: 12.3 s Wall time: 36.2 s
Plot Region¶
In [4]:
# Calculate Extent
lons = [p["lon"] for p in region]
lats = [p["lat"] for p in region]
lon_margin = (max(lons) - min(lons)) * 0.1
lat_margin = (max(lats) - min(lats)) * 0.1
# Create Plot
fig,(ax1,ax2) = plt.subplots(num=None, ncols=2, figsize=(12, 6))
box_lon = [e["lon"] for e in region]
box_lat = [e["lat"] for e in region]
# Plot SlideRule Ground Tracks
ax1.set_title("SlideRule Zoomed Ground Tracks")
gdf.plot(ax=ax1, column=gdf["h_mean"], cmap='winter_r', s=1.0, zorder=3)
ax1.plot(box_lon, box_lat, linewidth=1.5, color='r', zorder=2)
ax1.set_xlim(min(lons) - lon_margin, max(lons) + lon_margin)
ax1.set_ylim(min(lats) - lat_margin, max(lats) + lat_margin)
ax1.set_aspect('equal', adjustable='box')
# Plot SlideRule Global View
ax2.set_title("SlideRule Global Reference")
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
world.plot(ax=ax2, color='0.8', edgecolor='black')
gdf.plot(ax=ax2, marker='o', color='red', markersize=2.5, zorder=3)
ax2.set_xlim(-180,180)
ax2.set_ylim(-90,90)
ax2.set_aspect('equal', adjustable='box')
# Show Plot
plt.tight_layout()
/tmp/ipykernel_2187566/3994963524.py:22: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/. world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
In [ ]: