- 积分
- 645
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-4-1
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2018-7-11 18:00:43
|
显示全部楼层
写了一个脚本,用于下载1988.1~1989.12的T和Td(温度和露点温度),范围34.5~40.5N,90~105S.
可以正常运行,如果需要的话,修改year1和year2(起始年和最后一年的推后一年)即可
脚本如下:
#!/usr/bin/env python
import calendar
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
year1=1988
year2=1990
for iyear in range(year1,year2):
for imonth in range(1,13):
startDate = '%04d-%02d-%02d' % (iyear, imonth, 1)
numberOfDays = calendar.monthrange(iyear, imonth)[1]
lastDate = '%04d-%02d-%02d' % (iyear, imonth, numberOfDays)
requestDates = (startDate + "/to/" + lastDate)
server.retrieve({
"class": "ei",
"dataset": "interim",
"date": requestDates,
"expver": "1",
"grid": "0.75/0.75",
"levtype": "sfc",
"param": "167.128/168.128",
"step": "0",
"stream": "oper",
"time": "00:00:00",
"type": "an",
"area": "40.5/90/34.5/105",
"format":"netcdf",
"target": "D:/era_down/TandTd."+str(iyear)+str(imonth)+".nc",
})
server.retrieve({
"class": "ei",
"dataset": "interim",
"date": requestDates,
"expver": "1",
"grid": "0.75/0.75",
"levtype": "sfc",
"param": "167.128/168.128",
"step": "3/6/9/12",
"stream": "oper",
"time": "00:00:00",
"type": "fc",
"area": "40.5/90/34.5/105",
"format":"netcdf",
"target": "D:/era_down/TandTd."+str(iyear)+str(imonth)+".nc",
})
脚本是参考官网上的那个MARS再根据需要对他进行修改。
但是我有个问题:
为什么有两段server.retrieve这样的程序?他们的差别仅在于type和step,表示的是什么呢? |
|