Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLS data query returns incomplete results from 'https://cmr.earthdata.nasa.gov/stac/LPCLOUD/search?' #367

Open
ghobart opened this issue Oct 29, 2024 · 6 comments
Labels
JiraBug [Type] Bug Something isn't working

Comments

@ghobart
Copy link

ghobart commented Oct 29, 2024

This issue began on Sept 4, 2024 when changes were made to the system. I reported this issue through several other channels but it was suggested by USGS EROS User Services that I should post it here as well.

I had been making successful daily queries to the 'https://cmr.earthdata.nasa.gov/stac/LPCLOUD/search?' server since early May of 2024 with no issues. The query has not changed in that time, it is composed of a ten day window across 16 utm zones covering the forests of Canada. Prior to Sept 4th my query results were correct spanning the entire ten day window and the entire spatial query bounding box.

Since Sept.4 the server response has been incomplete. The results returned are from only the first day of the ten day temporal query window and only a small segment of the spatial ROI query. The Bounding box query covers UTM7N-UTM22N over Canada's forests but the query result only returns the eastern most zones (20N-22N).

These are the search parameters as passed to the python program SuPer.py from (https://git.earthdata.nasa.gov/projects/LPDUR/repos/hls-super-script/browse/HLS_SuPER.py)

-143.98107185188445,41.522765367128045,-51.013990919045625,71.19280431826473,e:\HLS_Production,2024-10-16T00:00:00Z/2024-10-26T23:59:59Z,{'HLSS30': 'HLSS30_2.0', 'HLSL30': 'HLSL30_2.0'},{'HLSS30': {'COASTAL-AEROSOL': 'B01', 'BLUE': 'B02', 'GREEN': 'B03', 'RED': 'B04', 'RED-EDGE1': 'B05', 'RED-EDGE2': 'B06', 'RED-EDGE3': 'B07', 'NIR-Broad': 'B08', 'NIR1': 'B8A', 'WATER-VAPOR': 'B09', 'CIRRUS': 'B10', 'SWIR1': 'B11', 'SWIR2': 'B12', 'FMASK': 'Fmask', 'VZA': 'VZA', 'VAA': 'VAA', 'SZA': 'SZA', 'SAA': 'SAA'}, 'HLSL30': {'COASTAL-AEROSOL': 'B01', 'BLUE': 'B02', 'GREEN': 'B03', 'RED': 'B04', 'NIR1': 'B05', 'SWIR1': 'B06', 'SWIR2': 'B07', 'CIRRUS': 'B09', 'TIR1': 'B10', 'TIR2': 'B11', 'FMASK': 'Fmask', 'VZA': 'VZA', 'VAA': 'VAA', 'SZA': 'SZA', 'SAA': 'SAA'}},70

@ghobart
Copy link
Author

ghobart commented Oct 29, 2024

BTW. I noticed that the python scripts have still not been updated on https://git.earthdata.nasa.gov/projects/LPDUR/repos/hls-super-script/browse/HLS_Su.py. The changes on Sept 4th completely broke this code as well.

I submitted the following detailed changes on Sept 5th to USGS Support, for the python scripts to get them running again although the server response is still incorrect. ( My workaround to the server query issue has been to run the query for a single day at a time for each of the 16 utm zones one at a time. Hence 160 queries instead of one query. Far from optimal. :(

Line 164 in HLS_SuPER.py should be
shortname = {'HLSS30': 'HLSS30_2.0', 'HLSL30': 'HLSL30_2.0'}
as per the description in the article. https://lpdaac.usgs.gov/news/important-update-to-cmr-stac-new-identifier-and-search-parameter-format/

IN HLS_Su.py
Line 49 There is no 'numberReturned' key anymore

while search_response['numberReturned'] != 0:
and Line 81
break
It make absolutely no sense to a have break statement at the end of a while loop with no condition so both the while and the break statements can be removed.
Solution : Comment out or delete both line 49 and 81.

Line 59
bandLinks.append(h['assets']['metadata']['href'])
There is no ‘metadata’ key anymore.
Solution : Comment out or delete line 59
*I don’t need the 'metadata' but maybe other people do???

I hope this helps other too.

@waltersdan
Copy link

To pile on, we do use the metadata asset (or we did, when it was there).

@ZZMitch
Copy link

ZZMitch commented Oct 30, 2024

@ghobart Not sure if these scripts are fixed, but there is a more recently updated HLS_SuPER on the HLS-Data-Resources GitHub.

https://github.com/nasa/HLS-Data-Resources/tree/main/python/scripts/HLS_SuPER

@aliciaaleman aliciaaleman added the [Type] Bug Something isn't working label Nov 1, 2024
@william-valencia
Copy link
Contributor

william-valencia commented Nov 20, 2024

@ghobart Are you still having issues with the HLS_SuPER script and CMR Stac? The CMR Stac call seems to work for me.

https://cmr.earthdata.nasa.gov/stac/LPCLOUD/search?bbox=-143.98107185188445,41.522765367128045,-51.013990919045625,71.19280431826473&datetime=2024-10-06T00:00:00Z/2024-10-26T23:59:59Z&collections=HLSL30_2.0,HLSS30_2.0

If you go through the next links, you will get the rest of the data.

@ghobart
Copy link
Author

ghobart commented Nov 21, 2024 via email

@william-valencia
Copy link
Contributor

@ghobart Thanks for your response. Would you be able to provide the underlying cmr-stac GET or POST request that is actually being called when you get the errors?

It would be a call to "https://cmr.earthdata.nasa.gov/stac/LPCLOUD/search" I would need the parameters as they are passed to the URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JiraBug [Type] Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants