- 积分
- 2280
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-9-11
- 最后登录
- 1970-1-1
|
发表于 2017-1-20 16:45:11
|
显示全部楼层
王老师,多个文件加载成功,但是在进行涡度计算时报错,以前是可以的。另外DimArray也报错。代码如下。- # Set working directory
- trajDir = 'D:/Temp/HYSPLIT'
- meteoDir = r'D:\Temp\arl'
- # Open meteorological data file
- print 'Open meteorological data file...'
- fns = []
- meteofn1 = os.path.join(meteoDir, 'gdas1.jul09.w1')
- meteofn2 = os.path.join(meteoDir, 'gdas1.jul09.w2')
- meteofn3 = os.path.join(meteoDir, 'gdas1.jul09.w3')
- meteofn4 = os.path.join(meteoDir, 'gdas1.jul09.w4')
- meteofn5 = os.path.join(meteoDir, 'gdas1.jul09.w5')
- fns.append(meteofn1)
- fns.append(meteofn2)
- fns.append(meteofn3)
- fns.append(meteofn4)
- fns.append(meteofn5)
- meteof = addfiles(fns)
- #print 'Meteorological file: ' + meteof
- # Read data
- print 'Read data...'
- latlim = [10,60]
- lonlim = [60,140]
- rh = meteof['RELH'][:,:,latlim,lonlim]
- nx = rh.dimlen(3)
- ny = rh.dimlen(2)
- nz = rh.dimlen(1)
- nt = rh.dimlen(0)
- lat = rh.dimvalue(2)
- lev = rh.dimvalue(1)
- t0 = meteof['TEMP'][:,:nz-1,latlim,lonlim]
- uwnd = meteof['UWND'][:,:nz-1,latlim,lonlim]
- vwnd = meteof['VWND'][:,:nz-1,latlim,lonlim]
- #vort = hcurl(uwnd, vwnd)
- #divg = hdivg(uwnd, vwnd)
- prs = zeros([nt,nz,ny,nx])
- prs = DimArray(prs, rh.dims)
复制代码
错误码为1:(涡度)
Traceback (most recent call last):
File "<iostream>", line 33, in <module>
File "D:\MeteoInfo\pylib\mipylib\numeric\minum.py", line 1564, in hcurl
r = ArrayMath.hcurl(u.asarray(), v.asarray(), xdim.getDimValue(), ydim.getDimValue())
注释掉后错误码为2:(气压数组)
Traceback (most recent call last):
File "<iostream>", line 36, in <module>
NameError: name 'DimArray' is not defined |
|