- 积分
- 5200
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-12-3
- 最后登录
- 1970-1-1
|
发表于 2017-10-24 17:18:14
|
显示全部楼层
哥哥好 我在java版本中运行了 提示报错
这个是脚本 提示报错行是标黑这一行
第一次接触这个软件
完全没有头绪
真的看了好多帖子
但还是不会改
请哥哥帮帮我
谢谢您
# Add file
folder = 'D:/Temp/hdf/'
fns = 'CAL_LID_L1-ValStage1-V3-40.2016-12-06T05-47-20ZD.hdf'
fn = folder + fns
# Read data
f = addfile(fn)
vname = 'Total_Attenuated_Backscatter_532'
var = f[vname]
data = var[:1000,:]
data = rot90(data)
lats = f['latitude'][:1000,0]
latstrs = []
for lat in lats:
latstrs.append('%.1f' % lat)
height = f['metadata'][None]
m = height.findMember('Lidar_Data_Altitudes')
h = array(height.getArray(0, m))
h = h[::-1]
hstrs = []
for hh in h:
hstrs.append('%.1f' % hh)
# Plot
levs = [0.0001,0.0002,0.0003,0.0004,0.0005,0.0006,0.0007,0.0008,0.0009,\
0.001,0.0015,0.002,0.0025,0.003,0.0035,0.004,0.0045,0.005,0.0055,0.006,\
0.0065,0.007,0.0075,0.008,0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,01]
layer = imshow(data, levs, cmap='MPL_terrain')
xticks(data.dimvalue(1), latstrs)
yticks(data.dimvalue(0), hstrs)
xlabel('Latitude')
ylabel('Altitude (km)')
colorbar(layer, label=r'$\rm{km}^{-1}$ \rm{sr}$^{-1}')
basename = os.path.basename(fn)
title('{0}\n{1}'.format(basename, vname))
这个是报错的
latitude is not a variable name
Traceback (most recent call last):
File "<iostream>", line 11, in <module>
File "D:\Temp\hdf\MeteoInfo_1.4.6R14\MeteoInfo\pylib\mipylib\dataset\dimdatafile.py", line 45, in __getitem__
raise ValueError()
ValueError
这个是看了帖子后运行的
>>> data.dims
[Name: fakeDim41
Min value: 104.0
Max value: 105.0
Size: 2
Delta: 1.0, Name: fakeDim40
Min value: 28.0
Max value: 29.0
Size: 2
Delta: 1.0]
我真的不会改 尝试很多次都改不出来
我就是想横坐标显示 28° 到 29°
竖坐标 显示 0到5km高度
应该怎么改啊
您教教我
拜托您了
|
|