ICESat-2 SlideRule Demo¶

Process ATL03 data from the Grand Mesa, CO region and produce a customized ATL06 dataset.

What is demonstrated¶

  • The icesat2.atl06p API is used to perform a SlideRule parallel processing request of the Grand Mesa region
  • The icesat2.cmr and icesat2.h5p API's are used to manually retrieve specific ATL06 datasets corresponding to the Grand Mesa region
  • The pyproj and shapely packages are used to subset ATL06 data that was manually retrieved
  • The matplotlib package is used to plot the data processed by SlideRule alongside the manually retrieved and subsetted data

Points of interest¶

The resulting datasets plotted at the bottom of the notebook show that existing ATL06 data is not available for the entire Grand Mesa region. By using the SlideRule API to process ATL03 data and produce a customized ATL06 dataset, elevation data can be returned for the entire region of interest.

In [1]:
import sys
import logging
import concurrent.futures
import time
from datetime import datetime
import pandas as pd
import geopandas as gpd
import matplotlib.pyplot as plt
from pyproj import Transformer, CRS
from shapely.geometry import Polygon, Point
from sliderule import sliderule, icesat2, earthdata, h5

SlideRule Configuration¶

In [2]:
# Configure ICESat-2 API
icesat2.init("slideruleearth.io", verbose=True)
In [3]:
sliderule.update_available_servers()
Out[3]:
(7, 0)

Specify Region of Interest¶

In [4]:
# Specify region of interest from geojson
poly_fn = 'grandmesa.geojson'
region = sliderule.toregion(poly_fn)["poly"]
region
Out[4]:
[{'lon': -108.20772968780051, 'lat': 38.8232055291981},
 {'lon': -108.07460164311031, 'lat': 38.8475137825863},
 {'lon': -107.72839858755752, 'lat': 39.01510930230633},
 {'lon': -107.78724142490994, 'lat': 39.195630349659986},
 {'lon': -108.17287000970857, 'lat': 39.15920066396116},
 {'lon': -108.31168256553767, 'lat': 39.13757646212944},
 {'lon': -108.34115668325224, 'lat': 39.03758987613325},
 {'lon': -108.2878686387796, 'lat': 38.89051431295789},
 {'lon': -108.20772968780051, 'lat': 38.8232055291981}]
In [5]:
# Read geojson with geopandas
pregion = gpd.read_file(poly_fn)
pregion.plot();
No description has been provided for this image
In [6]:
# Prepare coordinate lists for plotting the region of interest polygon
region_lon = [e["lon"] for e in region]
region_lat = [e["lat"] for e in region]

Specify parameters for ATL06-SR processing¶

In [7]:
# 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
}

Calculate ATL06-SR Elevations from ATL03 Photons using SlideRule¶

In [8]:
# Latch Start Time
perf_start = time.perf_counter()

# Request ATL06 Data
atl06_sr = icesat2.atl06p(parms)

# Latch Stop Time
perf_stop = time.perf_counter()

# Display Statistics
perf_duration = perf_stop - perf_start
print("Completed in {:.3f} seconds of wall-clock time".format(perf_duration))
print("Reference Ground Tracks: {}".format(atl06_sr["rgt"].unique()))
print("Cycles: {}".format(atl06_sr["cycle"].unique()))
print("Received {} elevations".format(atl06_sr.shape[0]))
Completed in 30.262 seconds of wall-clock time
Reference Ground Tracks: [ 272  295  714  737 1156 1179  211  234]
Cycles: [ 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21]
Received 379496 elevations

Plot ATL06-SR Results¶

In [9]:
f, ax = plt.subplots()
ax.set_title("ATL06-SR Points")
ax.set_aspect('equal')
atl06_sr.plot(ax=ax, column='h_mean', cmap='inferno', s=0.1)
ax.plot(region_lon, region_lat, linewidth=1, color='g');
No description has been provided for this image
In [10]:
atl06_sr
Out[10]:
y_atc x_atc segment_id spot h_sigma region rms_misfit w_surface_window_final n_fit_photons gt dh_fit_dx h_mean rgt pflags cycle geometry
time
2018-10-16 10:49:21.177004288 44675.378906 15708287.0 784256 6 0.111745 6 0.604252 3.642701 31 10 0.033667 1932.724302 272 0 1 POINT (-108.05598 39.17009)
2018-10-16 10:49:21.180020480 44674.816406 15708307.0 784257 6 0.095391 6 0.662935 4.146861 52 10 0.087854 1934.069145 272 0 1 POINT (-108.05601 39.16991)
2018-10-16 10:49:21.183400960 44674.156250 15708327.0 784258 6 0.085968 6 0.589985 4.299329 49 10 0.081110 1935.859843 272 0 1 POINT (-108.05605 39.16971)
2018-10-16 10:49:21.186394368 44673.578125 15708347.0 784259 6 0.103511 6 0.552829 4.377315 29 10 0.085489 1937.363736 272 0 1 POINT (-108.05608 39.16953)
2018-10-16 10:49:21.189383680 44672.921875 15708367.0 784260 6 0.228836 6 1.105599 5.491649 24 10 0.156731 1939.724812 272 0 1 POINT (-108.05611 39.16935)
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2023-10-08 07:47:01.802760192 -16499.166016 4355244.5 217172 6 0.315867 2 1.632349 9.529846 27 60 -0.343154 2033.332517 295 0 21 POINT (-108.19205 39.15532)
2023-10-08 07:47:01.805579776 -16499.357422 4355265.0 217173 6 0.350100 2 1.521886 9.153983 19 60 -0.358178 2026.756257 295 0 21 POINT (-108.19207 39.15550)
2023-10-08 07:47:01.808399616 -16499.494141 4355285.0 217174 6 0.242466 2 1.056740 5.842423 19 60 -0.188902 2021.466102 295 0 21 POINT (-108.19209 39.15568)
2023-10-08 07:47:01.811219968 -16499.607422 4355305.0 217175 6 0.333522 2 1.483338 10.186897 20 60 -0.275146 2016.464355 295 0 21 POINT (-108.19211 39.15586)
2023-10-08 07:47:01.814042624 -16499.689453 4355325.0 217176 6 0.562053 2 2.441869 16.255884 19 60 -0.098025 2011.768593 295 0 21 POINT (-108.19214 39.15604)

379496 rows × 16 columns

In [11]:
# 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,
    "output": {
        "path": "output.geoparquet",
        "format": "parquet",
        "as_geo": True,
        "open_on_complete": True
    }
}
In [12]:
# Latch Start Time
perf_start = time.perf_counter()

# Request ATL06 Data
atl06_sr = icesat2.atl06p(parms)

# Latch Stop Time
perf_stop = time.perf_counter()

# Display Statistics
perf_duration = perf_stop - perf_start
print("Completed in {:.3f} seconds of wall-clock time".format(perf_duration))
print("Reference Ground Tracks: {}".format(atl06_sr["rgt"].unique()))
print("Cycles: {}".format(atl06_sr["cycle"].unique()))
print("Received {} elevations".format(atl06_sr.shape[0]))
Completed in 26.166 seconds of wall-clock time
Reference Ground Tracks: [1179  272  714 1156  295  737  211  234]
Cycles: [ 3  1  2  4  6  7  5  8  9 10 11 13 12 14 15 16 17 18 19 20 21]
Received 379496 elevations
In [13]:
f, ax = plt.subplots()
ax.set_title("ATL06-SR Points")
ax.set_aspect('equal')
atl06_sr.plot(ax=ax, column='h_mean', cmap='inferno', s=0.1)
ax.plot(region_lon, region_lat, linewidth=1, color='g')
Out[13]:
[<matplotlib.lines.Line2D at 0xffff3ac146b0>]
No description has been provided for this image
In [ ]:
 
In [14]:
# 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,
    "output": {
        "path": "output.geoparquet",
        "format": "parquet",
        "as_geo": False,
        "open_on_complete": False
    }
}
In [15]:
# Latch Start Time
perf_start = time.perf_counter()

# Request ATL06 Data
atl06_sr = icesat2.atl06p(parms)

# Latch Stop Time
perf_stop = time.perf_counter()

# Display Statistics
perf_duration = perf_stop - perf_start
print("Completed in {:.3f} seconds of wall-clock time".format(perf_duration))
print(atl06_sr)
Completed in 23.545 seconds of wall-clock time
output.geoparquet
In [16]:
df = gpd.pd.read_parquet("output.geoparquet")
geometry = gpd.points_from_xy(df["longitude"], df["latitude"])
atl06_sr = gpd.GeoDataFrame(df, geometry=geometry)
In [17]:
f, ax = plt.subplots()
ax.set_title("ATL06-SR Points")
ax.set_aspect('equal')
atl06_sr.plot(ax=ax, column='h_mean', cmap='inferno', s=0.1)
ax.plot(region_lon, region_lat, linewidth=1, color='g')
Out[17]:
[<matplotlib.lines.Line2D at 0xffff3d05fcb0>]
No description has been provided for this image

