comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: help - sticks plots of u,v/speed direction??
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: help - sticks plots of u,v/speed direction?? [message #18436] Wed, 12 January 2000 00:00 Go to previous message
Pedro Velez-Belchi is currently offline  Pedro Velez-Belchi
Messages: 2
Registered: January 2000
Junior Member
Jean Newman ha escrito:

> I have time-series of vectors u and v and wish to plot them along a time
> axis as sticks, a pretty standard plot for winds or current. Can anyone
> help me with how to go about this using IDL? Jean
>

Hello Jean hope the following lines can help you, any further trouble just
let me know:

;in dir should be the direction, diaj is the julian day (or any other time
indicator), velo is the array with the ;magnitude of the vector

s0=size(dir)
nc0= s0(1)

x00=FLTARR(nc0)
y00=FLTARR(nc0)
x10=FLTARR(nc0)
y10=FLTARR(nc0)




xmin0= min(diaj)-0.5
xmax0= max(diaj)+0.5
ymin0=-50.
ymax0=50.
diroffset=90.
dir=-dir+90-diroffset
sizex=10

; calcula coordenadas flechas
FOR i=0,nc0-1 DO BEGIN
x00(i)=diaj(i)
y00(i)=0.
x10(i)=x00(i)+velo(i)*COS(dir(i)*!DTOR) $
*((xmax0-xmin0)/(ymax0-ymin0))*(4./sizex)
y10(i)=y00(i)+velo(i)*SIN(dir(i)*!DTOR)

ENDFOR



PLOT, /DEVICE,[xmin0,xmax0], [ymin0,ymax0], $
xrange=[xmin0,xmax0], yrange=[ymin0,ymax0], xstyle=1, ystyle=1, $
xtitle='time(days) after 1 October 1996', ytitle='Wind velocity (m/s)',
$
title= title,/nodata
ARROW, /DEVICE, x00(0:nc0-1), y00(0:nc0-1), x10(0:nc0-1), $
y10(0:nc0-1), /DATA,/solid,hsize=0
end
[Message index]
 
Read Message
Read Message
Previous Topic: Re: How to change directory to a NT server
Next Topic: Re: error with sort

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:42:53 PDT 2025

Total time taken to generate the page: 0.00471 seconds