- 积分
- 5665
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2020-3-3
- 最后登录
- 1970-1-1
|
发表于 2021-3-25 16:50:15
|
显示全部楼层
老师不好意思打扰了,我想问下visualize.PPI能直接画出雷达拼图吗,我是用了cinrad.calc.GridMapper后,再用的PPI- import cinrad
- from cinrad.io import CinradReader, StandardData
- from cinrad.calc import GridMapper
- from cinrad.visualize import PPI
- import matplotlib.ticker as mticker
- from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
- import matplotlib.pyplot as plt
- plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签
- plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
- plt.rcParams['font.family']=['SimHei']
- ele = 0 #第1个仰角
- radius = 200 #绘制图像的范围大小
- f = CinradReader('E:\\421\\Z_RADR_I_Z9421_20201117120209_O_DOR_CD_CAP.bin')
- h = CinradReader('E:\\240\\Z_RADR_I_Z9240_20201117120402_O_DOR_SC_CAP.bin')
- #j = CinradReader('E:\\411\\Z_RADR_I_Z9411_20201117115900_O_DOR_SA_CAP.bin')
- r1 = f.get_data(ele,radius,'REF')
- r2 = h.get_data(ele,radius,'REF')
- #r3 = j.get_data(ele,radius,'REF')
- #gm = GridMapper([r1, r2])
- #grid = gm(0.1)
- gm = cinrad.calc.GridMapper([r1, r2])
- fig = cinrad.visualize.PPI(gm, dpi=200, add_city_names=True)
复制代码- AttributeError Traceback (most recent call last)
- <ipython-input-63-bb4965aa25cd> in <module>
- 24 #grid = gm(0.1)
- 25 gm = cinrad.calc.GridMapper([r1, r2])
- ---> 26 fig = cinrad.visualize.PPI(gm, dpi=200, add_city_names=True)
- E:\anaconda\lib\site-packages\cinrad-1.6.2-py3.8-win-amd64.egg\cinrad\visualize\ppi.py in __init__(self, data, fig, norm, cmap, nlabel, label, dpi, highlight, coastline, extent, section, style, add_city_names, plot_labels, **kwargs)
- 80 ):
- 81 self.data = data
- ---> 82 self.dtype = get_dtype(data)
- 83 self.settings = {
- 84 "cmap": cmap,
- E:\anaconda\lib\site-packages\cinrad-1.6.2-py3.8-win-amd64.egg\cinrad\common.py in get_dtype(data)
- 6
- 7 def get_dtype(data: Dataset) -> str:
- ----> 8 all_data = list(data.keys())
- 9 geo_var_name = ["longitude", "latitude", "height", "x_cor", "y_cor", "RF"]
- 10 for i in geo_var_name:
- AttributeError: 'GridMapper' object has no attribute 'keys'
复制代码
|
|