- 积分
- 55941
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2016-1-4 13:03:07
|
显示全部楼层
针对你的数据修改脚本如下:
- # Add file
- f = addfile('D:/Temp/hdf/2015216230303_49308_CS_2B-GEOPROF_GRANULE_P_R04_E06.hdf')
- # Read data
- vname = 'Radar_Reflectivity'
- v_data = f[vname]
- data = v_data[:,:]
- v_height = f['Height']
- height = v_height[0,:]
- time = f['Profile_time'][:]
- lon = f['Longitude'][:]
- lat = f['Latitude'][:]
- # Read attributes
- long_name = f.attrvalue('2B-GEOPROF_Swath_Attributes_Radar_Reflectivity\.long_name')[0]
- scale_factor = f.attrvalue('2B-GEOPROF_Swath_Attributes_Radar_Reflectivity\.factor')[0]
- valid_min = f.attrvalue('2B-GEOPROF_Swath_Attributes_Radar_Reflectivity\.valid_range')[0]
- valid_max = 5000
- fill_value = v_data.attrvalue('_FillValue')[0]
- units = f.attrvalue('2B-GEOPROF_Swath_Attributes_Radar_Reflectivity\.units')[0]
- units_h = f.attrvalue('2B-GEOPROF_Swath_Attributes_Height\.units')[0]
- # Apply scale factor
- valid_max = valid_max / scale_factor
- valid_min = valid_min / scale_factor
- fill_value = fill_value / scale_factor
- data = data / scale_factor
- data[data>valid_max] = nan
- data[data<valid_min] = nan
- #data[data==fill_value] = nan
- data = transpose(data)
- data = data[::-1,:]
- # Make a split window plot
- subplot(2, 1, 1)
- # Contour the data
- levs = arange(-38, 50, 2)
- layer = imshow(time, height[::-1], data, levs)
- colorbar(layer)
- title('Radar Reflectivity Factor')
- xlabel('Seconds since the start of the granule. (seconds)')
- ylabel('Height (m)')
- # The 2nd plot is the trajectory
- subplot(2, 1, 2)
- axesm()
- lworld = shaperead('D:/Temp/map/country1.shp')
- geoshow(lworld, edgecolor='k')
- plotm(lon, lat, '-b', linewidth=4)
- #scatterm(lon, lat, lon, size=4, edge=False, facecolor='b')
- scatterm(lon[0], lat[0], size=6, facecolor='r')
- xlim(-180, 180)
- ylim(-90, 90)
- title('Trajectory of Flight Path (starting point in red)')
|
|