NCAR / NCAR/wrf-python

WRF-python post-processing wind speed issues

Open
#229 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
498
Forks
178
PR merge metrics
No merged PRs in 30d

Description

Recently, I used uvmet from WRF-Python to extract the U and V components of wind velocity. However, when I extracted the composite wind speed from uvmet_wspd_wdir, I found that the wind speed calculated using the U and V components differed significantly from the directly extracted wspd values.

code:

import wrf
import numpy as np
from netCDF4 import Dataset

file_data = Dataset('D3_2010_07_3_20100712161000.nc')
U,V = wrf.getvar(file_data,'uvmet') #m/s
WSD,WDIR = wrf.getvar(file_data,'uvmet_wspd_wdir')
a = np.sqrt(np.array(U.values)**2+np.array(V.values)**2)
b = np.array(WSD.values)

The result indicates that a is the transpose matrix of b.
Why does the matrix transpose happen? Is it due to the storage problem of components in u and v?

I am not very sure which one is the true value that can be compared with observed values.
I am so glad looking forward to your answer.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the shown Python code and the referenced D3_2010_07_3_20100712161000.nc dataset. Inspect the outputs and implementations of getvar('uvmet') and getvar('uvmet_wspd_wdir'); done means determining whether the transpose is expected or a bug and documenting or correcting the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.