GithubHelp home page GithubHelp logo

johntruckenbrodt / esa_sentinel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonas-eberle/esa_sentinel

7.0 3.0 2.0 67 KB

ESA Sentinel Search & Download API

License: MIT License

Python 100.00%

esa_sentinel's Introduction

ESA Sentinel Search & Download API

With this API you can easily search and download scenes from the ESA Copernicus program using the ESA Sentinels Scientific Data Hub. It has been developed for data acquisition at Friedrich-Schiller-University Jena, Department for Earth Observation (www.eo.uni-jena.de) and is part of the EU-H2020 Satellite-based Wetland Observation Service (SWOS) project (www.swos-service.eu).

Installation

Needed Python libraries:

  • GDAL
  • Shapely
  • requests
  • progressbar

On Windows, using PIP you can install GDAL and Shapely with the whl packages from Gohlke: http://www.lfd.uci.edu/~gohlke/pythonlibs/

The API has been tested with Python2.7 under Unix and Windows 7.

Usage of API in Python

Please see example_s1.py, example_s1_setgeom.py, and example_s2.py with three examples.

To load features/geometries you can use either the "load_sites" method given a geospatial file or the "set_geometries" method to directly set a geometry in the Well-known-Text (Wkt) format.

Please note: Using the "set_geometries" method the projection has to be in Lat/Long, EPSG:4326.

The "search" method can be used with further parameters according to the OpenSearch protocol from the ESA Data Hub (see "productType" and "sensoroperationalmode" as an example below): https://scihub.copernicus.eu/twiki/do/view/SciHubUserGuide/3FullTextSearch#Search_Keywords

Example:

import sentinel_api as api

# use username and password for ESA DATA Hub authentication
username = '****YOUR_ESA_DATA_HUB_USERNAME****'
password = '****YOUR_ESA_DATA_HUB_PASSWORD****'

# please also specify the Hub URL:
# All Sentinel-1 and -2 scenes beginning from 15th Nov. 2015: https://scihub.copernicus.eu/apihub/
# All historic Sentinel-1 scenes: https://scihub.copernicus.eu/dhus/
s1 = api.SentinelDownloader(username, password, api_url='https://scihub.copernicus.eu/apihub/')

# set directory for
# - filter scenes list with existing files
# - set directory path for data download
s1.set_download_dir('./')

# load geometries from shapefile
s1.load_sites('wetlands_v8.shp')

# search for scenes with some restrictions (e.g., minimum overlap 1%)
s1.search('S1A*', min_overlap=0.01, start_date='2015-12-01', date_type='beginPosition', productType='GRD', sensoroperationalmode='IW')

# add another search query (e.g., for Sentinel-1B); both search results will be merged
s1.search('S1B*', min_overlap=0.01, start_date='2015-12-01', date_type='beginPosition', productType='GRD', sensoroperationalmode='IW')

# you can either write results to a bash file for wget or download files directly in this script
# s1.write_results('wget', 'sentinel_api_s1_download.sh')
s1.download_all()

Help

For now, please see the docstrings for each method within the code or within python

import sentinel_api as api
help(api)

esa_sentinel's People

Contributors

johntruckenbrodt avatar jonas-eberle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.