下载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第三方库


热门话题
使用jaxb2annotateplugin和XJC工具的java自定义注释   java组织。xeustechnologies。jcl无法加载WstxInputFactory类   java JUnit在格式化字符串上比较失败   java Bukkit配置部分getKeys   如何关闭Java流?   java Struts2正则表达式配置   链式事务注释的java奇怪行为   java在两个JButton之间使用变量   java签署APK时内容会发生什么变化?   java LWJGL:Slick:3D世界中的绘图字体   如何分解Java数组?   在Java MySql中处理多个过滤器   java如何在Firebase数据库中跳过初始OnChildaded事件触发   java如何在PreviewView中使用CameraX?   在子类#中重写父类后访问父类原始方法的java已解决   java找不到类型的属性   游戏框架游戏!框架+Java