[Thread Prev][Thread Next][Index]

Re: Wind Stick Diagram



Hi Roland,

> Is ferret also capable of plotting wind stick diagram?

USING PPL PLOTUV
For a single time series rather than a space-time dataset the
PPL PLOTUV command is perhaps easiest.  You load both components of
the sticks using the PLOT/SET command, then render them with PPL PLOTUV
The result is "barbless" arrows which is good for stick plots I think.

! Example:
def axis/t=1-jan-2001:31-dec-2001:1/units=days tax
def grid/t=tax grd ; let time=t[g=grd]
let per=100 ; let arg=4*atan(1.)*time/per  ! 2*PI*t/T
let u=2*cos(arg)+0.1*randu(time) ; let v=3*sin(arg)+randn(time)
plot/set u,v
ppl plotuv

! To verify that the angle of the sticks is correct
plot/set u,u ; ppl plotuv     ! expect 45 degree sticks
label/nouser 0 0.8 -1 45 0.2 @p2@sr-------------------------------

USING VECTOR:
The "vector" command is of use if the data is on a space-time
grid and you want to plot more than one stick at once.  To plot the
stick series for one location only you have to be tricky

! Example:
def axis/t=1-jan-2001:31-dec-2001:1/units=days tax
def axis/z=0:100:20 zax ; def grid/z=zax/t=tax grdzt
let time=t[g=grdzt] ; let per=100 ; let arg=4*atan(1.)*time/per
let u=2*cos(arg)+0.1*randu(time)+k[g=grdzt]
let v=3*sin(arg)+randn(time)+k[g=grdzt]-k[g=grdzt]

vector u,v     ! making sticks for several locations works fine

vector/k=5 u,v ! but trying just one fails with error message
               ! dimensions improperly specified: must be a 2D region
               ! which you can outsmart by something like
vector/k=5:6 if(k eq 5)then u , if(k eq 5)then v
               ! but sizing the sticks (really arrows with barbs) can
               ! be difficult

Hope this helps,
Mick

|____Mick.Spillane@noaa.gov____|
|__Room 2070 Bldg#3 NOAA/PMEL__|
|____Phone_:_(206)526-6780_____|




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement