Running the PhoREAL algorithm over Grand Mesa, CO

Demonstrate running the PhoREAL algorithm in SlideRule to produce canopy metrics over the Grand Mesa, Colorado region.

Imports

[1]:
import logging
import sliderule
from sliderule import icesat2

Initialize Client

[2]:
sliderule.init(verbose=True, loglevel=logging.INFO)
[2]:
True

Processing parameters

[3]:
parms = {
    "poly": sliderule.toregion('grandmesa.geojson')['poly'], # subset to Grand Mesa area of interest
    "t0": '2019-11-14T00:00:00Z', # time range is one day - November 14, 2019
    "t1": '2019-11-15T00:00:00Z',
    "srt": icesat2.SRT_LAND, # use the land surface type for ATL03 photon confidence levels
    "len": 100, # generate statistics over a 100m segment
    "res": 100, # generate statistics every 100m
    "pass_invalid": True, # do not perform any segment-level filtering
    "atl08_class": ["atl08_ground", "atl08_canopy", "atl08_top_of_canopy"], # exclude noise and unclassified photons
    "atl08_fields": ["h_dif_ref"], # include these fields as extra columns in the dataframe
    "phoreal": {"binsize": 1.0, "geoloc": "center"} # run the PhoREAL algorithm
}

Make Proessing Request

[4]:
atl08 = sliderule.run("atl03x", parms)
request <AppServer.61671> retrieved 1 resources
Starting proxy for atl03x to process 1 resource(s) with 1 thread(s)
request <AppServer.62515> on ATL03_20191114034331_07370502_006_01.h5 generated dataframe [gt3r] with 343 rows and 21 columns
request <AppServer.62515> on ATL03_20191114034331_07370502_006_01.h5 generated dataframe [gt3l] with 341 rows and 21 columns
request <AppServer.62515> on ATL03_20191114034331_07370502_006_01.h5 generated dataframe [gt2l] with 351 rows and 21 columns
request <AppServer.62515> on ATL03_20191114034331_07370502_006_01.h5 generated dataframe [gt1l] with 355 rows and 21 columns
request <AppServer.62515> on ATL03_20191114034331_07370502_006_01.h5 generated dataframe [gt2r] with 354 rows and 21 columns
request <AppServer.62515> on ATL03_20191114034331_07370502_006_01.h5 generated dataframe [gt1r] with 357 rows and 21 columns
Successfully completed processing resource [1 out of 1]: ATL03_20191114034331_07370502_006_01.h5
Writing arrow file: /tmp/tmpd6vg4yk5
Closing arrow file: /tmp/tmpd6vg4yk5

Plot Canopy Height

[6]:
canopy_gt1l = atl08[atl08['gt'] == icesat2.GT1L]
canopy_gt1l.plot.scatter(x='x_atc', y='h_canopy')
[6]:
<Axes: xlabel='x_atc', ylabel='h_canopy'>
../_images/assets_phoreal_12_1.png

Plot Landcover

[7]:
atl08.plot('landcover', legend=True)
[7]:
<Axes: >
../_images/assets_phoreal_14_1.png

Create and Plot 75th percentile Across All Ground Tracks

[8]:
atl08['75'] = atl08.apply(lambda row : row["canopy_h_metrics"][icesat2.P['75']], axis = 1)
atl08.plot.scatter(x='x_atc', y='75')
[8]:
<Axes: xlabel='x_atc', ylabel='75'>
../_images/assets_phoreal_16_1.png