下载esa卫星数据的python模块

esahub的Python项目详细描述


Build StatusPyPI version

esahub:从esa scihub下载数据

esahub为从欧洲哨兵任务下载卫星数据提供了一个简单的接口。

它允许从多个数据服务器并行执行多个下载。 支持各种哥白尼数据服务器,包括:

  • https://scihub.copernicus.eu/dhus
  • https://scihub.copernicus.eu/apihub
  • https://scihub.copernicus.eu/s3(来宾访问)
  • https://s5phub.copernicus.eu/dhus(来宾访问)
  • https://tmphub.copernicus.eu/dhus
  • https://colhub.copernicus.eu/dhus
  • https://colhub2.copernicus.eu/dhus

设置

安装esahub

$ pip install esahub
<>这也将通过复制{{CD11}}在^ {CD10>}中创建YAML配置文件(除非该文件存在)。~/.esahub.conf中的配置设置优先于config.yaml中的设置。

您应该覆盖~/.esahub.conf中所需的设置,特别是:

  • GENERAL.DATA_DIR

对于大多数数据服务器,您需要在SERVERS中提供自己的身份验证详细信息。

测试安装

运行测试的建议方法是:

$ python setup.py test

注意:运行测试可能需要一段时间,因为它包括从scihub实时下载的测试(尽管使用的文件非常小)。

命令行用法
$ esahub [cmd] [args] ...

可用命令:

CommandDescription
^{}Queries SciHub for archives matching the specified query parameters. Prints the total number of files and data size.
^{}Queries SciHub like ^{}, but then downloads the files.
^{}Checks local satellite products for consistency, either by validating the zip/NetCDF format or by comparing to the MD5 checksum from SciHub. Allows to either delete or repair broken files.

选项

OptionArgumentAvailable forDescription
^{}allSatellite to query, e.g. S1A, S1B, S2A, S2B, S3A
^{}, ^{}^{}allraw data directory (defaults to config ^{})
^{}, ^{}^{}^{}write files to JSON
^{}, ^{}^{}^{}read files from JSON
^{}, ^{}^{}^{}, ^{}e.g. ^{}, ^{}, ^{}
^{}, ^{}^{}^{}, ^{}geospatial location in WKT format
^{}^{}^{}, ^{}location as defined in config ^{}
^{}, ^{}^{}^{}, ^{}Supports a variety of datetime string formats.
^{}^{}^{}, ^{}e.g. ^{}
^{}^{}^{}, ^{}^{} or ^{}
^{}^{}^{}, ^{}product identifier, may include wildcards (^{}), e.g. ^{}
^{}, ^{}^{}^{}, ^{}custom query for SciHub, e.g. for single archive: ^{}
^{}^{}Force restart incomplete downloads
^{}allwrite log file
^{}allSuppress terminal output
^{}^{}^{}^{}
^{}^{}delete corrupt files
^{}^{}redownload corrupt files
^{}allsend email report
日期时间分析

以下是将自动分析为日期或日期范围的日期时间格式示例:

下列单一日期将显式转换为涵盖给定年份、月份或日期的日期范围:

  • --time 2016
  • --time 06/2018
  • --time 2018/06
  • --time "Sep 1, 2018"

日期范围也可以明确指定:

  • --time "2016 to 2017"
  • --time "Jan 2016 - Feb 2016"
  • --time "01/01/2016, 14/01/2016"

也可以使用单面日期范围:

  • --time "to 2017"
  • --time "01/2017-"
  • --time "01/12/2017,"

示例

ex 1.检索在过去午夜到午夜与爱尔兰相交期间上载到scihub的sentinel-3存档的数量和总文件大小(仅当配置项中定义了Ireland时才有效)

$ esahub ls -t yesterday --location=Ireland

ex 2.下载昨天上传的四个位置的存档。

$ esahub get -t yesterday --location=Ireland_Mace_Head --location=Namibia_Gobabeb --location=Italy_Rome_Tor_Vergata --location=France_La_Crau

ex 3.查询scihub以获取爱尔兰的所有可用sentinel-2数据,并将结果写入json文件。然后通过get命令读取该json文件,从而下载指定的文件。{EM1}$Note:由于JSON文件可以手动编辑,所以这种方法提供了最大的灵活性。

$ esahub ls --location=Ireland --mission=Sentinel-2 --out=Sen2_IE.json
$ esahub get --in=Sen2_IE.json --log

ex 4.检查自定义目录中的所有zip存档文件是否一致,并生成日志文件。

$ esahub doctor --dir=/path/to/dir/ --mode=md5 --log

python api

fromesahubimportscihubquery={'mission':'Sentinel-1','geo':'POINT(-9.0 53.0)','time':'today'}files=scihub.search(query)scihub.download(files)

依赖关系

必需

可选

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
内存Java正在运行。jar heapdump错误   java如何在安卓画布中弯曲文本区域?   java如何在Gdx 安卓游戏编程中获得矩形的真实触碰位置?   找不到java Spring MVC控制器   在Java中使用双重检查锁定单例扩展类   java在高效的时间和内存中动态执行insert(索引、数据)、delete(索引)、getAt(索引)操作。   java 安卓 Toast和视图帮助   java协议缓冲区:从文件中读取所有序列化消息   java如何在Jackson中为参数化接口类型执行通用自定义反序列化程序   与简单的空检查相比,使用(平面)映射的java优势是什么?   异步方法seam中的java Get contextparam   jar使用相同的java运行时运行另一个java程序   java访问Spring批处理中的作业参数   java给定字符串为空或null   在h2数据库1.4中找不到java类“org.h2.fulltext.FullTextLucene”。*不适用于Lucene Core 4*   java Spring Boot在使用@enableSync时不响应任何请求   java错误:在bash上找不到或加载主类pj2   “返回对象”和“返回(对象)”之间的Java差异   java Android开发:如何使用onKeyUp?