之前处理过这个,下面的脚本你可以参考。边界线的值应该是255,data[data==255] = nan可以将其设置为无效值。
- #Read data from file
- tt = datetime.datetime(2013,3,5,5)
- satellite = 'FY2E'
- if tt.year == 2016:
- satellite = 'FY2G'
- fn = 'C:/Temp/SDS_Asian/SDS_obs/iddi/' + tt.strftime('%Y') + \
- '/' + satellite + '_DST_MLT_OTG_' + tt.strftime('%Y%m%d_%H') + '00.AWX'
- f = addfile(fn)
- data = f['var'][:,:]
- data[data==255] = nan
- data[:80,:490] = nan #Left bottom legend
- data[665:,:230] = nan #Left top title
- if satellite == 'FY2G':
- lon = data.dimvalue(1)
- lon = lon - 20
- data.setdimvalue(1, lon)
- #Plot
- axesm()
- geoshow('cn_province', edgecolor='gray')
- geoshow('country')
- levs = arange(1, 30, 1)
- cols = makecolors(len(levs) + 1, cmap='MPL_YlOrBr')
- cols[0] = 'w'
- layer = imshowm(data, levs, colors=cols)
- colorbar(layer)
- title('Sand and dust storm IDDI (' + tt.strftime('%Y-%m-%d %H') + ')')
|