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

Sentinel-2: add support for files downloaded from USGS EarthExplorer #754

Merged
merged 7 commits into from
Sep 5, 2022

Conversation

adamjstewart
Copy link
Collaborator

@adamjstewart adamjstewart commented Sep 3, 2022

Closes #505 @tinkueg

Depending on whether you download Sentinel-2 imagery from USGS EarthExplorer or Copernicus Open Access Hub, the filenames are slightly different. This PR fixes several issues:

  • Adds support for Sentinel-2 imagery downloaded from USGS EarthExplorer
  • Prevent dataset from loading bands at different resolutions
  • Support loading even when band B02 is not present

Note that this approach does not allow one to load bands unless they are present at the specified resolution. For example, in the files that I downloaded, band B01 is only available at 20m and 60m resolutions, not 10m.

@adamjstewart adamjstewart added this to the 0.3.1 milestone Sep 3, 2022
@github-actions github-actions bot added datasets Geospatial or benchmark datasets testing Continuous integration testing labels Sep 3, 2022
@adamjstewart adamjstewart marked this pull request as draft September 3, 2022 19:51
@adamjstewart adamjstewart marked this pull request as ready for review September 3, 2022 21:44
@calebrob6
Copy link
Member

Is it the case that the Copernicus Open Access Hub 10m data also comes in 20m and 60m resolutions? (e.g. I see B02 in the 10m, 20m, and 60m folders)

@adamjstewart
Copy link
Collaborator Author

Yes, at least when I downloaded it a few months ago: #505 (comment)

@adamjstewart adamjstewart merged commit 30cbdad into main Sep 5, 2022
@adamjstewart adamjstewart deleted the fixes/sentinel branch September 5, 2022 19:18
adamjstewart added a commit that referenced this pull request Sep 5, 2022
…754)

* Sentinel-2: add support for files downloaded from USGS EarthExplorer

* Style fix

* Fix driver

* Properly close filehandles

* Sentinel is uint16, not int32

* Fix import order

* Use correct resolution for each image
yichiac pushed a commit to yichiac/torchgeo that referenced this pull request Apr 29, 2023
…icrosoft#754)

* Sentinel-2: add support for files downloaded from USGS EarthExplorer

* Style fix

* Fix driver

* Properly close filehandles

* Sentinel is uint16, not int32

* Fix import order

* Use correct resolution for each image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasets Geospatial or benchmark datasets testing Continuous integration testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sentinel2 data set not able to locate data file downloaded from https://scihub.copernicus.eu
2 participants