Generating a Custom ATL06 over Grand Mesa, CO

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.

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

SlideRule Configuration

[2]:
# Configure ICESat-2 API
icesat2.init("slideruleearth.io", verbose=True)

Specify Region of Interest

[3]:
# Specify region of interest from geojson
poly_fn = 'grandmesa.geojson'
region = sliderule.toregion(poly_fn)["poly"]
region
[3]:
[{'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}]
[4]:
# Read geojson with geopandas
pregion = gpd.read_file(poly_fn)
pregion.plot()
[4]:
<Axes: >
../_images/assets_grandmesa_6_1.png
[5]:
# 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

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

[7]:
# 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 328.853 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 22 23 24
 25 26]
Received 456284 elevations

Plot ATL06-SR Results

[8]:
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')
[8]:
[<matplotlib.lines.Line2D at 0xffff8225f7d0>]
../_images/assets_grandmesa_13_1.png
[9]:
atl06_sr
[9]:
rgt segment_id h_sigma pflags region spot h_mean cycle n_fit_photons x_atc y_atc w_surface_window_final rms_misfit gt dh_fit_dx geometry
time
2018-10-16 10:49:21.177004288 272 784256 0.111745 0 6 6 1932.724302 1 31 15708287.0 44675.378906 3.642701 0.604252 10 0.033667 POINT (-108.05598 39.17009)
2018-10-16 10:49:21.180020480 272 784257 0.095391 0 6 6 1934.069145 1 52 15708307.0 44674.816406 4.146861 0.662935 10 0.087854 POINT (-108.05601 39.16991)
2018-10-16 10:49:21.183400960 272 784258 0.085968 0 6 6 1935.859843 1 49 15708327.0 44674.156250 4.299329 0.589985 10 0.081110 POINT (-108.05605 39.16971)
2018-10-16 10:49:21.186394368 272 784259 0.103511 0 6 6 1937.363736 1 29 15708347.0 44673.578125 4.377315 0.552829 10 0.085489 POINT (-108.05608 39.16953)
2018-10-16 10:49:21.189383680 272 784260 0.228836 0 6 6 1939.724812 1 24 15708367.0 44672.921875 5.491649 1.105599 10 0.156731 POINT (-108.05611 39.16935)
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2025-03-01 19:35:14.381412352 1156 786276 0.039116 0 6 3 1809.241517 26 77 15748581.0 53.955978 3.000000 0.337297 30 0.009599 POINT (-108.09533 38.84831)
2025-03-01 19:35:14.384235264 1156 786277 0.143267 0 6 3 1809.442963 26 31 15748601.0 54.076244 3.000000 0.359424 30 0.012008 POINT (-108.09535 38.84813)
2025-03-01 19:35:14.483593728 1156 786318 0.044556 0 6 5 1939.807796 26 31 15749423.0 -3140.267578 3.000000 0.185644 50 -0.085055 POINT (-108.13288 38.84350)
2025-03-01 19:35:14.486412800 1156 786319 0.023107 0 6 5 1938.087212 26 58 15749443.0 -3140.208008 3.000000 0.174826 50 -0.082697 POINT (-108.13290 38.84332)
2025-03-01 19:35:14.489231360 1156 786320 0.035430 0 6 5 1936.335395 26 41 15749463.0 -3140.146484 3.000000 0.156817 50 -0.090317 POINT (-108.13293 38.84314)

456284 rows × 16 columns

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.

[10]:
# 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}
[11]:
# 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 147 resources that intersect region
Allocating 7 workers across 7 processing nodes
350 results returned for ATL06_20190111063212_02110206_006_02.h5 (1 out of 147)
1020 results returned for ATL06_20181017222812_02950102_006_02.h5 (2 out of 147)
3940 results returned for ATL06_20181114092019_07140106_006_02.h5 (3 out of 147)
0 results returned for ATL06_20190116180755_02950202_006_02.h5 (4 out of 147)
11110 results returned for ATL06_20181016104402_02720106_006_02.h5 (5 out of 147)
7420 results returned for ATL06_20181213075606_11560106_006_02.h5 (6 out of 147)
10340 results returned for ATL06_20181115210428_07370102_006_02.h5 (7 out of 147)
7220 results returned for ATL06_20181214194017_11790102_006_02.h5 (8 out of 147)
20 results returned for ATL06_20190214164413_07370202_006_02.h5 (9 out of 147)
2910 results returned for ATL06_20190213050003_07140206_006_02.h5 (10 out of 147)
2500 results returned for ATL06_20190314033606_11560206_006_02.h5 (11 out of 147)
20 results returned for ATL06_20190417134754_02950302_006_02.h5 (12 out of 147)
300 results returned for ATL06_20190412021205_02110306_006_02.h5 (13 out of 147)
2990 results returned for ATL06_20190515003943_07140306_006_02.h5 (14 out of 147)
1240 results returned for ATL06_20190516122353_07370302_006_02.h5 (15 out of 147)
2260 results returned for ATL06_20190612231542_11560306_006_02.h5 (16 out of 147)
0 results returned for ATL06_20190711215129_02110406_006_02.h5 (17 out of 147)
3780 results returned for ATL06_20190717092724_02950402_006_02.h5 (18 out of 147)
7760 results returned for ATL06_20190315152016_11790202_006_02.h5 (19 out of 147)
0 results returned for ATL06_20190809202745_06530406_006_02.h5 (20 out of 147)
5220 results returned for ATL06_20190911185531_11560406_006_02.h5 (21 out of 147)
7570 results returned for ATL06_20190614105952_11790302_006_02.h5 (22 out of 147)
7060 results returned for ATL06_20191010173137_02110506_006_02.h5 (23 out of 147)
1800 results returned for ATL06_20200109131121_02110606_006_01.h5 (24 out of 147)
9120 results returned for ATL06_20190913063941_11790402_006_02.h5 (25 out of 147)
0 results returned for ATL06_20191213021930_11790502_006_01.h5 (26 out of 147)
10550 results returned for ATL06_20191114034331_07370502_006_01.h5 (27 out of 147)
10410 results returned for ATL06_20191112155921_07140506_006_01.h5 (28 out of 147)
9050 results returned for ATL06_20191211143520_11560506_006_01.h5 (29 out of 147)
0 results returned for ATL06_20200211113903_07140606_006_01.h5 (30 out of 147)
5820 results returned for ATL06_20200115004711_02950602_006_01.h5 (31 out of 147)
10200 results returned for ATL06_20200311101508_11560606_006_01.h5 (32 out of 147)
8670 results returned for ATL06_20200212232313_07370602_006_01.h5 (33 out of 147)
4620 results returned for ATL06_20200312215919_11790602_006_01.h5 (34 out of 147)
9320 results returned for ATL06_20200409085108_02110706_006_02.h5 (35 out of 147)
10570 results returned for ATL06_20200414202700_02950702_006_02.h5 (36 out of 147)
40 results returned for ATL06_20200512071854_07140706_006_01.h5 (37 out of 147)
9780 results returned for ATL06_20200413084249_02720706_006_02.h5 (38 out of 147)
7300 results returned for ATL06_20200513190303_07370702_006_01.h5 (39 out of 147)
10850 results returned for ATL06_20200610055453_11560706_006_01.h5 (40 out of 147)
3660 results returned for ATL06_20200713042236_02720806_006_01.h5 (41 out of 147)
7650 results returned for ATL06_20200611173903_11790702_006_01.h5 (42 out of 147)
740 results returned for ATL06_20200811025839_07140806_006_01.h5 (43 out of 147)
9320 results returned for ATL06_20200709043054_02110806_006_01.h5 (44 out of 147)
0 results returned for ATL06_20200909013442_11560806_006_02.h5 (45 out of 147)
660 results returned for ATL06_20200910131852_11790802_006_02.h5 (46 out of 147)
8070 results returned for ATL06_20200714160647_02950802_006_01.h5 (47 out of 147)
10140 results returned for ATL06_20200812144249_07370802_006_01.h5 (48 out of 147)
4450 results returned for ATL06_20201109223827_07140906_006_01.h5 (49 out of 147)
4760 results returned for ATL06_20201008001041_02110906_006_01.h5 (50 out of 147)
10560 results returned for ATL06_20201111102237_07370902_006_01.h5 (51 out of 147)
8880 results returned for ATL06_20210106195036_02111006_006_01.h5 (52 out of 147)
0 results returned for ATL06_20210210060232_07371002_006_01.h5 (53 out of 147)
7230 results returned for ATL06_20210309165425_11561006_006_01.h5 (54 out of 147)
7980 results returned for ATL06_20201210085843_11790902_006_01.h5 (55 out of 147)
10710 results returned for ATL06_20201208211432_11560906_006_01.h5 (56 out of 147)
6150 results returned for ATL06_20210311043835_11791002_006_01.h5 (57 out of 147)
710 results returned for ATL06_20210407153029_02111106_006_02.h5 (58 out of 147)
4620 results returned for ATL06_20210610001826_11791102_006_01.h5 (59 out of 147)
80 results returned for ATL06_20210510135814_07141106_006_01.h5 (60 out of 147)
7800 results returned for ATL06_20210409031439_02341102_006_02.h5 (61 out of 147)
9950 results returned for ATL06_20210512014224_07371102_006_01.h5 (62 out of 147)
9740 results returned for ATL06_20210608123416_11561106_006_01.h5 (63 out of 147)
660 results returned for ATL06_20210712224610_02951202_006_01.h5 (64 out of 147)
6710 results returned for ATL06_20210707111017_02111206_006_01.h5 (65 out of 147)
1260 results returned for ATL06_20210809093804_07141206_006_01.h5 (66 out of 147)
9260 results returned for ATL06_20210810212216_07371202_006_01.h5 (67 out of 147)
3000 results returned for ATL06_20211006065018_02111306_006_01.h5 (68 out of 147)
2990 results returned for ATL06_20211108051803_07141306_006_01.h5 (69 out of 147)
10840 results returned for ATL06_20210907081412_11561206_006_02.h5 (70 out of 147)
20 results returned for ATL06_20211109170214_07371302_006_01.h5 (71 out of 147)
7560 results returned for ATL06_20211011182608_02951302_006_01.h5 (72 out of 147)
7740 results returned for ATL06_20210908195822_11791202_006_02.h5 (73 out of 147)
0 results returned for ATL06_20211207035409_11561306_006_01.h5 (74 out of 147)
2440 results returned for ATL06_20211208153820_11791302_006_01.h5 (75 out of 147)
650 results returned for ATL06_20220110140602_02951402_006_01.h5 (76 out of 147)
6670 results returned for ATL06_20220105023009_02111406_006_01.h5 (77 out of 147)
7940 results returned for ATL06_20220307233359_11561406_006_01.h5 (78 out of 147)
3020 results returned for ATL06_20220207005753_07141406_006_01.h5 (79 out of 147)
20 results returned for ATL06_20220309111809_11791402_006_01.h5 (80 out of 147)
2580 results returned for ATL06_20220508203744_07141506_006_01.h5 (81 out of 147)
10540 results returned for ATL06_20220208124202_07371402_006_01.h5 (82 out of 147)
1040 results returned for ATL06_20220705175001_02111606_006_02.h5 (83 out of 147)
5410 results returned for ATL06_20220606191353_11561506_006_01.h5 (84 out of 147)
670 results returned for ATL06_20220711052550_02951602_006_02.h5 (85 out of 147)
10490 results returned for ATL06_20220510082159_07371502_006_01.h5 (86 out of 147)
8940 results returned for ATL06_20220608065802_11791502_006_01.h5 (87 out of 147)
10760 results returned for ATL06_20220809040157_07371602_006_01.h5 (88 out of 147)
8110 results returned for ATL06_20220807161748_07141606_006_01.h5 (89 out of 147)
10240 results returned for ATL06_20220905145350_11561606_006_01.h5 (90 out of 147)
0 results returned for ATL06_20221106115729_07141706_006_01.h5 (91 out of 147)
8360 results returned for ATL06_20220907023800_11791602_006_01.h5 (92 out of 147)
8180 results returned for ATL06_20221004132946_02111706_006_01.h5 (93 out of 147)
4510 results returned for ATL06_20221010010539_02951702_006_01.h5 (94 out of 147)
0 results returned for ATL06_20221206221738_11791702_006_02.h5 (95 out of 147)
0 results returned for ATL06_20230103090928_02111806_006_02.h5 (96 out of 147)
4820 results returned for ATL06_20221205103329_11561706_006_02.h5 (97 out of 147)
0 results returned for ATL06_20230108204519_02951802_006_02.h5 (98 out of 147)
10150 results returned for ATL06_20221107234139_07371702_006_01.h5 (99 out of 147)
2990 results returned for ATL06_20230205073720_07141806_006_02.h5 (100 out of 147)
0 results returned for ATL06_20230404044923_02111906_006_02.h5 (101 out of 147)
4600 results returned for ATL06_20230307175730_11791802_006_02.h5 (102 out of 147)
6020 results returned for ATL06_20230206192127_07371802_006_02.h5 (103 out of 147)
8080 results returned for ATL06_20230306061322_11561806_006_02.h5 (104 out of 147)
6280 results returned for ATL06_20230507031659_07141906_006_03.h5 (105 out of 147)
2760 results returned for ATL06_20230605015247_11561906_006_04.h5 (106 out of 147)
7890 results returned for ATL06_20230704002839_02112006_006_02.h5 (107 out of 147)
10720 results returned for ATL06_20230508150110_07371902_006_03.h5 (108 out of 147)
1160 results returned for ATL06_20230805225610_07142006_006_02.h5 (109 out of 147)
0 results returned for ATL06_20231002200803_02112106_006_02.h5 (110 out of 147)
3120 results returned for ATL06_20230709120428_02952002_006_02.h5 (111 out of 147)
8180 results returned for ATL06_20230606133655_11791902_006_03.h5 (112 out of 147)
3380 results returned for ATL06_20230903213207_11562006_006_02.h5 (113 out of 147)
10290 results returned for ATL06_20230807104020_07372002_006_02.h5 (114 out of 147)
7180 results returned for ATL06_20230905091613_11792002_006_02.h5 (115 out of 147)
2540 results returned for ATL06_20231203171146_11562106_006_03.h5 (116 out of 147)
10050 results returned for ATL06_20231006195944_02722106_006_02.h5 (117 out of 147)
7860 results returned for ATL06_20231106061956_07372102_006_01.h5 (118 out of 147)
10580 results returned for ATL06_20231008074353_02952102_006_02.h5 (119 out of 147)
20 results returned for ATL06_20240203141522_07142206_006_01.h5 (120 out of 147)
10070 results returned for ATL06_20231104183550_07142106_006_01.h5 (121 out of 147)
0 results returned for ATL06_20240107032334_02952202_006_01.h5 (122 out of 147)
3110 results returned for ATL06_20240101154748_02112206_006_01.h5 (123 out of 147)
2520 results returned for ATL06_20240303125112_11562206_006_01.h5 (124 out of 147)
3000 results returned for ATL06_20240401112709_02112306_006_01.h5 (125 out of 147)
10590 results returned for ATL06_20231205045600_11792102_006_03.h5 (126 out of 147)
80 results returned for ATL06_20240505213913_07372302_006_01.h5 (127 out of 147)
4280 results returned for ATL06_20240305003523_11792202_006_01.h5 (128 out of 147)
360 results returned for ATL06_20240701070703_02112406_006_01.h5 (129 out of 147)
10530 results returned for ATL06_20240205015930_07372202_006_01.h5 (130 out of 147)
6290 results returned for ATL06_20240405111845_02722306_006_01.h5 (131 out of 147)
0 results returned for ATL06_20240706184256_02952402_006_01.h5 (132 out of 147)
10400 results returned for ATL06_20240406230301_02952302_006_01.h5 (133 out of 147)
2600 results returned for ATL06_20240803053429_07142406_006_01.h5 (134 out of 147)
1080 results returned for ATL06_20241103125820_07372502_006_01.h5 (135 out of 147)
2340 results returned for ATL06_20240804171846_07372402_006_01.h5 (136 out of 147)
1920 results returned for ATL06_20240901041030_11562406_006_01.h5 (137 out of 147)
8640 results returned for ATL06_20240930024626_02112506_006_01.h5 (138 out of 147)
7970 results returned for ATL06_20240902155443_11792402_006_01.h5 (139 out of 147)
7510 results returned for ATL06_20241005142210_02952502_006_01.h5 (140 out of 147)
0 results returned for ATL06_20250104100153_02952602_006_01.h5 (141 out of 147)
6110 results returned for ATL06_20241229222548_02112606_006_01.h5 (142 out of 147)
11060 results returned for ATL06_20241130234957_11562506_006_02.h5 (143 out of 147)
940 results returned for ATL06_20250202083755_07372602_006_01.h5 (144 out of 147)
3000 results returned for ATL06_20250131205340_07142606_006_01.h5 (145 out of 147)
4590 results returned for ATL06_20241202113411_11792502_006_01.h5 (146 out of 147)
10860 results returned for ATL06_20250301192952_11562606_006_01.h5 (147 out of 147)
Completed in 367.934 seconds of wall-clock time
Spent 1184.550 concurrent seconds waiting for api
Retrieved 713622 valid elevations out of 756120 total elevations

Trim ATL06 points to region polygon

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

[13]:
# 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')
../_images/assets_grandmesa_21_0.png