- 积分
 - 32
 
	- 贡献
 -  
 
	- 精华
 
	- 在线时间
 -  小时
 
	- 注册时间
 - 2015-11-5
 
	- 最后登录
 - 1970-1-1
 
 
 
 
 
 
 | 
	
 
 
发表于 2015-11-6 11:07:04
|
显示全部楼层
 
 
 
 本帖最后由 cheerland 于 2015-11-6 11:16 编辑  
 
王老师你好,我运行后出现错误,使用1.28版本,错误信息如下: 
>>> run script... 
Traceback (most recent call last): 
  File "<iostream>", line 4, in <module> 
  File "D:\MeteoInfo\pylib\mipylib\midata.py", line 514, in linspace 
    return MIArray(ArrayUtil.lineSpace(args[0], args[1], num, endpoint)) 
NameError: global name 'args' is not defined 
我修改后的代码如下: 
f = addfile('D:/MYD08_D3.A2015283.006.2015284214640.hdf') 
v_aod = f['Optical_Depth_Land_And_Ocean_Mean'] 
#Set x/y 
x = linspace(-180.0,180.0, 360) 
y = linspace(-90.0,90.0, 180) 
#Set x/y dimensions 
v_aod.setdim('Y', y) 
v_aod.setdim('X', x) 
#Get data 
aod = v_aod[[33,41],[113,122]] 
#aod = v_aod[:,:] 
#Plot 
axesm() 
china = shaperead('D:/workspace/2015/meteoinfo/bou2_4p.shp') 
geoshow(china, linecolor='gray') 
world = shaperead('D:/workspace/2015/meteoinfo/country1.shp') 
geoshow(world) 
levels = arange(0, 1.0, 0.02) 
layer = contourfm(aod, levels, interpolate=True) 
title('Aerosol Optical Depth at 550 nm') 
colorbar(layer) 
show() 
我使用的数据是: 
MYD08_D3.A2015283.006.2015284214640.hdf 
我打开hdf看了下,里面好像没有'Optical_Depth_Land_And_Ocean_Mean'这一项,现在改成了Deep_Blue_Aerosol_Optical_Depth_550_Land_Mean 
和Aerosol_Optical_Depth_Land_Ocean_Mean都试了一下,不行,错误相同。 
 
 |   
 
 
 
 |