Skip to main content

Utility to search and download Sentinel-1 Imagery

Project description

sentinelsat

https://badge.fury.io/py/sentinelsat.svg https://travis-ci.org/ibamacsr/sentinelsat.svg https://coveralls.io/repos/ibamacsr/sentinelsat/badge.svg?branch=master&service=github

Utility pack to search and download Sentinel imagery from ESA SciHub.

Installation

Sentinelsat depends on homura, which depends on PycURL, so you need to install some dependencies on your system.

Ubuntu

sudo apt-get install build-essential libcurl4-openssl-dev python-dev python-pip

Fedora

sudo yum groupinstall "Development Tools"
sudo yum install libcurl libcurl-devel python-devel python-pip

Windows

The easiest way to install pycurl is to use one of the pycurl wheels provided by Christoph Gohlke.

pip install pycurl.whl

Alternatively if you are using Conda you can do

conda install pycurl

Then install sentinelsat:

pip install sentinelsat

Usage

Sentinelsat provides a Python Library and a Command Line Interface to search and download Sentinel products.

Command Line Interface

Download

sentinel download [OPTIONS] <user> <password> <productid>

Download a single Sentinel Product. Provide your scihub username and password and the id of the product you want to download.

Options:

-p, --path PATH

Set the path where the file will be saved.

-c, --check

Verify the MD5 checksum and write corrupt product ids to a textfile.

-u, --url TEXT

Define another API URL. Default URL is ‘https://scihub.copernicus.eu/apihub/’.

Python Library

Connect to the API:

from sentinelsat.sentinel import SentinelAPI
api = SentinelAPI('user', 'password')

If you need to search or download data produced before November 16th, 2015, you must initialize SentinelAPI with the api_url parameter, setting it to use https://scihub.copernicus.eu/dhus.

api = SentinelAPI('user', 'password', 'https://scihub.copernicus.eu/dhus')

If you know the id of the product you want to download, you can download it by using:

api.download(<product_id>)

It is possible to hide the progress report, disable resume and auto_retry, and pass any other keyword argument understood by the underlying homura library, e.g.:

api.download(<product_id>, show_progress=False, max_rst_retries=2)

You can also use the id to get information about the product, including id, title, size, footprint and download url:

api.get_product_info(<product_id>)

You can search products by specifying the coordinates of the area and a date interval:

api.query('0 0,1 1,0 1,0 0', '20150531', '20150612')

You can query by using date or datetime objects too.

api.query('0 0,1 1,0 1,0 0', datetime(2015, 5, 31, 12, 5), date(2015, 6, 12))

If you don’t specify the start and end dates, it will query in the last 24 hours.

Beyond area and date parameters, you can use any search keywords accepted by the scihub API, for example:

api.query('0 0,1 1,0 1,0 0', producttype='SLC')

See the SciHub User Guide for all the Search Keywords.

To download all the results of your query, use:

api.download_all()

To get a geojson FeatureCollection containing the footprints and metadata for the search results of the query, use:

api.get_footprints()

The download from https://scihub.esa.int will fail if the server certificate cannot be verified because no default CA bundle is defined, as on Windows, or when the CA bundle is outdated. In most cases the easiest solution is to install or update certifi:

pip install -U certifi

You can also override the the path setting to the PEM file of the CA bundle using the pass_through_opts keyword argument when calling api.download() or api.download_all():

from pycurl import CAINFO
api.download_all(pass_through_opts={CAINFO: 'path/to/my/cacert.pem'})

Contributors

  • Wille Marcel

  • Kersten Clauss

  • Michele Citterio

License

GPLv3+

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sentinelsat-0.5.3.tar.gz (8.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sentinelsat-0.5.3-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

sentinelsat-0.5.3-py2-none-any.whl (12.8 kB view details)

Uploaded Python 2

File details

Details for the file sentinelsat-0.5.3.tar.gz.

File metadata

  • Download URL: sentinelsat-0.5.3.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sentinelsat-0.5.3.tar.gz
Algorithm Hash digest
SHA256 1b50e6b4f9a117686a1ab2b9fa428531afcfbe13bb860f0fad9869386177884a
MD5 f65bf908d2654ebe40ded2c20f48531a
BLAKE2b-256 1872d2a78052de90c5d463954b3bb3a312fbef73f1145b688852037896cc3335

See more details on using hashes here.

File details

Details for the file sentinelsat-0.5.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sentinelsat-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8d8a9f033b01e8dbfc44ff612402e07beec72fb889f1c6ee34626f5cce4a5f68
MD5 e6bcad1aab95d78bf3e8003e214d336e
BLAKE2b-256 86ea5efe5680608d6bb7b28438dfd7c0cf3074df7ae83ba83ca0afd4be55abc1

See more details on using hashes here.

File details

Details for the file sentinelsat-0.5.3-py2-none-any.whl.

File metadata

File hashes

Hashes for sentinelsat-0.5.3-py2-none-any.whl
Algorithm Hash digest
SHA256 294cfb41d8f070a6b34ca25bb825ec361b5f0bc278b1af6fcf119e2c319584c3
MD5 184b95c654a929e2380d240242254b11
BLAKE2b-256 2c28749402e978abe57743efef21ca02e50e88ce6628336b7ee8823a8bd79ea4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page