2

I tried downloading Sentinel-2B imagery from https://scihub.copernicus.eu/s2b with python urrlib2 but get HTTPError: Unauthorized on urllib2.open().

The same procedure works for https://scihub.copernicus.eu/dhus (where S2B is not available).

Does anyone have a working method for programmatically downloading S2B?

  • Have you logged in using s2bguest/s2bguest? – BERA Jul 10 '17 at 13:11
  • yes. scihub.copernicus.eu/s2b ... s2bguest//s2bguest – unnic Jul 10 '17 at 14:22
  • Using api.download_all(products) returns the complete tile, instead of the map.geojson area only. How do you downloadd only the map.geojson? – RemoteScientist Mar 11 at 19:49
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review – whyzar Mar 11 at 20:26
1

Since you also raised this question as an issue at the sentinelsat respository here is an example using sentinelsat.

from sentinelsat import SentinelAPI, read_geojson,geojson_to_wkt

api = SentinelAPI(user="s2bguest", password="s2bguest", api_url="https://scihub.copernicus.eu/s2b")
footprint = geojson_to_wkt(read_geojson('map.geojson'))
products = api.query(footprint, initial_date='NOW-10DAY')

Or once the data is merged into the Open Access Hub you can specifically query by platformserialidentifier:

api = SentinelAPI(user="username", password="password", api_url="https://scihub.copernicus.eu/dhus")
footprint = geojson_to_wkt(read_geojson('map.geojson'))
products = api.query(footprint, initial_date='NOW-10DAY', platformserialidentifier="Sentinel-2B")
  • i hab a typo in my own script and seeing your answer work made me look harder :) I got it now. thanks!! – unnic Jul 11 '17 at 11:15
0

You can also download S-2 products from AWS, which has better download speed than scihub.

Here is a python package that automatically downloads products into .SAFE format: https://github.com/sinergise/sentinelhub
It works for S2A and S2B products.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.