项目作者: fpl

项目描述 :
Copernicus Sentinel Science Hub rolling archive downloader
高级语言: Python
项目地址: git://github.com/fpl/scihub.git
创建时间: 2015-02-27T10:45:46Z
项目社区:https://github.com/fpl/scihub

开源协议:GNU General Public License v3.0

下载


Copernicus Open Data Hub rolling archive downloader

UPDATE: This code is maintained only for historical reasons. It is based on the Copernicus Open Data Hub which will
be decommissioned starting from October 2023.
If you are interested in using the new Copernicus Data Space Ecosystem,
I wrote a similar Perl code that uses the new APIs and is actively developed.
It is maintained as part of my SM-Tools and available
here


This is an easy script to download Sentinel data from the COPERNICUS rolling archive
located at the Copernicus Open Data (formerly Scientific Data) Hub at
https://scihub.copernicus.eu/

The archive can be queried by a custom web service API documented at
https://scihub.copernicus.eu/userguide/5APIsAndBatchScripting
and this script adopts it to do a better job of downloading periodically
and storing images. The API is based on OpenData http://www.odata.org/
and OpenSearch http://www.opensearch.org/

Instead of reinventing the wheel, the current version of this script
uses the Python API provided by the sentinelsat package to query the archive
and download images. This script has some useful features that can
be useful for regular (batch) downloads and are not currently available
in sentinelsat per se. Specifically:

  • a local Spatialite database is used to know if images already have
    been downloaded or not, and to store a set of geospatial metadata
    to query the archive with ordinary OGC SQL ST functions.
  • it creates useful KML add-on files filled with information taken from imagery metadata
  • a simple YAML file format can be used to improve and customize
    the script configuration
  • Files are downloaded in subtrees in order to avoid giant directories when
    large spatial and time series are downloaded.
  • All management and download operations can be run separately
  • data downloads can be checked and restarted on failure
  • it supports Copernicus mirrors, thanks to @realm convention in authentication
  • it supports continuous download or can be used via cron
  • it is free software and can be extended easily for better purposes
  • it is currently used in production, and it works!

Currently, the main use case of this script is the periodic downloading
of images on one or more areas (sites), typically by means of a
crontab/timer job.

What follows is an example of the configuration YAML file used by this script:

  1. ---
  2. all:
  3. platform: S-1
  4. type: GRD
  5. direction: Any
  6. items:
  7. - aoi:
  8. polygon: POLYGON ((144.26 -32.81,147.86 -32.81,147.86 -35.998,144.26 -35.998,144.26 -32.81))
  9. directory: /tmp/data/Sentinel-1_archive/Yanco_archive
  10. - aoi:
  11. polygon: POLYGON ((-100.55 50.67,-96.35 50.67,-96.35 47.762,-100.55 47.762,-100.55 50.67))
  12. directory: /tmp/data/Sentinel-1_archive/ElmCreek_archive
  13. - aoi:
  14. polygon: POLYGON ((-100.79 36.12,-97.582 36.12,-97.582 34.052,-100.79 34.052,-100.79 36.12))
  15. directory: /tmp/data/Sentinel-1_archive/LittleWashita_archive
  16. - aoi:
  17. polygon: POLYGON ((20.53 54.95,25.158 54.95,25.158 51.942,20.53 51.942,20.53 54.95))
  18. directory: /tmp/data/Sentinel-1_archive/Poland_archive
  19. - aoi:
  20. polygon: POLYGON ((8.15446235928205 57.6797621069406,10.7701315198645 57.672559958462,10.7663436347965 53.719444453071,7.71 53.9916504060973,8.15446235928205 57.6797621069406))
  21. directory: /tmp/data/Sentinel-1_archive/Hobe_archive
  22. - aoi:
  23. polygon: POLYGON ((-99.77 31.62,-96.662 31.62,-96.662 29.4,-99.77 29.4,-99.77 31.62))
  24. directory: /tmp/data/Sentinel-1_archive/TxSON_archive
  25. - aoi:
  26. polygon: POLYGON ((5.9532 52.0676,7.048 52.032,6.9952 49.948,5.9 49.9304,5.9532 52.0676))
  27. directory: /tmp/data/SARSENSE_S1/Germany
  28. - aoi:
  29. polygon: POLYGON ((7.679771707123388 45.488568380045756,13.466264982898075 46.723232221305132,36.010241064894799 37.582947071503241,36.314421645072912 32.184725616868526,31.963195382196588 29.687765362998697,18.909516593567609 29.41959521817747,9.110692096066586 33.050217585529545,8.699552606660951 35.428401418400881,-5.793114394887761 34.502145739241485,-9.709678262248175 38.23185231330713,-8.818961263123319 43.620276606196732,7.679771707123388 45.488568380045756))
  30. direction: ascending
  31. directory: /tmp/Mediterraneo

This file should be stored as /usr/local/etc/scihub.yml, while $HOME/.scihub.yml
should contain the user’s credentials, such as:

  1. username: foo@apihub.esa.int
  2. password: mysupersecretpasswd

Both configuration files can be modified by command line parameters.