python使用sentinelsat库下载sentinel影像数据

GIS遥感不分家,最近开始找一些影像的下载脚本了,这两天搞定了哨兵和modis的,分别贴一下

鉴于《Python中使用sentinelsat包自动下载Sentinel系列数据》这篇文章已经写得非常全乎,这里就简单补充一下,放个最简单的下载脚本,方便拿来即用。

from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
from datetime import date

if __name__ == '__main__':
    # 用户名密码自己注册
    api = SentinelAPI('用户名', '密码', 'https://scihub.copernicus.eu/dhus')
    footprint = geojson_to_wkt(read_geojson('./QD.geojson'))
    products = api.query(footprint,
                         date=(date(2023, 1, 17), date(2023, 1, 18)),
                         platformname='Sentinel-2',
                         cloudcoverpercentage=(0, 30))
    api.download_all(products, "./dataDirect")

一些关键信息:

  • 用户注册地址
    https://scihub.copernicus.eu/dhus/#/self-registration

  • api.query第一个参数接收WKT(Well-Known Text)字符串,这里使用geojson文件转换,用来做空间筛选(默认是Intersects),geojson可以在
    http://geojson.io
    上自己画
    不想用geojson文件的,可以自己拼WKT

  • date参数限制查询日期,可以传字符串或datetime

  • 下面的参数就不是query api本身的了,是copernicus查询接口的参数。查询参数介绍见
    https://scihub.copernicus.eu/twiki/do/view/SciHubUserGuide/FullTextSearch?redirectedfrom=SciHubUserGuide.3FullTextSearch
    比如上边代码里的platformname
    在这里插入图片描述

  • api.download_all下载全部查询出来的数据,第二个参数是存储路径

其他sentinelsat相关操作,建议看官网,文档写的很好
在这里插入图片描述

参考
https://sentinelsat.readthedocs.io/en/stable/api_overview.html
https://blog.csdn.net/lidahuilidahui/article/details/90486402

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值