- 积分
- 55960
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
GRIB数据转为MICAPS第四类数据的示例script程序:
import clr
clr.AddReferenceByPartialName("System")
clr.AddReferenceByPartialName("System.Windows.Forms")
from System import *
from System.Windows.Forms import *
clr.AddReference("MeteoInfoC.dll")
from MeteoInfoC import *
from MeteoInfoC.Data import *
myApp = MIApp()
outpath = "E:\\Temp\\grib\\"
gribFile = outpath + "gmf.639.2011010112006.grb1"
myApp.OpenGRIBData(gribFile)
print gribFile
varName = "hgt"
tNum = myApp.GetTimeNumber()
print str(tNum)
lNum = myApp.GetLevelNumber(varName)
for t in range(0, tNum):
myApp.TimeIndex = t
for l in range(0, lNum):
myApp.LevelIndex = l
gData = myApp.GetGridData(varName)
aTime = myApp.GetTime(t)
print aTime.ToString("yyyyMMdd HH:mm")
m4File = outpath + varName + "_" + str(l)+ "_" + aTime.ToString("yyyyMMddHH") + ".dat"
print m4File
gData.SaveAsMICAPS4File(m4File, varName + "_" + str(l), aTime, 0, l, 1, 0)
|
|