Retrieve ATL06 Elevations Directly using icesat2.h5p API¶

This method of reading H5 data directly is the recommended method and runs faster than icesat2.h5 as each dataset is read in parallel on the server and shares a common cache. The code below has a couple other optimizations including only sampling every 10th coordinate for point inclusion, and reading the lat,lon information first and then reading only the necessary heights.

See https://nsidc.org/data/atl06 for the source dataset.

In [18]:
# read ATL06 resource and return heights within polygon
def subsetted_read(resource, polygon, transformer):

    heights = []
    latitudes = []
    longitudes = []
    api_time = 0

    try:

        # List of tracks to read
        tracks = ["1l", "1r", "2l", "2r", "3l", "3r"]

        # Build list of each lat,lon dataset to read
        geodatasets = []
        for track in tracks:
            prefix = "/gt"+track+"/land_ice_segments/"
            geodatasets.append({"dataset": prefix+"latitude", "startrow": 0, "numrows": -1})
            geodatasets.append({"dataset": prefix+"longitude", "startrow": 0, "numrows": -1})

        # Read lat,lon from resource
        api_start = time.perf_counter()
        geocoords = h5.h5p(geodatasets, resource, "icesat2")
        api_stop = time.perf_counter()
        api_time += (api_stop - api_start)
        
        # Build list of the subsetted h_li datasets to read
        hidatasets = []
        for track in tracks:
            prefix = "/gt"+track+"/land_ice_segments/"
            lat_dataset = geocoords[prefix+"latitude"]
            lon_dataset = geocoords[prefix+"longitude"]
            startrow = -1
            numrows = -1
            index = 0
            while index < len(lat_dataset):
                lat = lat_dataset[index]
                lon = lon_dataset[index]
                c = transformer.transform(lat, lon)
                point = Point(c[0], c[1])
                intersect = point.within(polygon)
                if startrow == -1 and intersect:
                    startrow = index
                elif startrow != -1 and not intersect:
                    break
                index += 10 # only sample values for speed increase
            if startrow >= 0:
                numrows = index - startrow
            if numrows > 0:
                hidatasets.append({"dataset": prefix+"h_li", "startrow": startrow, "numrows": numrows, "prefix": prefix})

        # Read h_li from resource
        if len(hidatasets) > 0:
            api_start = time.perf_counter()
            hivalues = h5.h5p(hidatasets, resource, "icesat2")
            api_stop = time.perf_counter()
            api_time += (api_stop - api_start)

        # Append results
        for entry in hidatasets:
            heights += hivalues[entry["prefix"]+"h_li"].tolist()
            latitudes += geocoords[entry["prefix"]+"latitude"][entry["startrow"]:entry["startrow"]+entry["numrows"]].tolist()
            longitudes += geocoords[entry["prefix"]+"longitude"][entry["startrow"]:entry["startrow"]+entry["numrows"]].tolist()

    except Exception as e:
        pass
        
    # Return results
    return {"resource":  resource,
            "h_li":      heights,
            "latitude":  latitudes,
            "longitude": longitudes,
            "time":      api_time}
In [19]:
# Initialize Total Time Spent Inside API
api_total_time = 0

# Latch Start Time
perf_start = time.perf_counter()

# Query ATL06 Files from NASA CMR System
resources = earthdata.cmr(polygon=region, short_name='ATL06')
print('Retrieved %s resources that intersect region' % (len(resources)))

# Create Projection Transformer
transformer = Transformer.from_crs(4326, 3857) # GPS to Web Mercator

# Project Polygon
pregion = []
for point in region:
    ppoint = transformer.transform(point["lat"], point["lon"])
    pregion.append(ppoint)
polygon = Polygon(pregion)

# Initialize Result Dataset
results = {"latitude": [], "longitude": [], "h_li":[]}

# Update Available Servers #
num_servers, _ = sliderule.update_available_servers()
print('Allocating %d workers across %d processing nodes' % (num_servers, num_servers))

# Make Parallel Processing Requests
with concurrent.futures.ThreadPoolExecutor(max_workers=num_servers) as executor:
    futures = [executor.submit(subsetted_read, resource, polygon, transformer) for resource in resources]
    # Wait for Results
    result_cnt = 0
    for future in concurrent.futures.as_completed(futures):
        result_cnt += 1
        result = future.result()
        print('%d results returned for %s (%d out of %d)' % (len(result["h_li"]), result["resource"], result_cnt, len(resources)))
        results["h_li"] += result["h_li"]
        results["latitude"] += result["latitude"]
        results["longitude"] += result["longitude"]
        api_total_time += result["time"]

