简介:本文介绍了一种基于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

9f52e54f10b910c670e4f10c37c7220d.png

Step 2. Search and check resultsproducts = 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:

e46b6983a2552b83087f2e7ddbd2853f.png

Reference:

转载本文请联系原作者获取授权,同时请注明本文来自江佳乐科学网博客。

链接地址:http://blog.sciencenet.cn/blog-3425264-1212209.html

上一篇:【Python】基于Python API批量下载Planet卫星数据

下一篇:如何查询SCI期刊JCR分区(附:2019年遥感类SCI期刊中科院和JCR分区情况)

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