Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Please help!! WRF-python data extraction at specific lat and lon position

zhw

New member
Dear users,

I hope this message finds you well. I am trying to use wrf-python to extract the wind speed and direction for a specific pair of latitude and longitude position.

I have found this wrf-python function:
wrf.g_uvmet.get_uvmet10_wspd_wdir(wrfin, timeidx=0, method='cat', squeeze=True, cache=None, meta=True, _key=None, units='m s-1') from wrf.g_uvmet.get_uvmet10_wspd_wdir — wrf-python 1.3.4.1 documentation.
I have also come across this function: wrf.g_uvmet.get_uvmet_wspd_wdir — wrf-python 1.3.4.1 documentation.


Unfortunately, I have no clue how to use these functions to extract the wind speed and direction data 10m above the ground and 100m above the ground at a specific location.

Could anyone please help me with this?

Many thanks in advance!

Best regards,
zhw
 
Dear Users, may I know if you have any clues on how wdir is calculated from wrf_python?
 
Dear Users, may I know if you have any clues on how wdir is calculated from wrf_python?

# Get latitude and longtiude locations for a specific pair of lat and lon coridinates
Python:
lat_lon = [lat, lon]                                                           
x_y = wrf.ll_to_xy(ncfile, lat_lon[0], lat_lon[1])
p = wrf.getvar(ncfile, "pres", timeidx=0, units='hPa')[:, x_y[1], x_y[0]]

example useage
 
  • Like
Reactions: zhw
# Get latitude and longtiude locations for a specific pair of lat and lon coridinates
Python:
lat_lon = [lat, lon]                                                          
x_y = wrf.ll_to_xy(ncfile, lat_lon[0], lat_lon[1])
p = wrf.getvar(ncfile, "pres", timeidx=0, units='hPa')[:, x_y[1], x_y[0]]

example useage
Dear Sir, Thank you very much for your help! :)
 
Top