- 积分
- 5665
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2020-3-3
- 最后登录
- 1970-1-1
|
发表于 2021-4-9 17:14:24
|
显示全部楼层
老师我又来打扰了。。我想做组合反射率的雷达拼图,拼图之前用的基本发射率成功了。但是计算了组合反射率后没有了'distance',想问一下这时候咋整呀
- cr3 = cinrad.calc.quick_cr([f3.get_data(i, 200, 'REF') for i in f3.angleindex_r])
- cr4 = cinrad.calc.quick_cr([f4.get_data(i, 200, 'REF') for i in f4.angleindex_r])
- print(cr3)
- print(cr4)
- gm = GridMapper([cr3,cr4])
- grid = gm(0.01)
- fig = cinrad.visualize.PPI(grid, dpi=200, style='white',add_city_names=True)[code]KeyError
- [code]<xarray.Dataset>
- Dimensions: (latitude: 1000, longitude: 1000)
- Coordinates:
- * longitude (longitude) float64 119.3 119.3 119.3 119.3 ... 124.0 124.0 124.0
- * latitude (latitude) float64 37.11 37.11 37.12 37.12 ... 40.7 40.71 40.71
- Data variables:
- CR (longitude, latitude) float64 nan nan nan nan ... nan nan nan nan
- Attributes:
- elevation: 0
- range: 200
- scan_time: 2020-11-17 13:05:03.526000
- site_code: Z9411
- site_name: 大连
- site_longitude: 121.64888888888889
- site_latitude: 38.90972222222222
- tangential_reso: 1.0
- nyquist_vel: 30.73
- task: VCP21
- <xarray.Dataset>
- Dimensions: (latitude: 1000, longitude: 1000)
- Coordinates:
- * longitude (longitude) float64 119.9 119.9 119.9 119.9 ... 124.6 124.6 124.6
- * latitude (latitude) float64 38.87 38.87 38.88 38.88 ... 42.47 42.47 42.47
- Data variables:
- CR (longitude, latitude) float64 nan nan nan nan ... nan nan nan nan
- Attributes:
- elevation: 0
- range: 200
- scan_time: 2020-11-17 13:05:03.346000
- site_code: Z9417
- site_name: 营口
- site_longitude: 122.27194444444444
- site_latitude: 40.672777777777775
- tangential_reso: 1.0
- nyquist_vel: 30.72
- task: VCP21
复制代码
Traceback (most recent call last)
F:\anacondo\lib\site-packages\xarray\core\dataset.py in _construct_dataarray(self, name)
1258 try:
-> 1259 variable = self._variables[name]
1260 except KeyError:
KeyError: 'distance'
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)
<ipython-input-20-b91e71348677> in <module>
7 print(cr3)
8 print(cr4)
----> 9 gm = GridMapper([cr3,cr4])
10 grid = gm(0.01)
11 fig = cinrad.visualize.PPI(grid, dpi=200, style='white',add_city_names=True)
F:\anacondo\lib\site-packages\cinrad\calc.py in __init__(self, fields, max_dist)
380 self.data_ravel = np.ma.hstack([i[self.dtype].values.ravel() for i in fields])
381 self.dist_ravel = np.hstack(
--> 382 [
383 np.broadcast_to(i["distance"], i["longitude"].shape).ravel()
384 for i in fields
F:\anacondo\lib\site-packages\cinrad\calc.py in <listcomp>(.0)
381 self.dist_ravel = np.hstack(
382 [
--> 383 np.broadcast_to(i["distance"], i["longitude"].shape).ravel()
384 for i in fields
385 ]
F:\anacondo\lib\site-packages\xarray\core\dataset.py in __getitem__(self, key)
1357
1358 if hashable(key):
-> 1359 return self._construct_dataarray(key)
1360 else:
1361 return self._copy_listed(np.asarray(key))
F:\anacondo\lib\site-packages\xarray\core\dataset.py in _construct_dataarray(self, name)
1259 variable = self._variables[name]
1260 except KeyError:
-> 1261 _, name, variable = _get_virtual_variable(
1262 self._variables, name, self._level_coords, self.dims
1263 )
F:\anacondo\lib\site-packages\xarray\core\dataset.py in _get_virtual_variable(variables, key, level_vars, dim_sizes)
169 ref_var = dim_var.to_index_variable().get_level_variable(ref_name)
170 else:
--> 171 ref_var = variables[ref_name]
172
173 if var_name is None:
KeyError: 'distance'[/code][/code] |
|