- 积分
- 306
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-10-30
- 最后登录
- 1970-1-1
|
发表于 2016-5-27 15:05:34
|
显示全部楼层
#Add data file
print 'Read data...'
fn = 'C:/SMAP/SMAP_L4_SM_gph_20151015T013000_Vb1010_001.h5'
f = addfile(fn)
lon = f['cell_lon'][:,:]
lat = f['cell_lat'][::-1,:]
vname = 'sm_surface'
v = f[vname]
data = v[::-1,:]
#Interpolate data to grid
print 'Interpolate data to grid...'
lon1 = linspace(lon.min(), lon.max(), lon.dimlen(1))
lat1 = linspace(lat.min(), lat.max(), lat.dimlen(0))
data1 = griddata((lon, lat), data, xi=(lon1, lat1), method='surface')[0]
#Plot
print 'Plot...'
axesm()
mlayer = shaperead('C:/MeteoInfo/map/country1.shp')
geoshow(mlayer)
layer = imshowm(lon1, lat1, data1, 20)
colorbar(layer)
title('{0}\n {1}'.format(fn, vname))
print 'Finish!'
出现下面的提示
run script...
Read data...
Interpolate data to grid...
Traceback (most recent call last):
File "<iostream>", line 14, in <module>
TypeError: 'NoneType' object is unsubscriptable
|
|