getvar returns ['GSW' is not a valid variable name]; extract_vars returns [got multiple values for argument 'timeidx']
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Báo cáo đề cập đến wrf.getvar, wrf.extract_vars và routines.py quanh dòng 352. Đọc các điểm vào đó và tái hiện cả hai lời gọi trên một tệp wrfout chứa GSW; được xem là hoàn tất khi hành vi trích xuất được hỗ trợ đã rõ ràng và lỗi invalid-name hoặc duplicate-timeidx đã được giải quyết hoặc ghi lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 498
- Fork
- 178
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NCAR/wrf-python
-
NCAR/wrf-python#309 · 1 người được giao ·
-
Windows builds on conda-forge Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
NCAR/wrf-python#307 · 5 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
NCAR/wrf-python#286 · 3 bình luận ·
-
Windows builds and testing Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
NCAR/wrf-python#282 · 1 bình luận ·
-
PyPI releases Đang mở
NCAR/wrf-python#274 · 5 bình luận · 1 reaction · 1 người được giao ·
Tất cả issue của NCAR/wrf-python
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stephrobert/dsoxlab#238 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sublimehq/package_control#1780 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nwg-piotr/nwg-displays#145 ·