# Latch Stop Time
perf_stop = time.perf_counter()
perf_duration = perf_stop - perf_start

# Build GeoDataframe of ATL06 Standard Data Product
geometry = gpd.points_from_xy(results["longitude"], results["latitude"])
df = gpd.pd.DataFrame(results)
atl06_sdp = gpd.GeoDataFrame(df, geometry=geometry)

# Filter Height Values
atl06_sdp = atl06_sdp[atl06_sdp["h_li"] < 10000]

# Print Statistics
print("Completed in {:.3f} seconds of wall-clock time".format(perf_duration))
print("Spent {:.3f} concurrent seconds waiting for api".format(api_total_time))
print("Retrieved {} valid elevations out of {} total elevations".format(len(atl06_sdp), len(results["h_li"])))
Retrieved 117 resources that intersect region
Allocating 7 workers across 7 processing nodes
350 results returned for ATL06_20190111063212_02110206_006_02.h5 (1 out of 117)
1020 results returned for ATL06_20181017222812_02950102_006_02.h5 (2 out of 117)
11110 results returned for ATL06_20181016104402_02720106_006_02.h5 (3 out of 117)
3940 results returned for ATL06_20181114092019_07140106_006_02.h5 (4 out of 117)
0 results returned for ATL06_20190116180755_02950202_006_02.h5 (5 out of 117)
7220 results returned for ATL06_20181214194017_11790102_006_02.h5 (6 out of 117)
10340 results returned for ATL06_20181115210428_07370102_006_02.h5 (7 out of 117)
7420 results returned for ATL06_20181213075606_11560106_006_02.h5 (8 out of 117)
20 results returned for ATL06_20190214164413_07370202_006_02.h5 (9 out of 117)
2500 results returned for ATL06_20190314033606_11560206_006_02.h5 (10 out of 117)
2910 results returned for ATL06_20190213050003_07140206_006_02.h5 (11 out of 117)
20 results returned for ATL06_20190417134754_02950302_006_02.h5 (12 out of 117)
300 results returned for ATL06_20190412021205_02110306_006_02.h5 (13 out of 117)
1240 results returned for ATL06_20190516122353_07370302_006_02.h5 (14 out of 117)
2990 results returned for ATL06_20190515003943_07140306_006_02.h5 (15 out of 117)
2260 results returned for ATL06_20190612231542_11560306_006_02.h5 (16 out of 117)
7760 results returned for ATL06_20190315152016_11790202_006_02.h5 (17 out of 117)
0 results returned for ATL06_20190711215129_02110406_006_02.h5 (18 out of 117)
0 results returned for ATL06_20190809202745_06530406_006_02.h5 (19 out of 117)
3780 results returned for ATL06_20190717092724_02950402_006_02.h5 (20 out of 117)
5220 results returned for ATL06_20190911185531_11560406_006_02.h5 (21 out of 117)
7570 results returned for ATL06_20190614105952_11790302_006_02.h5 (22 out of 117)
1800 results returned for ATL06_20200109131121_02110606_006_01.h5 (23 out of 117)
7060 results returned for ATL06_20191010173137_02110506_006_02.h5 (24 out of 117)
9120 results returned for ATL06_20190913063941_11790402_006_02.h5 (25 out of 117)
10410 results returned for ATL06_20191112155921_07140506_006_01.h5 (26 out of 117)
0 results returned for ATL06_20191213021930_11790502_006_01.h5 (27 out of 117)
10550 results returned for ATL06_20191114034331_07370502_006_01.h5 (28 out of 117)
0 results returned for ATL06_20200211113903_07140606_006_01.h5 (29 out of 117)
9050 results returned for ATL06_20191211143520_11560506_006_01.h5 (30 out of 117)
10200 results returned for ATL06_20200311101508_11560606_006_01.h5 (31 out of 117)
5820 results returned for ATL06_20200115004711_02950602_006_01.h5 (32 out of 117)
8670 results returned for ATL06_20200212232313_07370602_006_01.h5 (33 out of 117)
4620 results returned for ATL06_20200312215919_11790602_006_01.h5 (34 out of 117)
9320 results returned for ATL06_20200409085108_02110706_006_02.h5 (35 out of 117)
10570 results returned for ATL06_20200414202700_02950702_006_02.h5 (36 out of 117)
40 results returned for ATL06_20200512071854_07140706_006_01.h5 (37 out of 117)
9780 results returned for ATL06_20200413084249_02720706_006_02.h5 (38 out of 117)
7300 results returned for ATL06_20200513190303_07370702_006_01.h5 (39 out of 117)
10850 results returned for ATL06_20200610055453_11560706_006_01.h5 (40 out of 117)
3660 results returned for ATL06_20200713042236_02720806_006_01.h5 (41 out of 117)
9320 results returned for ATL06_20200709043054_02110806_006_01.h5 (42 out of 117)
7650 results returned for ATL06_20200611173903_11790702_006_01.h5 (43 out of 117)
740 results returned for ATL06_20200811025839_07140806_006_01.h5 (44 out of 117)
0 results returned for ATL06_20200909013442_11560806_006_02.h5 (45 out of 117)
660 results returned for ATL06_20200910131852_11790802_006_02.h5 (46 out of 117)
8070 results returned for ATL06_20200714160647_02950802_006_01.h5 (47 out of 117)
10140 results returned for ATL06_20200812144249_07370802_006_01.h5 (48 out of 117)
4450 results returned for ATL06_20201109223827_07140906_006_01.h5 (49 out of 117)
4760 results returned for ATL06_20201008001041_02110906_006_01.h5 (50 out of 117)
0 results returned for ATL06_20210210060232_07371002_006_01.h5 (51 out of 117)
10560 results returned for ATL06_20201111102237_07370902_006_01.h5 (52 out of 117)
10710 results returned for ATL06_20201208211432_11560906_006_01.h5 (53 out of 117)
7230 results returned for ATL06_20210309165425_11561006_006_01.h5 (54 out of 117)
8880 results returned for ATL06_20210106195036_02111006_006_01.h5 (55 out of 117)
7980 results returned for ATL06_20201210085843_11790902_006_01.h5 (56 out of 117)
6150 results returned for ATL06_20210311043835_11791002_006_01.h5 (57 out of 117)
710 results returned for ATL06_20210407153029_02111106_006_02.h5 (58 out of 117)
80 results returned for ATL06_20210510135814_07141106_006_01.h5 (59 out of 117)
4620 results returned for ATL06_20210610001826_11791102_006_01.h5 (60 out of 117)
7800 results returned for ATL06_20210409031439_02341102_006_02.h5 (61 out of 117)
6710 results returned for ATL06_20210707111017_02111206_006_01.h5 (62 out of 117)
9740 results returned for ATL06_20210608123416_11561106_006_01.h5 (63 out of 117)
9950 results returned for ATL06_20210512014224_07371102_006_01.h5 (64 out of 117)
660 results returned for ATL06_20210712224610_02951202_006_01.h5 (65 out of 117)
1260 results returned for ATL06_20210809093804_07141206_006_01.h5 (66 out of 117)
9260 results returned for ATL06_20210810212216_07371202_006_01.h5 (67 out of 117)
3000 results returned for ATL06_20211006065018_02111306_006_01.h5 (68 out of 117)
7560 results returned for ATL06_20211011182608_02951302_006_01.h5 (69 out of 117)
2990 results returned for ATL06_20211108051803_07141306_006_01.h5 (70 out of 117)
10840 results returned for ATL06_20210907081412_11561206_006_02.h5 (71 out of 117)
20 results returned for ATL06_20211109170214_07371302_006_01.h5 (72 out of 117)
7740 results returned for ATL06_20210908195822_11791202_006_02.h5 (73 out of 117)
0 results returned for ATL06_20211207035409_11561306_006_01.h5 (74 out of 117)
2440 results returned for ATL06_20211208153820_11791302_006_01.h5 (75 out of 117)
650 results returned for ATL06_20220110140602_02951402_006_01.h5 (76 out of 117)
6670 results returned for ATL06_20220105023009_02111406_006_01.h5 (77 out of 117)
20 results returned for ATL06_20220309111809_11791402_006_01.h5 (78 out of 117)
7940 results returned for ATL06_20220307233359_11561406_006_01.h5 (79 out of 117)
3020 results returned for ATL06_20220207005753_07141406_006_01.h5 (80 out of 117)
2580 results returned for ATL06_20220508203744_07141506_006_01.h5 (81 out of 117)
10540 results returned for ATL06_20220208124202_07371402_006_01.h5 (82 out of 117)
5410 results returned for ATL06_20220606191353_11561506_006_01.h5 (83 out of 117)
10490 results returned for ATL06_20220510082159_07371502_006_01.h5 (84 out of 117)
1040 results returned for ATL06_20220705175001_02111606_006_02.h5 (85 out of 117)
670 results returned for ATL06_20220711052550_02951602_006_02.h5 (86 out of 117)
10760 results returned for ATL06_20220809040157_07371602_006_01.h5 (87 out of 117)
8110 results returned for ATL06_20220807161748_07141606_006_01.h5 (88 out of 117)
8940 results returned for ATL06_20220608065802_11791502_006_01.h5 (89 out of 117)
10240 results returned for ATL06_20220905145350_11561606_006_01.h5 (90 out of 117)
0 results returned for ATL06_20221106115729_07141706_006_01.h5 (91 out of 117)
8360 results returned for ATL06_20220907023800_11791602_006_01.h5 (92 out of 117)
8180 results returned for ATL06_20221004132946_02111706_006_01.h5 (93 out of 117)
40 results returned for ATL06_20221206221738_11791702_006_01.h5 (94 out of 117)
4510 results returned for ATL06_20221010010539_02951702_006_01.h5 (95 out of 117)
4820 results returned for ATL06_20221205103329_11561706_006_01.h5 (96 out of 117)
0 results returned for ATL06_20230103090928_02111806_006_01.h5 (97 out of 117)
0 results returned for ATL06_20230108204519_02951802_006_01.h5 (98 out of 117)
10150 results returned for ATL06_20221107234139_07371702_006_01.h5 (99 out of 117)
2990 results returned for ATL06_20230205073720_07141806_006_01.h5 (100 out of 117)
4560 results returned for ATL06_20230307175730_11791802_006_01.h5 (101 out of 117)
0 results returned for ATL06_20230404044923_02111906_006_01.h5 (102 out of 117)
8070 results returned for ATL06_20230306061322_11561806_006_01.h5 (103 out of 117)
6020 results returned for ATL06_20230206192127_07371802_006_01.h5 (104 out of 117)
6290 results returned for ATL06_20230507031659_07141906_006_01.h5 (105 out of 117)
7910 results returned for ATL06_20230704002839_02112006_006_01.h5 (106 out of 117)
2760 results returned for ATL06_20230605015247_11561906_006_02.h5 (107 out of 117)
10720 results returned for ATL06_20230508150110_07371902_006_01.h5 (108 out of 117)
1170 results returned for ATL06_20230805225610_07142006_006_01.h5 (109 out of 117)
0 results returned for ATL06_20231002200803_02112106_006_01.h5 (110 out of 117)
3380 results returned for ATL06_20230903213207_11562006_006_01.h5 (111 out of 117)
3120 results returned for ATL06_20230709120428_02952002_006_01.h5 (112 out of 117)
10310 results returned for ATL06_20230807104020_07372002_006_01.h5 (113 out of 117)
8180 results returned for ATL06_20230606133655_11791902_006_01.h5 (114 out of 117)
7180 results returned for ATL06_20230905091613_11792002_006_01.h5 (115 out of 117)
10050 results returned for ATL06_20231006195944_02722106_006_01.h5 (116 out of 117)
10570 results returned for ATL06_20231008074353_02952102_006_01.h5 (117 out of 117)
Completed in 273.442 seconds of wall-clock time
Spent 976.010 concurrent seconds waiting for api
Retrieved 583241 valid elevations out of 615890 total elevations

Trim ATL06 points to region polygon¶

In [20]:
# Create shapely polygon
pregion = Polygon(zip(region_lon, region_lat))

# Using geopandas
idx = atl06_sdp.within(pregion)
atl06_sdp = atl06_sdp[idx]

Plot ATL06-SR vs. ATL06¶

In [21]:
# Set color ramp limits
vmin, vmax = atl06_sdp['h_li'].quantile((0.02, 0.98))

# Create dictionary of common keyword arguments
plot_kw = {'cmap':'inferno', 's':0.1, 'vmin':vmin, 'vmax':vmax}

f, axa = plt.subplots(2,1, figsize=(10,10)) # sharex=True, sharey=True
axa[0].set_title("ATL06-SR Points")
atl06_sr.plot(ax=axa[0], column='h_mean', **plot_kw)
axa[1].set_title("ATL06 Points")
atl06_sdp.plot(ax=axa[1], column='h_li', **plot_kw)

for ax in axa:
    # Plot the region polygon
    ax.plot(region_lon, region_lat, linewidth=1, color='g')
    ax.set_aspect('equal');
    ax.set_facecolor('lightgray')
No description has been provided for this image
In [ ]: