ornldaac / gedi_tutorials

GEDI L3 and L4 Tutorials
Other
113 stars 50 forks source link

Feed error #2

Closed ddy1912 closed 2 years ago

ddy1912 commented 2 years ago

I get an error as follows.


KeyError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_92/220220047.py in 41 granulesearch = cmrurl + 'granules.json' 42 response = requests.post(granulesearch, data=cmr_param, files=geojson) ---> 43 granules = response.json()['feed']['entry'] 44 45 if granules:

KeyError: 'feed'

rupesh2 commented 2 years ago

Hi @ddy1912 , can you share the parameters you were passing to the post request? If the area contains no GEDI orbits, it may return an empty response.

ddy1912 commented 2 years ago

Hi Rupesh, Thank you for quick response. The area is Turkey and there are many GEDI orbits actually. After writing you, I have tried the code from other tutorial of yours (https://github.com/ornldaac/gedi_tutorials/blob/main/1_gedi_l4a_search_download.ipynb) and changed the code from this :

@.***

To this:

@.***

And it seems like the code is working. I still does not understand the problem though. Another issue I would like to say is that after running the step 13 in (https://github.com/ornldaac/gedi_tutorials/blob/main/2_gedi_l4a_subsets.ipynb) the process takes forever (More than 20 hours so far and still going). Does this normal? Thank you very much for your help.

rupesh2 commented 2 years ago

@ddy1912 It's great that you got the search working. Step 13 might take time, depending on how many HDF files you are trying to subset. You can check outdir folder to see if the subset HDF files are being created correctly.

vsgriffey commented 2 years ago

@rupesh2 I saw another issue opened about feed but similarly do not understand why this error is occurring. So far I haven't gotten it to go away yet. I am working through1_gedi_l4a_search_download.ipynb and using my own geojson boundary file. I imported a vector of Colombia country boundaries and the first cell (cell 6) plotting it had no issues. However, I try to run the next cell and get the following KeyError Traceback (most recent call last) Input In [13], in <cell line: 23>() 29 granulesearch = cmrurl + 'granules.json' 30 response = requests.post(granulesearch, data=cmr_param, files=geojson) ---> 31 granules = response.json()['feed']['entry'] 33 if granules: 34 for g in granules:

KeyError: 'feed'

Let me know what further information you need that would be helpful. Thanks!

vsgriffey commented 2 years ago

Mine was due to too large of a shapefile which you can see from response.json()

rupesh2 commented 2 years ago

Hi @vsgriffey , I am sorry I missed your comments earlier. The CMR API has a 1000000 bytes limit for polygon files. You can reduce the number of vertices in the polygon as follows:

amapa = geopandas.read_file("polygons/amapa.json") 
amapa = amapa.simplify(0.0005) 

In the above, the tolerance (0.0005) is in degrees. You can use the tolerance in the same units as the coordinates in your geojson file. More info about simplify here.