标签:
TRMM 2A12 HDF数据是卫星观测的SWATH数据(轨道数据),比格点数据处理起来要麻烦一些。数据的经纬度保存在geolocation变量中,需要先将经纬度数据读出来(均为2维数组),然后读取云水含量数据(cldWater)。虽然都是2维数组,但并不是格点数据,相当于2维的散点数据,点数相当多(3019*208)如果用散点图来绘制的话会非常的慢,需要将其插值为格点数据。插值方法建议选择nearest,该方法速度最快。插值后的格点数据用imshowm函数显示为图像就很快了。
脚本程序:
#Add data file folder = ‘D:/Temp/hdf/‘ fns = ‘2A12_090711_66394_6.HDF‘ fn = folder + fns f = addfile(fn) #Get data variable geo = f[‘geolocation‘] lat = geo[:,:,0] lon = geo[:,:,1] water = f[‘cldWater‘][:,:,9] water = water / 1000 #Interpolate to grid data gwater, x_g, y_g = griddata((lon, lat), water, method=‘neareast‘) #Plot axesm() mlayer = shaperead(‘D:/Temp/map/country1.shp‘) geoshow(mlayer) levs = arange(0, 10, 0.5) layer = imshowm(x_g, y_g, gwater, levs) colorbar(layer, orientation=‘horizontal‘) title(fns + ‘ (cldWater level=9)‘) axism([-180, 180, -90, 90])
MeteoInfoLab脚本示例:TRMM 2A12 HDF数据
标签:
原文地址:http://www.cnblogs.com/yaqiang/p/4622831.html