Process ATL03 data from the Boulder Watershed region and produce a customized ATL06 elevation dataset.
icesat2.atl06p
API is used to perform a SlideRule parallel processing request of the Boulder Watershed regionmatplotlib
and geopandas
packages are used to plot the data returned by SlideRuleThis is a simple notebook showing how a region of interest can be processed by SlideRule and the results analyzed using pandas DataFrames and Matplotlib.
import logging
import geopandas as gpd
import matplotlib.pyplot as plt
from sliderule import icesat2
# Configure ICESat-2 API
icesat2.init("slideruleearth.io", False)
# 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} ]
%%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,
"maxi": 1
}
# 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)))
# 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()