Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Reproducing L4A AGBD estimates from GEDI L2A RH metrics

This tutorial shows how to reconstruct L4A aboveground biomass density (AGBD) estimates Dubayah et al. (2022) using L2A relative height (RH) metrics Dubayah et al. (2021). We will use a GEDI L4A file GEDI04_A_2020207182449_O09168_03_T03028_02_002_02_V002.h5 and corresponding GEDI L2A file GEDI02_A_2020207182449_O09168_03_T03028_02_003_01_V002.h5 from the orbit 09168 and track 03028 for this purpose.

Requirements

Additional prerequisites are provided here.

We will use earthaccess module to authenticate to NASA Earthdata Login and download the GEDI L2A and L4A files to the full_orbits directory.

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

1. Reconstruct AGBD for a single shot

We will use a single shot (shot number 91680600300633870) from the beam BEAM0110. First, open the L4A file, and find out the predict_stratum and selected_algorithm for the shot.

For GEDI shot number 91680600300633870, the predict stratum is EBT_SAs, and the selected algorithm group is 2.

L4A model parameters: Let’s print the model_data information for the EBT_SAs stratum.

predict_stratum  :  b'EBT_SAs'
model_group  :  4
model_name  :  b'EBT_coarse'
model_id  :  1
x_transform  :  b'sqrt'
y_transform  :  b'sqrt'
bias_correction_name  :  b'Snowdon'
fit_stratum  :  b'EBT'
rh_index  :  [50 98  0  0  0  0  0  0]
predictor_id  :  [1 2 0 0 0 0 0 0]
predictor_max_value  :  [12.66807  13.052969  0.        0.        0.        0.        0.
  0.      ]
vcov  :  [[ 1.6210171  -0.10003732 -0.047196    0.          0.        ]
 [-0.10003732  0.05625523 -0.04469026  0.          0.        ]
 [-0.047196   -0.04469026  0.04664591  0.          0.        ]
 [ 0.          0.          0.          0.          0.        ]
 [ 0.          0.          0.          0.          0.        ]]
par  :  [-104.9654541     6.80217409    3.95531225    0.            0.        ]
rse  :  3.9209127
dof  :  4811
response_max_value  :  1578.0
bias_correction_value  :  1.1133657
npar  :  3

A square-root transformation is applied to both predictor and response variables as indicated by x_transform and y_transform above. Take a note of the bias_correction_value and bias_correction_name above. We will use the bias_correction_value later to back-transform AGBD values. Now, read all the model parameters and print the AGBD model.

The predict stratum EBT_SAs uses following model:
AGBD = -104.9654541015625 + 6.802174091339111 x RH_50 + 3.9553122520446777 x  RH_98

Also, read the predictor and response offsets from the L4A file.

The predictor offset is 100, 
and the response offset is 0

We will use the predictor offset later when transforming the variables.

L2A file and RH metrics

Now, let’s open the L2A file and read the RH metrics.

For GEDI shot number 91680600300633870, 
L2A rh_50 is 19.149999618530273 m.
L2A rh_98 is 37.150001525878906 m.
Selected algorithm group is 2.

xvar

We can now compute predictor variables xvar from the L2A RH metrics and compare them with the L4A xvar values.

For GEDI shot number 91680600300633870,
L2A derived xvars: 10.91558517068738, 11.711105905331012.
L4A xvars: 10.9155855178833, 11.711106300354004 

agbd_t

Let’s use the L2A-derived xvars from the above to compute AGBD in the transformed space and compare the transformed AGBD with that of L4A.

For GEDI shot number 91680600300633870,
L2A derived agbd_t: 15.605337210641139.
L4A agbd_t: 15.605341134767514 

agbd

Now, let’s back-transform L2A derived agbd_t and compare it with the AGBD from L4A.

For GEDI shot number 91680600300633870,
L2A derived estimated AGBD is 271.13409507246865 Mg / ha.
L4A estimated AGBD 271.1342314315326 Mg / ha.

2. Reconstruct AGBD for a single beam

We will reconstruct AGBD for all the shots within beam BEAM0110. Let’s open the L4A file and read model parameters into a pandas dataframe.

Loading...

Now, read the data from BEAM0110 into the pandas dataframe df_l4a.

Loading...

We can plot total shots by the prediction strata to check how many prediction strata are in the beam BEAM0110.

<Figure size 2000x400 with 1 Axes>

There are ten prediction strata in the BEAM0110. Let’s also plot total shots by the selected algorithm setting groups.

<Figure size 2000x400 with 1 Axes>

There are four algorithm setting groups selected for the beam BEAM0110. Now, open the corresponding GEDI L2A file.

Loading...

We will now join the L4A dataframe (df_l4a) with the L2A dataframe (df_2a) using pandas’ join.

Loading...

Let’s calculate AGBD values from L2A RH metrics and save them to a new column ‘agbd_l2a’ in the dataframe.

We will plot the L4A AGBD values against the AGBD derived from L2A RH metrics by the algorithm setting groups.

<Figure size 1128.88x1000 with 4 Axes>

We will plot the L4A AGBD values against the AGBD derived from L2A RH metrics by the prediction strata to check if the AGBD values look all right.

<Figure size 1683.97x2000 with 10 Axes>
References
  1. Dubayah, R. O., Armston, J., Kellner, J. R., Duncanson, L., Healey, S. P., Patterson, P. L., Hancock, S., Tang, H., Bruening, J., Hofton, M. A., Blair, J. B., & Luthcke, S. B. (2022). GEDI L4A Footprint Level Aboveground Biomass Density, Version 2.1. 10.3334/ORNLDAAC/2056
  2. Dubayah, R., Hofton, M., Blair, J., Armston, J., Tang, H., & Luthcke, S. (2021). GEDI L2A Elevation and Height Metrics Data Global Footprint Level V002. 10.5067/GEDI/GEDI02_A.002