组合反射率产品

以雷达为中心,生成笛卡尔坐标的组合反射率网格产品

 1from pycwr.io import read_auto
 2import matplotlib.pyplot as plt
 3from pycwr.draw.RadarPlot import plot_xy
 4import numpy as np
 5
 6filename = r"../../data/NUIST.20150627.002438.AR2.bz2"
 7PRD = read_auto(filename)
 8
 9x1d = np.arange(-150000, 150001, 1000) ##x方向1km等间距, -150km~150km范围
10y1d = np.arange(-150000, 150001, 1000) ##y方向1km等间距, -150km~150km范围
11PRD.add_product_CR_xy(XRange=x1d, YRange=y1d)
12print(PRD.product)
13grid_x, grid_y = np.meshgrid(x1d, y1d, indexing="ij")
14fig, ax = plt.subplots()
15plot_xy(ax, grid_x, grid_y, PRD.product.CR) ##画图显示
16ax.set_xlabel("Distance From Radar In East (km)", fontsize=14)
17ax.set_ylabel("Distance From Radar In North (km)", fontsize=14)
18plt.tight_layout()
19plt.show()
reStructuredText, the markup syntax

利用经纬度坐标信息生成组合反射率网格产品

 1from pycwr.io import read_auto
 2import matplotlib.pyplot as plt
 3from pycwr.draw.RadarPlot import plot_lonlat_map
 4import cartopy.crs as ccrs
 5import numpy as np
 6
 7filename = r"./data/NUIST.20150627.002438.AR2.bz2"
 8PRD = read_auto(filename)
 9
10lon1d = np.arange(117, 120.001, 0.01) ##lon方向0.01等间距,117-120范围
11lat1d = np.arange(31, 34.001, 0.01) ##lat方向0.01等间距, 31-34度范围
12PRD.add_product_CR_lonlat(XLon=lon1d, YLat=lat1d)
13# XLon:np.ndarray, 1d, units:degrees
14# YLat:np.ndarray, 1d, units:degrees
15# level_height:常量,要计算的高度 units:meters
16grid_lon, grid_lat = np.meshgrid(lon1d, lat1d, indexing="ij")
17ax = plt.axes(projection=ccrs.PlateCarree())
18plot_lonlat_map(ax, grid_lon, grid_lat, PRD.product.CR_geo, transform=ccrs.PlateCarree())
19ax.set_extent([117, 120, 31, 34], crs = ccrs.PlateCarree()) #设置显示范围
20plt.tight_layout()
21plt.show()
reStructuredText, the markup syntax