JialeJiang的个人博客分享 http://blog.sciencenet.cn/u/JialeJiang

博文

【Python】批量下载Sentinel-2卫星数据

已有 7352 次阅读 2019-12-31 14:38 |个人分类:经验分享|系统分类:科研笔记| Python, Sentinel, 批量下载

简介:本文介绍了一种基于Python批量下载Sentinel-2卫星数据的方法。通过该方法,用户可自定义感兴趣研究区(ROI)、限定时间范围、选择产品类别、进行云量筛选,实现自动化批量下载Sentinel-2卫星数据。


Requirements:


Useful link:


Installation:

pip install sentinelsat


Usage:

Step 1. Set up

from sentinelsat.sentinel import SentinelAPI, read_geojson, geojson_to_wkt
from collections import OrderedDict
# Connect to the API (edit your user_name and password)
api = SentinelAPI('USER_NAME', 'PASSWORD', 'https://scihub.copernicus.eu/dhus')
# Search by polygon, time, producttype and cloud cover
roi = 'POLYGON((DEFINE ROI))' # define your ROI from http://geojson.io/#map=2/20.0/0.0
start_date = 'YYYYMMDD'
end_date = 'YYYYMMDD'
product_type = 'S2MSI2A' # check product type: https://scihub.copernicus.eu/dhus/#/home
cloud_cover = [MIN,MAX] # percentage

  • Define ROI

点击进入 http://geojson.io/#map=2/20.0/0.0 ,自定义ROI,获取相应坐标信息。

image.png

Step 2. Search and check results

products = api.query(area=roi,date=(start_date, end_date),
                     producttype=product_type,cloudcoverpercentage=cloud_cover)
downfiles = OrderedDict()
for i in products:
    product = products[i]
    filename = product['filename']
    print(filename)

Step 3. Data download

# Download all results from the search
successfile = api.download_all(products)


Example:

image.png


Reference:




https://blog.sciencenet.cn/blog-3425264-1212209.html

上一篇:【Python】基于Python API批量下载Planet卫星数据
下一篇:如何查询SCI期刊JCR分区(附:2019年遥感类SCI期刊中科院和JCR分区情况)
收藏 IP: 109.171.137.*| 热度|

1 张鹰

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-26 09:10

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部