Python & Radar
雷达PPI
(1) code
代码语言:javascript
复制#雷达图 2019090205-2019090210 点的雷达基本反射率 PPI
# %%
import cinrad
from cinrad.io import CinradReader, StandardData
from cinrad.io import PhasedArrayData
from cinrad.visualize import Section
import matplotlib.pyplot as plt
%matplotlib inline
from cinrad.visualize import PPI
import matplotlib.ticker as mticker
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import os
from cinrad.io import PUP
# %%
path="D:\biancheng_data\tian-Z9200-20190902\Z9200.20190902.080000.AR2\Z9200.20190902.080000.AR2"#新版本数据
f = StandardData(path) #新版本标准数据
#path="F:\radar\Z_RADR_I_Z9552_20190605000500_O_DOR_SA_CAP.bin\Z_RADR_I_Z9552_20190605000500_O_DOR_SA_CAP.bin"3旧版本数据
#f=cinrad.io.CinradReader(path)#旧版本数据
# %%
f.available_product(0)
# %%
tilt_number = 2
radius = 150
data_dtype = 'REF'
r = f.get_data(tilt_number, radius, data_dtype) #获取反射率数据
print(r)
rl = list(f.iter_tilt(radius, 'REF'))
# %%
fig = cinrad.visualize.PPI(r, dpi=75,add_city_names=bool)
fig.plot_range_rings(radius, color='pink', linewidth=1.0)# 在PPI图上绘制圆圈
for i in range(0,radius,50):
fig.plot_range_rings(i, color='pink', linewidth=1.0)
ax1 = fig.geoax.gridlines(draw_labels=True,linewidth=2, color='k', alpha=0.5, linestyle='--')
ax1.top_labels = False
ax1.right_labels = False
ax1.xformatter = LONGITUDE_FORMATTER
ax1.yformatter = LATITUDE_FORMATTER
ax1.xlabel_style = {'size': 18, 'color': 'white'}
ax1.ylabel_style = {'size': 18, 'color': 'white'}
(2)result
雷达RHI
(1)code
代码语言:javascript
复制#雷达剖面图
import cinrad
from cinrad.io import CinradReader, StandardData
from cinrad.io import PhasedArrayData
from cinrad.visualize import Section
import matplotlib.pyplot as plt
%matplotlib inline
from cinrad.visualize import PPI
import matplotlib.ticker as mticker
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import os
from cinrad.io import PUP
# %%
path="D:\biancheng_data\tian-Z9200-20190902\Z9200.20190902.090000.AR2\Z9200.20190902.090000.AR2"
f = StandardData(path) #新版本标准数据
# %%
f.available_product(0) #查看包含的产品类型
# %%
tilt_number = 2 #代表第3个仰角
radius = 150 #绘制图像的范围大小,150km
data_dtype = 'REF'
print(r)
#rl = list(f.iter_tilt(radius, 'REF'))
rl = [f.get_data(i, 150, 'REF') for i in f.angleindex_r]
vcs = cinrad.calc.VCS(rl)
sec = vcs.get_section(start_cart=(112.5, 22.5), end_cart=(113.5, 23.5)) #传入经纬度坐标
fig=Section(sec)
(2)result