Accessing Global Ecosystem Dynamics Investigation (GEDI) Level 3 Granule Data

In this example, we demonstrate how to access GEDI Level 3 granule data on the MAAP ADE.

Within your Jupyter Notebook, start by importing the maap package. Then invoke the MAAP constructor, setting the maap_host argument to 'api.ops.maap-project.org'.

[1]:
# import os module
import os
# import the maap package to handle queries
from maap.maap import MAAP
# invoke the MAAP constructor using the maap_host argument
maap = MAAP(maap_host='api.ops.maap-project.org')

Search for a granule using the searchGranule function (for more information on searching for granules, see Searching for Granules in MAAP). Note that we can use searchGranule’s cmr_host argument to specify cmr.maap-project.org as the CMR instance.

[2]:
# search for granule data using CMR host name and collection concept ID arguments
results = maap.searchGranule(
    cmr_host='cmr.maap-project.org',
    collection_concept_id='C1201702030-NASA_MAAP'
)

Let’s view the list of GranuleURs within our results:

[3]:
# show all of the items
[item['Granule']['GranuleUR'] for item in results]
[3]:
['GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_stddev_2019108_2020287_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_counts_2019108_2021104_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_stddev_2019108_2021104_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_mean_2019108_2020287_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_mean_2019108_2021104_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_stddev_2019108_2021104_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_counts_2019108_2020287_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_mean_2019108_2021104_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_mean_2019108_2020287_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_stddev_2019108_2020287_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_counts_2019108_2021216_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_mean_2019108_2021216_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_stddev_2019108_2021216_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_mean_2019108_2021216_002_02.tif',
 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_stddev_2019108_2021216_002_02.tif']

For this example, we are interested in downloading GEDI03_elev_lowestmode_stddev_2019108_2021104_002_02.tif.

[4]:
# select item
results[2]['Granule']['GranuleUR']
[4]:
'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_stddev_2019108_2021104_002_02.tif'

Now utilize the getData function, which downloads granule data if it doesn’t already exist locally. We can use getData to download the third result from our granule search into the file system and assign its local path to a variable (in this case download).

[5]:
# download granule item
local_dir = '/projects/local_data'  # download directory (absolute path or relative to current directory)
os.makedirs(local_dir, exist_ok=True) # create directories, as necessary
download = results[2].getData(local_dir)  # default download directory is current directory, if no directory is given

We can then use the print function to see the file name and directory.

[6]:
# print path to downloaded file
print(download)
/projects/local_data/GEDI03_elev_lowestmode_stddev_2019108_2021104_002_02.tif