- 积分
- 55945
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
发表于 2024-6-14 14:42:36
|
显示全部楼层
回帖奖励 +5 金钱
供参考
- fn = r'D:\Temp\binary\radar\HBR_Z9010_20240614001800.nc'
- f = addfile(fn)
- v = f['hbr']
- data = v[:]
- lat = v.attrvalue('rlat')[0] / 10000.
- lon = v.attrvalue('rlon')[0] / 10000.
- height = v.attrvalue('rhei')[0]
- scale = v.attrvalue('scale')[0]
- res = v.attrvalue('res')[0]
- data = data / scale
- data[data<-50] = nan
- #Set azimuth equidistant projection
- proj = projinfo(proj='aeqd', lon_0=lon, lat_0=lat)
- yn, xn = data.shape
- xmin = -(xn / 2 * res)
- ymin = -(yn / 2 * res)
- x = arange1(xmin, xn, res)
- y = arange1(ymin, yn, res)
- #Plot
- ax = axesm(facecolor='b', projection=proj)
- geoshow('cn_province', edgecolor=None, facecolor=[230,230,230])
- geoshow('cn_province', edgecolor=[80,80,80])
- city = geoshow('cn_cities', facecolor='r', size=8)
- city.addlabels('NAME', fontname=u'黑体', fontsize=16, yoffset=18)
- levs = [5,10,15,20,25,30,35,40,45,50,55,60,65,70]
- cols = [(255,255,255,0),(102,255,255),(0,162,232),(86,225,250),(3,207,14),
- (26,152,7),(255,242,0),(217,172,113),(255,147,74),(255,0,0),
- (204,0,0),(155,0,0),(236,21,236),(130,11,130),(184,108,208)]
- imshow(x, y, data, levs, colors=cols, proj=proj, zorder=1)
- colorbar(shrink=0.8, label='dBZ', labelloc='top')
- #Plot circles
- cx, cy = project(lon, lat, toproj=proj)
- rr = array([50, 100, 150, 200, 250, 300]) * 1000
- for rd in rr:
- ax.add_circle((cx, cy), rd, edgecolor='r')
- plot([cy,cy], [cx-rd,cx+rd], color='r', proj=proj)
- plot([cy+rd,cy-rd], [cx,cx], color='r', proj=proj)
- xlim(cx - rd, cx + rd)
- ylim(cy - rd, cy + rd)
|
|