Broken CMR query for downloading GEDI L4A data
Broken CMR query for downloading GEDI L4A data
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]
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]
Filters:
-
- Subject Matter Expert
- Posts: 3
- Joined: Thu May 14, 2020 4:35 pm America/New_York
Re: Broken CMR query for downloading GEDI L4A data
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
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
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
-
- Subject Matter Expert
- Posts: 26
- Joined: Mon Jun 28, 2021 10:37 am America/New_York
- Has thanked: 1 time
- Contact:
Re: Broken CMR query for downloading GEDI L4A data
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
https://github.com/ornldaac/gedi_tutorials/tree/main/scripts