Find wind direction of the corresponding maximum wind speed
Added by Alina Lerner about 3 years ago
Hello everybody!
I am stuck with one problem. I have a NetCDF file containing some forecasted parameters over the 24 hours (file is attached). I need to find the maximum wind speeds for every gridpoint over the time and the directions of the corresponding wind speeds. I used the following command to calculate the windspeed out of 10 m U and V and find the time maximums:
cdo timmax -chname,10u,ws -sqrt -add -sqr -selname,10u 09102021.nc -sqr -selname,10v 09102021.nc ws10max.nc
But I have no idea how to find the corresponding wind directions. I would be very grateful, if you could suggest me something to solve the problem.
Thank you for your time,
Alina
09102021.nc (38.2 MB) 09102021.nc |
Replies (6)
RE: Find wind direction of the corresponding maximum wind speed - Added by Ralf Mueller about 3 years ago
hi Alina!
I have a couple of concerns/thoughts regarding your workflow
- do you really want the wind direction of the one single point? wouldn't it make more sense to make a histogram of the directions of the strongest 10% (or another number) of wind speed locations ?
- how to do you want to compute the directions? atan(10v/10u) ?
cheers
ralf
RE: Find wind direction of the corresponding maximum wind speed - Added by Alina Lerner about 3 years ago
Hello, Ralf!
- Thank you for your response. I have a list of coordinates (lat/lon), which I need to derive different parameters for. And present it all in the form of table to my client (lat,lon,t2max,t2min,ws10max,wd...), so I really just need one number, not the histogram.
- 180+180/pi*atan2(-u,-v)
Best regards,
Alina
RE: Find wind direction of the corresponding maximum wind speed - Added by Karin Meier-Fleischer about 3 years ago
Wind speed:
cdo -O -expr,'ws=sqrt(10u*10u+10v*10v)' -selname,10u,10v 09102021.nc wind_speed.nc
Wind direction:
cdo -O -chname,10u,wd -mulc,57.3 -atan2 -mulc,-1 -selname,10u 09102021.nc -mulc,-1 -selname,10v 09102021.nc wind_dir.nc
Merge into one file:
cdo -O -merge wind_speed.nc wind_dir.nc wind.nc
RE: Find wind direction of the corresponding maximum wind speed - Added by Alina Lerner about 3 years ago
Hello, Karin
Thank you for your help. Unfortunately, it does not solve my problem (I'm sorry if I did not clearly expressed my idea). If I take your solution and get the wind.nc file, further I need to find time maximum of the wind speed, and the direction of corresponding maximum wind speed. If I use 'timmax', I would get maximum wind speeds and maximum wind directions (which is non-sense) instead of maximum wind speeds and directions corresponding to them. This is my problem.
RE: Find wind direction of the corresponding maximum wind speed - Added by Karin Meier-Fleischer about 3 years ago
Sorry, but imo there is no operator for this.
RE: Find wind direction of the corresponding maximum wind speed - Added by Ralf Mueller about 3 years ago
I have an idea, but I don't know if it will be sufficient for you, Alina:
when you have computed the max values as a single horizontal field, you can use it for computing a 0-1-mask out of the full wind speed data set. Then you use that mask for multiplication with the wind directions. in the result of that multiplication only the directions of the max value wind speeds will remain non-zero.
does this sound at least like a possible solution?