|||
简介:本文介绍了一种基于Python批量下载Sentinel-2卫星数据的方法。通过该方法,用户可自定义感兴趣研究区(ROI)、限定时间范围、选择产品类别、进行云量筛选,实现自动化批量下载Sentinel-2卫星数据。
Requirements:
Python packages: sentinelsat, collections
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,获取相应坐标信息。
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:
Reference:
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-20 09:39
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社