[Thread Prev][Thread Next][Index]

Re: [ferret_users]wind frequency from zonal, meridional wind



Hey,
thanks. windrose was easy after the thread (thanks for Mick). I did it earlier. But that one is for one single point and i want for many years and for a region. I want to count the number of days belong to N,NNE,NE etc. directions in every point of the region. Then have the most frequent wind direction (only the direction of the wind counts).

After some search in archive, somehow i succeed in solving this:
I needed to have my 1D data (freq) to put on a 3D (inculing lon-lat) in every point.
i did it like this:
--------------------
repeat/j=1:61:1 (repeat/i=1:97:1 (let freq=tsequence({`ndir`,`nnedir`,`nedir`,`enedir`,`edir`,`esedir`,`sedir`,`ssedir`,`sdir`,`sswdir`,`swdir`,`wswdir`,`wdir`,`wnwdir`,`nwdir`,`nnwdir`}) ;\
def axis/t=1:16:1 tax; let freqt = freq[gt=tax];\
let zero=0*u; let freq3d=zero+freqt[g=GJU1@asn];\
let winddirmax=freq3d[t=@max]; let wind=freq3d[t=@loc:`winddirmax`];\
save/file="./out.nc"/append/clobber/ilimits=1:97/jlimits=1:61/i=`i`/j=`j` wind))

It takes a lot and complexity, so is there any better solution for it?
Thanks, Peter

On Tue, Aug 12, 2008 at 1:36 PM, Halldór Björnsson <halldor@xxxxxxxxxxxx> wrote:

It seems to me that you are trying to  draw a windrose

If you google "ferret wind rose" you get the following thread
from the help archives.
http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2004/msg00770.html


Sincerely

Halldŕo
----- Original Message -----
From: "Peter Szabo" <szabpet83@xxxxxxxxx>
To: "ferret users" <ferret_users@xxxxxxxx>
Sent: Tuesday, 12 August, 2008 7:48:29 AM GMT +00:00 Casablanca / Monrovia
Subject: [ferret_users]wind frequency from zonal, meridional wind



Dear Ferreters,

I have daily data set. I want to visualize the most frequent wind direction for a region. I have u and v variables.

1. First i count the number of days belonging to (16) directions with "tan" function (N, NNE, NE, ENE...)

let ENE=if (u lt 0 and v lt 0) and (tan(u/v) le 0.6682) and (tan(u/v) gt 0.1989) then 1
let enedir=ene[l=@sum]

and so on...

2. Then i try to write out for every (lon-lat) point the frequency of the direction (actually the number of the most frequent direction):

repeat/j=1:61:1 (repeat/i=1:97:1 (let freq={`ndir`,`nnedir`,`nedir`,`enedir`,`edir`,`esedir`,`sedir`,`ssedir`,`sdir`,`sswdir`,`swdir`,`wswdir`,`wdir`,`wnwdir`,`nwdir`,`nnwdir`} ;\
let winddirmax=freq[x=@max]; let wind=freq[x=@loc:`winddirmax`];\
save/file="./ winddir.6190.nc "/ilimits=1:97/jlimits=1:61/i=`i`/j=`j`/clobber wind))

It works, it says:

!-> REPEAT: I=63
!-> DEFINE VARIABLE freq={28,12,16,28,165,78,75,47,29,10,21,38,221,82,83,67}
!-> DEFINE VARIABLE wind=freq[x=@loc:221]
!-> LIST/FORMAT=CDF/file="..."/ilimits=1:97/jlimits=1:61/i=63/j=1/append/clobber wind
listing to file ...

But as for the output file, it seems, it didnt work:
yes? use ...
name title I J K L
WIND FREQ[X=@LOC:221] ... ... ... ...
yes? list wind
VARIABLE : FREQ[X=@LOC:221]
FILENAME : winddir.6190.nc
FILEPATH : /home/szabop/aladin_arpege/
13.00

Any suggestion will be appreciated (either in solving the technical problem). Thanks a lot,

Peter szabo


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement