- 积分
- 56367
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1

|
发表于 2018-4-24 18:02:56
|
显示全部楼层
 - # Add file
- fn = 'D:/Temp/hdf/CAL_LID_L2_VFM-Standard-V4-10.2017-06-09T18-19-56ZN.hdf'
- f = addfile(fn)
- # Read data
- vname = 'Feature_Classification_Flags'
- var = f[vname]
- data = var[:,:]
- lat = f['Latitude'][:,0]
- # Extract Feature Type only through bitmask.
- data = data & 7
- # Subset latitude values for the region of interest.
- lat = lat[1000:2000]
- size = lat.shape[0]
- data2d = data[1000:2000, 1165:] # -0.5km to 8.2km
- data3d = reshape(data2d, (size, 15, 290))
- data = data3d[:,0,:]
- # Generate altitude data according to file specification [1].
- alt = zeros(290)
- # -0.5km to 8.2km
- for i in range (0, 290):
- alt = -0.5 + i*0.03
- # Plot
- levs = arange(8)
- cols = [(255,255,255),(0,0,255),(51,255,255),(255,153,0),(255,255,0),(0,255,0),(127,127,127),(0,0,0)]
- ls = makesymbolspec('image', levels=levs, colors=cols)
- layer = imshow(rot90(data, 1)[:,::-1], symbolspec=ls, extent=[lat[-1],lat[0],alt[0],alt[-1]])
- colorbar(layer, ticklabels=['Invalid', 'Clear Air', 'Cloud', 'Aerosol', 'Strato Feature', 'Surface', 'Subsurface', 'No Signal'])
- basename = os.path.basename(fn)
- title([basename, 'Feature Type (Bits 1-3) in Feature Classification Flag'])
- xlabel('Latitude (degrees north)')
- ylabel('Altitude (km)')
- xaxis(tickin=False)
- yaxis(tickin=False)
|
|