Broken CMR query for downloading GEDI L4A data

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
gcaria
Posts: 8
Joined: Mon Jun 29, 2020 11:02 am America/New_York
Answers: 0

Broken CMR query for downloading GEDI L4A data

by gcaria » Sun Mar 20, 2022 2:00 pm America/New_York

Hi,
I am getting the following error while running the very first few lines of this github tutorial:
https://github.com/ornldaac/gedi_tutorials/blob/main/1_gedi_l4a_search_download.ipynb

The code was working correctly only a few days/weeks ago.

[code]
In [1]: import requests
...:
...: doi = '10.3334/ORNLDAAC/1986'# GEDI L4A DOI
...:
...: # CMR API base url
...: cmrurl='https://cmr.earthdata.nasa.gov/search/'
...:
...: doisearch = cmrurl + 'collections.json?doi=' + doi
...: concept_id = requests.get(doisearch).json()['feed']['entry'][0]['id']
...: print(concept_id)

---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-1-62b778a2de5e> in <module>
7
8 doisearch = cmrurl + 'collections.json?doi=' + doi
----> 9 concept_id = requests.get(doisearch).json()['feed']['entry'][0]['id']
10 print(concept_id)

IndexError: list index out of range
[/code]

Tags:

ORNL - shresthar
Subject Matter Expert
Subject Matter Expert
Posts: 3
Joined: Thu May 14, 2020 4:35 pm America/New_York
Answers: 0

Re: Broken CMR query for downloading GEDI L4A data

by ORNL - shresthar » Tue Mar 22, 2022 10:01 am America/New_York

Hi @gcaria, Over the weekend, while we were transitioning to the new release of GEDI L4A, the dataset was briefly unavailable in the CMR. We have now updated the tutorials to point to the new dataset: https://doi.org/10.3334/ORNLDAAC/2056. This new release addresses the issue related to incorrect AGBD estimates for algorithm setting group 10. Let us know if you are still getting errors running the tutorial. Thank you!

patkacic
Posts: 1
Joined: Fri Apr 08, 2022 8:46 am America/New_York
Answers: 0

Re: Broken CMR query for downloading GEDI L4A data

by patkacic » Fri Apr 08, 2022 8:51 am America/New_York

Hey,

thanks for updating the GEDI L4 Tutorials immediately!

Unfortunately, there is still a small bug in the script:

For downloading GEDI L4A using a polygon (chapter 2. Searching for a polygonal area of interest (Option 2)), in the second cell, the line "granule_size = float(g['granule_size'])" needs to be inside the for loop, i.e.

...
if granules:
for g in granules:
granule_url = ''
granule_poly = ''

# read file size
granule_size = float(g['granule_size'])
...

NOT
...
# read file size
granule_size = float(g['granule_size'])

for g in granules:
granule_url = ''
granule_poly = ''

# read file size
granule_size = float(g['granule_size'])
...

Thanks for the great support, GEDI data really opens up new possibilities for environmental research!

Cheers,
Patrick Kacic

rupeshornl
Subject Matter Expert
Subject Matter Expert
Posts: 15
Joined: Mon Jun 28, 2021 10:37 am America/New_York
Answers: 0
Has thanked: 1 time
Contact:

Re: Broken CMR query for downloading GEDI L4A data

by rupeshornl » Fri Apr 08, 2022 9:40 am America/New_York

Hi @patkacic, Thank you for noticing the bug, which we have now fixed. Also, the scripts in the Jupyter notebooks are available here, if you like to run them directly from the command line:
https://github.com/ornldaac/gedi_tutorials/tree/main/scripts

Post Reply