利用python下载ECMWF数据
1.注册ECMWF数据下载账号;
2.下载 ECMWF web-API client version in python,下载网址为https://software.ecmwf.int/wiki/display/WEBAPI/Web-API+Downloads,然后pip install 下载的包即可
3.登录账号获取下载数据的key,网址https://api.ecmwf.int/v1/key/,然后将获取的信息保存成名为.ecmwfapirc文件,windows放置在 C:\Users\<USERNAME>\.ecmwfapirc,文件内容样例如下:
4.修改需要下载数据的pytho程序样例。重点修改下载的时间,变量(变量编号或变量名),垂直层以及覆盖的区域。ECMWF网站上有关说明:https://softwarepythonchen.ecmwf.int/wiki/display/WEBAPI/Accessing+ECMWF+data+servers+in+batch
5.所附程序为下载ECMWF interim气压层的数据
#!/usr/bin/python
#-*-coding: UTF-8 -*-
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
# This script downloads ERA-Interim forecasts, on pressure levels.
# Adapt the script to your requirements.
# The data volume for all pressure level data is about 5GB per day, and all pressure level data for more than a single day will exceed the WebAPI limit of 600.000 fields. Thus please restrict the download to what you really need.
# It is likely you need to split your request, this is best done by time periods, ie. first download for month 1, then for month 2, etc.
year=['2012','2013','2014','2015','2016','2017']
month=['05','06','07','08','09']
day=['31','30','31','31','30']
for i in year[0:6]:
k=0
for j in month[0:5]:
print i+'-'+j+'-01/to/'+i+'-'+j+'-'+day[k]
server.retrieve({
# Specify the ERA-Interim data archive. Don't change.
"class": "ei",
"dataset": "interim",
"expver": "1",
"stream": "oper",
# pressure levels (levtype:pl), all available levels (levelist)
"levtype": "pl",
"levelist": "100/200/225/250/300/350/400/450/500/550/600/650/700/750/775/800/825/850/875/900/925/950/975/1000",
# forecast (type:fc), from both daily forecast runs (time) with all available forecast steps (step, in hours)
"type": "an",
"time": "00/06/12/18",
"step": "0",
# all available parameters, for codes see http://apps.ecmwf.int/codes/grib/param-db
"param": "60.128/129.128/130.128/131.128/132.128/133.128/135.128/138.128/155.128/157.128",
# two days worth of data
"date": i+'-'+j+'-01/to/'+i+'-'+j+'-'+day[k],
# in 0.75 degrees lat/lon
"grid": "0.75/0.75",
# optionally restrict area to Europe (in N/W/S/E).
#"area": "75/-20/10/60",
# Optionally get output in NetCDF format. However, for NetCDF timestamps (time+step) must not overlap, so use e.g. "time":"00:00:00/12:00:00","step":"12"
"format" : "netcdf",
# set an output file name
"target": "E:\\ERA-Interim\\"+i+"-"+j+"-01to"+i+"-"+j+"-"+day[k]+"-pl.nc"
})
k = k + 1
print "Download finished"
- 利用Python调用ECMWF欧洲中心API批量下载数据
- python 利用requests模块会话session模拟登录URL网址下载数据
- python调用ECMWF欧洲中心api下载数据
- Selenium遇到的问题8 python利用xlwt模块操作xls数据显示IO错误(Python中正反斜杠的用法)
- 利用python做数据分析 札记(二)
- 全球 全世界/全国土地利用数据 连续20年多时相 数据下载
- 利用python从www.yousheng8.com批量下载小说
- 【利用Python进行数据分析——经验篇2】计算微博转发/评论/点赞h指数的Python代码
- [Python爬虫] 之十九:Selenium +phantomjs 利用 pyquery抓取超级TV网数据
- 利用python进行数据分析之绘图和可视化
- 重要的Python库(利用Python进行数据分析笔记)
- 利用python往oracle写数据
- 利用python进行微信好友数据分析
- [Python爬虫] 之二十四:Selenium +phantomjs 利用 pyquery抓取中广互联网数据
- 利用Python进行数据分析(4) NumPy基础: ndarray简单介绍
- 利用N-Gram模型概括数据(Python描述)
- python3 网络爬虫(三)利用post请求获取网页的动态加载数据
- 利用python进行数据分析(六):绘图和可视化
- 利用Python进行数据分析笔记(一