利用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,文件内容样例如下:
{
"url"
:
"<a href="https://api.ecmwf.int/v1" "="" style="border-radius: 0px; background: 0px center; border: 0px; bottom: auto; float: none; height: auto; left: auto; line-height: 20px; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto; box-sizing: content-box; min-height: inherit; color: rgb(0, 51, 102) !important;">https://api.ecmwf.int/v1"
,
"key"
:
"XXXXXXXXXXXXXXXXXXXXXX"
,
"email"
:
"john.smith@example.com"
}
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 ECMWFDataServerserver = 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数据相关推荐
- 利用python下载fnl数据方法
(1)下载python,网上下载方法很多,此处不再赘述,记得下载和电脑系统版本匹配的就好: (2)去ncar官网注册 https://rda.ucar.edu/ 先进行注册,需要注意的是注册最好用教育 ...
- python获取股票逐笔交易数据_利用python下载股票交易数据
前段时间玩Python时无意看到了获取股票交易数据的tushare模块,由于自己对股票交易挺有兴趣,加上现在又在做数据挖掘工作,故想先将股票数据下载到数据库中,以便日后分析: # 导入需要用到的模块 ...
- python 做交易软件下载_利用python下载股票交易数据
原博文 2017-02-06 22:45 − 前段时间玩Python时无意看到了获取股票交易数据的tushare模块,由于自己对股票交易挺有兴趣,加上现在又在做数据挖掘工作,故想先将股票数据下载到数据 ...
- 如何用python下载股票交易数据
转 如何利用python下载股票交易数据 前段时间玩Python时无意看到了获取股票交易数据的tushare模块,由于自己对股票交易挺有兴趣,加上现在又在做数据挖掘工作,故想先将股票数据下载到数据库中 ...
- 利用Python调用ECMWF欧洲中心API批量下载数据
前段时间由于需要下载ECMWF(欧洲中期天气预报中心)的再分析数据,学习了如何利用Python调用ECMWF欧洲中心API进行批量下载.这种下载ECMWF数据的方法在官网上有非常详细的介绍.我只是对这 ...
- python能处理nc文件吗_利用python如何处理nc数据详解
前言 这两天帮一个朋友处理了些 nc 数据,本以为很简单的事情,没想到里面涉及到了很多的细节和坑,无论是"知难行易"还是"知易行难"都不能充分的说明问题,还是& ...
- python处理nc数据_利用python如何处理nc数据详解
利用python如何处理nc数据详解 来源:中文源码网 浏览: 次 日期:2018年9月2日 [下载文档: 利用python如何处理nc数据详解.txt ] (友情提示:右键点上行txt ...
- 批量下载ECMWF数据的正确姿势
前言 之所以要写这篇文章,是因为我发现网上这方面的教程比较重复并且有一些大家很关系的问题都没有给出解答.因此我希望自己写一篇指导文章,帮助那些想要批量下载ECMWF数据的小伙伴跳过各种坑,能用正确的姿 ...
- python怎么读取sav格式_利用Python读取外部数据文件
利用Python读取外部数据文件 [color=rgb(0, 0, 0) !important]刘顺祥 [color=rgb(0, 0, 0) !important]摘要: 不论是数据分析,数据可视化 ...
最新文章
- Visual Web Development 2005开发ASP.NET使用小技巧
- 通过Soul看微内核架构(二)
- 可能是堆被损坏,这也说明 XX.exe 中或它所加载的任何 DLL 中有 bug
- 【Spark Summit EU 2016】在在线学习中使用Structured Streaming流数据处理引擎
- 'umi' 不是内部或外部命令,也不是可运行的程序 或批处理文件或umi: command not found
- opencv获取模板旋转角度_OpenCV入门之获取图像的旋转角度
- springboot 创建地址_使用 SpringBoot Admin监控Spring Boot 服务
- jsp网页上实现计算圆面积小程序
- JAVA代码实现hive连接mysql_Java采用JDBC的方式连接Hive(SparkSQL)
- drools规则引擎中易混淆语法分析_相互触发导致死循环分析
- 步长条件梯度下降算法步长和收敛条件的设置的一些看法
- 黑马程序员C++学习笔记(第二阶段核心:面向对象)(一)
- 堆排序(java实现)
- ntko web firefox跨浏览器插件_Web浏览器如何使用进程和线程
- 千万流量大型分布式系统架构设计实战(干货)
- 键盘连接计算机接口,终于明白电脑如何连接键盘
- 知识图谱(Knowledge Graph, KG)(王昊奋老师-课程学习笔记)
- 《SpringCloud Alibaba 微服务架构》专题(二十三)-Seat工作原理
- OpenGL ES EGL eglCreateContext
- Ubuntu 16.04+ROS+ORB-SLAM2配置以及相关问题