[Thread Prev][Thread Next][Index]

Re: [ferret_users] wind stick plot



Hi-
The stick plot script uses a plot command from the underlying plot library PPLUS.  There isn't a form of that command which adds arrowheads, so the short answer is that there isn't an easy one-command way to do it. 

Of course one could write a script similar to the polygon vector scripts, to draw arrow shapes based on the values of u and v and place them on the page. The polygon vector scripts are an analogy to the standard VECTOR command, so this would be a matter of reproducing what the VECTOR command does but with polygons; a new script for this purpose would reproduce what the PLOTUV command does. (See the demo script poly_vector_demo.jnl for an introduction to that style - this family of scripts was contributed by a Ferret user.)

Ansley

On 7/23/2011 2:18 AM, Thuckan wrote:
Dear Ryo and others,

Thank you for writing such a clear explanation of the stick plot. 
I give my journal file here in case it could not be opened by others. 

cancel mode logo
def ax/t0="15-May-2008 00:00:00"/t="15-May-2008 00:00:00":"30-Apr-2009 18:00:00":3/units=hours tax
set da/ez/var=jnk1,jnk2,jnk3,Hs_bc,Hsw,dir,Pdir,Tm02,Rtp,wlen,wspx,wspy/col=12/grid=t[gt=tax]/skip=9 mydata.txt
go stick_vectors plot/no/hlimits=1:8520:30 WSPX WSPY 0 5 !hlimit set to extent the xaxis beyond 'tend'


Any one got idea on how to plot the sticks with arrows indicating the direction of wind, like the one attached here? Is it possible with ferret?

Thanks,
Thuckan.


Hi Thuckan,

| Dear Ferreters,I am trying to represent wind velocity and direction
| in the same plot using stick plot.I could do it with a data set
| having u and v components of wind-see windstick_ferret.gif. I
| presume that the length of the stick is proportional to the wind
| speed sqrt(u^2+v^2) and the direction of the stick indicates the
| direction to which wind is blowing. But I don't understand why the
| Y-axis shows postive as well as negative values, where as wind speed
| should be always positive.

A stick plot is a plot on the u-v plane.  Suppose you have a time
series of a vector (u(t), v(t)).  Then, you plot line segments

  from (c*t, 0) to (c*t+u(t), v(t))

on the u-v plane for all values of t, where c is an arbitrary
constant.  Each line segment represents the vector (u(t), v(t))
but its origin is shifted as (c*t, 0).

So, the vertical axis is v and the horizontal axis is u.
But, the horizontal axis is "labeled" with time t, just for
convenience, to represent the shift of the origin (c*t,0).

Does this answer your first question?

I'll leave the remaining questions out.  I haven't looked
at your journal file.

Regards,
Ryo




From: Thuckan <thuckan@xxxxxxxxxxxxxx>
Sent: Fri, 22 Jul 2011 16:46:51
To: "ferret_users@xxxxxxxx" <ferret_users@xxxxxxxx>
Cc: "owner-ferret_users@xxxxxxxx" <owner-ferret_users@xxxxxxxx>
Subject: [ferret_users] wind stick plot
Dear Ferreters,
I am trying to represent wind velocity and direction in the same plot using stick plot.
I could do it with a data set having u and v components of wind-see windstick_ferret.gif. I presume that the length of the stick is proportional to the wind speed sqrt(u^2+v^2) and the direction of the stick indicates the direction to which wind is blowing. But I don't understand why the Y-axis shows postive as well as negative values, where as wind speed should be always positive. I attach my journal file here.
I found a different representation of the same idea elsewhere, thogh I don't know whether such a plot could be generated with ferret. I attach the figure here-windstick_arrows.gif.

Please clarify my doubt and tell if there is a way to plot the picture with arrows, like the second figure.

Thanks in advance,
Thuckan.


Treat yourself at a restaurant, spa, resort and much more with Rediff Deal ho jaye!


Treat yourself at a restaurant, spa, resort and much more with Rediff Deal ho jaye!

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement