Page 1 of 1

Broken CMR query for downloading GEDI L4A data

Posted: Sun Mar 20, 2022 2:00 pm America/New_York
by gcaria
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]

Re: Broken CMR query for downloading GEDI L4A data

Posted: Tue Mar 22, 2022 10:01 am America/New_York
by ORNL - shresthar
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!

Re: Broken CMR query for downloading GEDI L4A data

Posted: Fri Apr 08, 2022 8:51 am America/New_York
by patkacic
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

Re: Broken CMR query for downloading GEDI L4A data

Posted: Fri Apr 08, 2022 9:40 am America/New_York
by rupeshornl
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