getvar returns ['GSW' is not a valid variable name]; extract_vars returns [got multiple values for argument 'timeidx']
还没有人认领这个 Issue。
评估
调研方向
报告提到了第 352 行附近的 wrf.getvar、wrf.extract_vars 和 routines.py。阅读这些入口点,并针对包含 GSW 的 wrfout 文件重现这两个调用;当受支持的提取行为明确,并且 invalid-name 或 duplicate-timeidx 失败已解决或记录后,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Dear all,
I'm now working on an issue that needs the net heat flux at surface.
To calculate it, I need the variables including GSW, GLW, TSK, EMISS, GRDFLX, HFX, and LH.
The others are easily obtainded by wrf.getvar function, but I failed in getting the variable GSW, and the error message is here:
gsw = wrf.getvar(wrflist, "GSW", timeidx=t, @method="cat")
File "/Users/abc/anaconda3/envs/pygmt/lib/python3.10/site-packages/wrf/ro
utines.py", line 352, in getvar
raise ValueError("'{}' is not a valid variable name".format(varname))
ValueError: 'GSW' is not a valid variable name
I checked the wrfout file and confirmed there is a variable named 'GSW' (I could also plot it):
float GSW(Time, south_north, west_east) ;
GSW:FieldType = 104 ;
GSW:MemoryOrder = "XY " ;
GSW:description = "NET SHORT WAVE FLUX AT GROUND SURFACE" ;
GSW:units = "W m-2" ;
GSW:stagger = "" ;
GSW:coordinates = "XLONG XLAT XTIME" ;
After that, I tried to use wrf.extract_vars to get the variables that originally embedded in the wrfout file, but I also got error
gsw = wrf.extract_vars(wrflist, "GSW", timeidx=t, method="cat")
TypeError: extract_vars() got multiple values for argument 'timeidx'
The argument 'timeidx=t' works fine in other variables such as GLW, etc.
Is this a bug or I need special way to extract GSW? For now, I could only get 'SWDOWN' and 'ALBEDO' seperately and calculate GSW by myself.
- 主要语言
- Python
- 星标
- 498
- 派生
- 178
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NCAR/wrf-python 的其他 Issue
-
NCAR/wrf-python#309 · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 38/100
NCAR/wrf-python#307 · 5 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
NCAR/wrf-python#286 · 3 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
NCAR/wrf-python#282 · 1 条评论 ·
-
PyPI releases 未关闭
NCAR/wrf-python#274 · 5 条评论 · 1 个 reaction · 已指派 1 人 ·
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
stephrobert/dsoxlab#238 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
sublimehq/package_control#1780 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 70/100
nwg-piotr/nwg-displays#145 ·