Demo entry 6354029

py

   

Submitted by anonymous on Apr 04, 2017 at 16:21
Language: Python. Code size: 904 Bytes.

#!/usr/bin/env python

from ecmwfapi import ECMWFDataServer

server = ECMWFDataServer()
  
data="2013"#年份,当然你也可以设置成一个数组年。
var=['hgt','u','v'] #变量名,从左到右分别为位势高度,纬向风,经向风

for i in range(len(var)):

   server.retrieve({
          'dataset' : "interim",   #下载数据的类型
          'step'    : "0",
          #'number'  : "all",
          'levtype' : "pl",        #下载数据的层次
          'date'    : data+"0101"+"/to/"+data+"1231",  #下载数据的起止年月日
          'time'    : "00/06/12/18",  #一天四个层次
          #'origin'  : "all",
          #'type'    : "pf",
          'param'   : var[i],    #变量名称
          'levelist': "1000/850/500/200",   #等压面层次,分别为1000hPa,850hPa,500hPa,200hPa
          'area'    : "75/0/40/160",     # 纬度,经度范围
          'grid'    : "2/2",             #空间分辨率
          'format'  :'netcdf',         #输出数据格式
          'target'  : "D:/era_down/u/u.day."+data[idata]+".nc"
          })

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).