参考官网的教程
1、安装包ecmwf-api-client
注意:之前装过另一个包ecmwfapi,在下载数据是报错了,可能是旧的包有问题,这个是新的包
2、在家目录写入密钥文件
密钥的查看地址:https://api.ecmwf.int/v1/key/
写入文件$HOME/.ecmwfapirc
3、下载数据,以ERA-20C为例
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
server.retrieve({
"class": "e2",
"dataset": "era20c",
"date": "19000101/19000201/19000301/19000401/19000501/19000601/19000701/19000801/19000901/19001001/19001101/19001201",
"expver": "1",
"grid": "1/1",
"levtype": "sfc",
"param": "151.128",
"stream": "moda",
"type": "fc",
"target": "mslp.nc",
"format": "netcdf"
})
4、不同数据类型的说明
Analysis and forecast
An analysis, of the atmospheric conditions, is a blend of observations with a previous forecast. An analysis can only provide instantaneous parameters (parameters valid at a specific time, e.g temperature at 12:00), but not accumulated parameters, mean rates or min/max parameters.
A forecast starts with an analysis at a specific time (the ‘initialization time’), and a model computes the atmospheric conditions for a number of ‘forecast steps’, at increasing ‘validity times’, into the future. A forecast can provide instantaneous parameters, accumulated parameters, mean rates, and min/max parameters.
Synoptic monthly means and monthly means of daily means
For both analyses and forecasts, two sets of monthly means are available:
synoptic monthly means:
In the case of analyses, these are averages throughout the calendar month for each available synoptic hour, whereas in the case of forecasts (all issued daily from 06 UTC), they are averages throughout the calendar month for each available forecast step up to 24 hours.
monthly means of daily means:
In the case of analyses, these are averages throughout the calendar month across all the available synoptic hours, whereas in the case of forecasts (all issued daily from 06 UTC), they are averages throughout the calendar month across all the available forecast steps up to 24 hours, for instantaneous forecasts, or just for step=24 hours, for accumulated forecasts.