日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python导入哨兵数据_Python 下载哨兵Sentinel数据(Sentinel-1~3)

發布時間:2025/4/5 python 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python导入哨兵数据_Python 下载哨兵Sentinel数据(Sentinel-1~3) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

哨兵數據目前應用廣泛,空間分辨、光譜分辨率都比較高。目前數據下載部分包括官網和Python程序下載。

其中哨兵1和2數據下載網上已經有非常詳細的記錄,鏈接如下:Python中使用sentinelsat包自動下載Sentinel系列數據_lidahuilidahui的博客-CSDN博客?blog.csdn.net

我對python代碼進行了些微調整,用起來更方便一些。這里面主要還是需要安裝庫文件sentinelsat

pip install sentinelsat

哨兵1和2數據下載具體代碼如下:

def download_sentinel_data(user_name,password,website,foot_print,start_date,end_date,platformname,producttype,max_cloud):

api = SentinelAPI(user_name,password,website)

footprint = geojson_to_wkt(read_geojson(foot_print))

products = api.query(footprint,

date=(start_date, end_date),

platformname=platformname,

producttype =producttype,

cloudcoverpercentage = (0, max_cloud))

print(len(products))

for product in products:

product_info = api.get_product_odata(product)

# print(product_info)

print(product_info['title'])

api.download(product)

這是我隨便設定的數據時間,檢索的數據結果,這數據還是太大,不過在我這下載速度還挺快的,結果如下:

但是該程序在下載哨兵3會報錯,原因是數據文件的詳細信息有所不同,導致你在提取文件信息的時候會有偏差,因此,我重新修訂了哨兵3數據的下載方式。

庫文件都是一樣的,同樣的還是需要制作足跡文件:以'Changjiang_map.geojson’為例

產品類型本次選擇‘OL_2_LRR___’,這個根據需要自行更改。

具體代碼如下:

from sentinelsat.sentinel import SentinelAPI, read_geojson, geojson_to_wkt

import logging

import os, sys

def download_sentinel_data(user_name,password,website,foot_print,start_date,end_date,platformname,producttype,max_cloud):

api = SentinelAPI(user_name,password,website)

footprint = geojson_to_wkt(read_geojson(foot_print))

products = api.query(footprint, date=(start_date,end_date),platformname = platformname,cloudcoverpercentage = max_cloud,producttype= producttype)

print("PRODUCT SIZE: "+ str(api.get_products_size(products)))

fp=api.to_geojson(products)

# print(fp)

for entry in fp["features"]:

product_id= entry["properties"]["id"]

print (entry["properties"]["identifier"])

print (entry["properties"]["id"])

print (entry["properties"]["beginposition"])

api.download(product_id)

sys.exit()

if __name__ == '__main__':

user_name = ''

password = ''

website = 'https://scihub.copernicus.eu/apihub/'

foot_print = ''

start_date = '20190122'

end_date = '20200124'

platformname = 'Sentinel-3'

producttype = 'OL_2_LRR___'

max_cloud = 60

download_sentinel_data(user_name,password,website,foot_print,start_date,end_date,platformname,producttype,max_cloud)

數據檢索結果如下,本次只是示例,我只下載一個數據文件,不過下載速度嗖嗖的:

本次只是一個示例,證明了Python下載哨兵3數據的可能,我并沒有比對過檢索數據量的正確與否,感興趣的可以自行嘗試。

歡迎交流,祝好!

2020.11.23 于廈門

總結

以上是生活随笔為你收集整理的python导入哨兵数据_Python 下载哨兵Sentinel数据(Sentinel-1~3)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。