Visualizing GEDI L4B Data¶
In this example, we demonstrate how to access GEDI L4B 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]:
from maap.maap import MAAP
from matplotlib import pyplot
import os
import pprint
import rasterio
maap = MAAP(maap_host="api.ops.maap-project.org")
Search all collections to find the GEDI collection¶
Then search granules by the GEDI collection’s collection ID.
[2]:
results = maap.searchCollection()
for collection in results:
if collection['Collection']['ShortName'] == 'GEDI_L4B_Gridded_Biomass_2017':
pprint.pprint(collection)
break
{'Collection': {'AdditionalAttributes': {'AdditionalAttribute': [{'DataType': 'STRING',
'Description': 'MAAP '
'data '
'product '
'status ',
'Name': 'Dataset '
'Status',
'Value': 'MAAP '
'Standard '
'Data '
'Product'},
{'DataType': 'BOOLEAN',
'Description': 'Denotes '
'whether '
'the '
'data '
'is '
'geolocated',
'Name': 'Geolocated',
'Value': 'true'},
{'DataType': 'FLOAT',
'Description': 'Ground '
'area '
'imaged '
'by '
'a '
'sensoru2019s '
'instantaneous '
'field '
'of '
'view',
'Name': 'Spatial '
'Resolution',
'Value': '1'},
{'DataType': 'STRING',
'Description': 'File '
'format '
'of '
'the '
'associated '
'granules ',
'Name': 'Data '
'Format',
'Value': 'GeoTIFF'},
{'DataType': 'FLOAT',
'Description': 'Central '
'transmission '
'frequency '
'of '
'the '
'instrument',
'Name': 'Band '
'Center '
'Frequency',
'Value': '281759.8'},
{'DataType': 'FLOAT',
'Description': 'Earth '
'surface '
'distance '
'observed '
'by '
'the '
'instrument',
'Name': 'Swath '
'Width',
'Value': '4.2'},
{'DataType': 'FLOAT',
'Description': 'Angular '
'extent '
'a '
'sensor '
'views '
'across '
'the '
'Earthu2019s '
'surface',
'Name': 'Field '
'of '
'View',
'Value': '12'},
{'DataType': 'FLOAT',
'Description': 'The '
'diameter '
'of '
'the '
'laser '
'beam '
'that '
'reaches '
'the '
'ground',
'Name': 'Laser '
'Footprint '
'Diameter',
'Value': '25'},
{'DataType': 'STRING',
'Description': 'Concise '
'Platform-Instrument '
'data '
'collection '
'method '
'tag',
'Name': 'Acquisition '
'Type',
'Value': 'Satellite '
'Lidar'},
{'DataType': 'FLOAT',
'Description': 'Central '
'transmission '
'wavelength '
'of '
'the '
'instrument',
'Name': 'Band '
'Center '
'Wavelength',
'Value': '1064'}]},
'ArchiveCenter': 'ORNL_DAAC',
'AssociatedBrowseImageUrls': {'ProviderBrowseUrl': {'Description': 'Gridded '
'mean '
'aboveground '
'biomass '
'density '
'(top) '
'and '
'standard '
'error '
'of '
'the '
'mean '
'(bottom).',
'URL': 'https://daac.ornl.gov/GEDI/guides/GEDI_L4B_Gridded_Biomass_Fig1.png'}},
'Campaigns': {'Campaign': {'LongName': 'Global Ecosystem '
'Dynamics Investigation',
'ShortName': 'GEDI'}},
'CollectionState': 'COMPLETE',
'Contacts': {'Contact': {'OrganizationAddresses': {'Address': {'City': 'Oak '
'Ridge',
'Country': 'United '
'States',
'PostalCode': '37831-6407',
'StateProvince': 'Tennessee',
'StreetAddress': 'ORNL '
'DAAC '
'User '
'Services '
'Office, '
'P.O. '
'Box '
'2008, '
'MS '
'6407, '
'Oak '
'Ridge '
'National '
'Laboratory'}},
'OrganizationEmails': {'Email': 'uso@daac.ornl.gov'},
'OrganizationName': 'ORNL_DAAC',
'OrganizationPhones': {'Phone': {'Number': '(865) '
'241-3952',
'Type': 'Direct '
'Line'}},
'Role': 'ARCHIVER'}},
'DOI': {'Authority': 'https://doi.org',
'DOI': '10.3334/ORNLDAAC/2017'},
'DataFormat': 'GeoTIFF',
'DataSetId': 'GEDI L4B Gridded Aboveground Biomass Density, '
'Version 2',
'Description': 'This Global Ecosystem Dynamics Investigation '
'(GEDI) L4B product provides 1 km x 1 km (1 '
'km, hereafter) estimates of mean aboveground '
'biomass density (AGBD) based on observations '
'from mission week 19 starting on 2019-04-18 to '
'mission week 138 ending on 2021-08-04. The '
'GEDI L4A Footprint Biomass product converts '
'each high-quality waveform to an AGBD '
'prediction, and the L4B product uses the '
'sample present within the borders of each 1 km '
'cell to statistically infer mean AGBD. The '
'gridding procedure is described in the GEDI '
'L4B Algorithm Theoretical Basis Document '
'(ATBD). Patterson et al. (2019) describes the '
'hybrid model-based mode of inference used in '
'the L4B product. Corresponding 1 km estimates '
'of the standard error of the mean are also '
'provided in the L4B product. Uncertainty is '
"due to both GEDI's sampling of the 1 km area "
'(as opposed to making wall-to-wall '
'observations) and the fact that L4A biomass '
'values are modeled in a process subject to '
'error instead of measured in a process that '
'may be assumed to be error-free.',
'InsertTime': '2022-03-29T00:00:00.000Z',
'LastUpdate': '2022-03-30T10:43:50.000Z',
'LongName': 'Not provided',
'OnlineAccessURLs': {'OnlineAccessURL': {'URL': 'https://daac.ornl.gov/daacdata/gedi/GEDI_L4B_Gridded_Biomass/',
'URLDescription': 'This '
'link '
'allows '
'direct '
'data '
'access '
'via '
'Earthdata '
'login'}},
'OnlineResources': {'OnlineResource': [{'Description': 'ORNL '
'DAAC '
'Data '
'Set '
'Documentation',
'Type': 'VIEW RELATED '
'INFORMATION : '
'GENERAL '
'DOCUMENTATION',
'URL': 'https://daac.ornl.gov/GEDI/guides/GEDI_L4B_Gridded_Biomass.html'},
{'Description': 'Data '
'set '
'Landing '
'Page '
'DOI '
'URL',
'Type': 'CollectionURL '
': DATA SET '
'LANDING PAGE',
'URL': 'https://doi.org/10.3334/ORNLDAAC/2017'},
{'Description': 'GEDI '
'L4B '
'Gridded '
'Aboveground '
'Biomass '
'Density, '
'Version '
'2: '
'GEDI_L4B_ATBD_v1.0.pdf',
'Type': 'VIEW RELATED '
'INFORMATION : '
'GENERAL '
'DOCUMENTATION',
'URL': 'https://daac.ornl.gov/daacdata/gedi/GEDI_L4B_Gridded_Biomass/comp/GEDI_L4B_ATBD_v1.0.pdf'},
{'Description': 'GEDI '
'L4B '
'Gridded '
'Aboveground '
'Biomass '
'Density, '
'Version '
'2: '
'GEDI_L4B_Gridded_Biomass.pdf',
'Type': 'VIEW RELATED '
'INFORMATION : '
'GENERAL '
'DOCUMENTATION',
'URL': 'https://daac.ornl.gov/daacdata/gedi/GEDI_L4B_Gridded_Biomass/comp/GEDI_L4B_Gridded_Biomass.pdf'},
{'Description': 'GEDI '
'Project '
'Site',
'Type': 'CollectionURL '
': PROJECT '
'HOME PAGE',
'URL': 'https://gedi.umd.edu'}]},
'Platforms': {'Platform': {'Instruments': {'Instrument': {'LongName': 'Global '
'Ecosystem '
'Dynamics '
'Investigation',
'ShortName': 'GEDI'}},
'LongName': 'International Space '
'Station',
'ShortName': 'ISS',
'Type': 'Space Stations/Crewed '
'Spacecraft'}},
'Price': ' 0.00',
'ProcessingLevelDescription': 'model products',
'ProcessingLevelId': '4',
'RevisionDate': '2022-04-20T17:07:00.000Z',
'ScienceKeywords': {'ScienceKeyword': [{'CategoryKeyword': 'EARTH '
'SCIENCE',
'TermKeyword': 'ECOSYSTEMS',
'TopicKeyword': 'BIOSPHERE',
'VariableLevel1Keyword': {'Value': 'TERRESTRIAL '
'ECOSYSTEMS'}},
{'CategoryKeyword': 'EARTH '
'SCIENCE',
'TermKeyword': 'VEGETATION',
'TopicKeyword': 'BIOSPHERE',
'VariableLevel1Keyword': {'Value': 'BIOMASS'}},
{'CategoryKeyword': 'EARTH '
'SCIENCE',
'TermKeyword': 'LIDAR',
'TopicKeyword': 'SPECTRAL/ENGINEERING',
'VariableLevel1Keyword': {'Value': 'LIDAR '
'WAVEFORM'}}]},
'ShortName': 'GEDI_L4B_Gridded_Biomass_2017',
'Spatial': {'GranuleSpatialRepresentation': 'CARTESIAN',
'HorizontalSpatialDomain': {'Geometry': {'BoundingRectangle': {'EastBoundingCoordinate': '180.0',
'NorthBoundingCoordinate': '52.0',
'SouthBoundingCoordinate': '-52.0',
'WestBoundingCoordinate': '-180.0'},
'CoordinateSystem': 'CARTESIAN'}},
'SpatialCoverageType': 'HORIZONTAL'},
'SpatialInfo': {'SpatialCoverageType': 'HORIZONTAL'},
'SpatialKeywords': {'Keyword': 'GLOBAL LAND'},
'Temporal': {'EndsAtPresentFlag': 'false',
'RangeDateTime': {'BeginningDateTime': '2019-04-18T00:00:00.000Z',
'EndingDateTime': '2021-08-04T23:59:59.000Z'}},
'UseConstraints': {'LicenseURL': {'Description': 'License URL '
'for data use '
'policy',
'MimeType': 'text/html',
'Type': 'Data Use Policy',
'URL': 'https://science.nasa.gov/earth-science/earth-science-data/data-information-policy'}},
'VersionId': '2'},
'concept-id': 'C1202077968-NASA_MAAP',
'format': 'application/echo10+xml',
'revision-id': '2'}
Search for granules using searchGranule function with the GEDI collection ID.¶
[3]:
COLLECTIONID = collection['concept-id']
results = maap.searchGranule(concept_id=COLLECTIONID,limit=50) # COLLECTIONID 'C1202077968-NASA_MAAP'
print(f'Got {len(results)} results')
results[0]['Granule']
Got 10 results
[3]:
{'GranuleUR': 'GEDI_L4B_Gridded_Biomass.GEDI04_B_MW019MW138_02_002_05_R01000M_PS.tif',
'InsertTime': '2022-03-29T00:00:00.000Z',
'LastUpdate': '2022-03-30T10:43:51.000Z',
'Collection': {'ShortName': 'GEDI_L4B_Gridded_Biomass_2017',
'VersionId': '2'},
'DataGranule': {'SizeMBDataGranule': '20.103343',
'Checksum': {'Value': '025a141348906d5e612262218c496a2d468446ca30875439be6651d851bfbe23',
'Algorithm': 'SHA-256'},
'DayNightFlag': 'BOTH',
'ProductionDateTime': '2022-03-29T00:00:00.000Z'},
'Temporal': {'RangeDateTime': {'BeginningDateTime': '2019-04-18T00:00:00.000Z',
'EndingDateTime': '2021-08-04T23:59:59.000Z'}},
'Spatial': {'HorizontalSpatialDomain': {'Geometry': {'BoundingRectangle': {'WestBoundingCoordinate': '-180',
'NorthBoundingCoordinate': '52',
'EastBoundingCoordinate': '180',
'SouthBoundingCoordinate': '-52'}}}},
'MeasuredParameters': {'MeasuredParameter': [{'ParameterName': 'LIDAR WAVEFORM'},
{'ParameterName': 'BIOMASS'},
{'ParameterName': 'TERRESTRIAL ECOSYSTEMS'}]},
'Platforms': {'Platform': {'ShortName': 'ISS',
'Instruments': {'Instrument': {'ShortName': 'GEDI'}}}},
'Campaigns': {'Campaign': {'ShortName': 'GEDI'}},
'AdditionalAttributes': {'AdditionalAttribute': [{'Name': 'Dataset Status',
'Values': {'Value': 'MAAP Standard Data Product'}},
{'Name': 'Geolocated', 'Values': {'Value': 'true'}},
{'Name': 'Spatial Resolution', 'Values': {'Value': '1'}},
{'Name': 'Data Format', 'Values': {'Value': 'GeoTIFF'}},
{'Name': 'Band Center Frequency', 'Values': {'Value': '281759.8'}},
{'Name': 'Swath Width', 'Values': {'Value': '4.2'}},
{'Name': 'Field of View', 'Values': {'Value': '12'}},
{'Name': 'Laser Footprint Diameter', 'Values': {'Value': '25'}},
{'Name': 'Acquisition Type', 'Values': {'Value': 'Satellite Lidar'}},
{'Name': 'Band Center Wavelength', 'Values': {'Value': '1094'}}]},
'OnlineAccessURLs': {'OnlineAccessURL': [{'URL': 's3://ornl-cumulus-prod-protected/gedi/GEDI_L4B_Gridded_Biomass/data/GEDI04_B_MW019MW138_02_002_05_R01000M_PS.tif',
'URLDescription': 'File to download'},
{'URL': 'https://data.ornldaac.earthdata.nasa.gov/protected/gedi/GEDI_L4B_Gridded_Biomass/data/GEDI04_B_MW019MW138_02_002_05_R01000M_PS.tif',
'URLDescription': 'Download GEDI04_B_MW019MW138_02_002_05_R01000M_PS.tif'},
{'URL': 'https://data.ornldaac.earthdata.nasa.gov/public/gedi/GEDI_L4B_Gridded_Biomass/data/GEDI04_B_MW019MW138_02_002_05_R01000M_PS.tif.sha256',
'URLDescription': 'Download GEDI04_B_MW019MW138_02_002_05_R01000M_PS.tif.sha256'}]},
'OnlineResources': {'OnlineResource': [{'URL': 'https://daac.ornl.gov/GEDI/guides/GEDI_L4B_Gridded_Biomass.html',
'Description': 'ORNL DAAC Data Set Documentation',
'Type': 'VIEW RELATED INFORMATION'},
{'URL': 'https://doi.org/10.3334/ORNLDAAC/2017',
'Description': 'Data set Landing Page DOI URL',
'Type': 'VIEW RELATED INFORMATION'},
{'URL': 'https:/daac.ornl.gov/daacdata/gedi/GEDI_L4B_Gridded_Biomass/comp/GEDI_L4B_ATBD_v1.0.pdf',
'Description': 'Data Set Documentation',
'Type': 'VIEW RELATED INFORMATION'},
{'URL': 'https:/daac.ornl.gov/daacdata/gedi/GEDI_L4B_Gridded_Biomass/comp/GEDI_L4B_Gridded_Biomass.pdf',
'Description': 'Data Set Documentation',
'Type': 'VIEW RELATED INFORMATION'},
{'URL': 'https://data.ornldaac.earthdata.nasa.gov/s3credentials',
'Description': 'api endpoint to retrieve temporary credentials valid for same-region direct s3 access',
'Type': 'VIEW RELATED INFORMATION'}]},
'Orderable': 'true',
'DataFormat': 'GeoTIFF',
'Visible': 'true'}
Utilize ‘getData’ function to download one granule’s data file¶
[4]:
download_path = './download/gedi_l4b'
os.makedirs(download_path, exist_ok=True)
download = results[0].getData(download_path)
# Print the downloaded file
download
[4]:
'./download/gedi_l4b/GEDI04_B_MW019MW138_02_002_05_R01000M_PS.tif'
[5]:
src = rasterio.open(download)
data = src.read(1)
# Print the shape of data to verify if rasterio was able to read the file properly
print(data.shape)
(14616, 34704)