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

URIs for S2-l2A JP2Ks Incorrect #33

Open
duncankinnear-selectcarbon opened this issue Mar 21, 2024 · 2 comments
Open

URIs for S2-l2A JP2Ks Incorrect #33

duncankinnear-selectcarbon opened this issue Mar 21, 2024 · 2 comments

Comments

@duncankinnear-selectcarbon
Copy link

duncankinnear-selectcarbon commented Mar 21, 2024

When trying to access to L2A .jp2 assets, i'm receiving this error:
CPLE_AWSObjectNotFoundError: The specified key does not exist.

I believe the URIs associated with those assets are incorrect i.e.:
s3://sentinel-s2-l2a/tiles/51/U/YS/2024/3/21/0/B03.jp2
instead of:
s3://sentinel-s2-l2a/tiles/51/U/YS/2024/3/21/0/R20m/B03.jp2

I'm working around this by updating the href of each item and asset, similar to this issue.

Example:

for i in range(len(items)):
   for a in items[i].assets:
      if items[i].assets[a].href.endswith(".jp2"):
        band_name = items[i].assets[a].href.split("/")[-1]
        items[i].assets[a].href = items[i].assets[a].href.replace(band_name, 'R20m/'+band_name)
@matthewhanson
Copy link
Member

hello @duncankinnear-selectcarbon,

There does seem to be a problem with the URLs here, and at this point we will not be fixing that older collection of JP2K (review the README and mailing list archive links in this repo if you haven't already).

Is there a specific reason why you are using the JP2K files over the COG versions in the sentinel-2-c1-l2a collection in the Earth Search API?

@duncankinnear-selectcarbon
Copy link
Author

Hi @matthewhanson ,

Thanks so much for your reply, and apologies I never got back to you until now.

The reason I was using the JP2K files was to be totally consistent with previous work where images have been downloaded manually. We wanted to avoid any potential discrepancies in DN between timesteps. But I think I'm right in saying there is basically no difference so my workflows are now using the COGs which are working great.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants