[Thread Prev][Thread Next][Index]

Re: Other vector formats

Hello Salvador,
	Although you don't specify what type of data you are dealing
with, let us assume you have something like speed and direction over
a lat,lon grid which you have resolved into u,v components.
	Then the following demo may help as it shows one way in which
barbless vectors may be drawn overlaying an underlay (cartesian) chart

! draw a world chart
use etopo20 ; shade rose

! define a grid for the demo u,v data ...
def axis/x=50:350:5/units=longitude xax
def axis/y=-80:80:10/units=latitude yax
def grid/x=xax/y=yax grd
! ... the x,y location grid points ...
let xx=x[g=grd]+y[g=grd]-y[g=grd] ; let yy=x[g=grd]-x[g=grd]+y[g=grd]
! ... and the u,v field
let u=5*cos(xx/30)*sin(yy/20) ; let v=5*sin(xx/20)*cos(yy/30)

! at this point "vector/over u,v" would produce vector field with heads

! find the grid dimensions 1:61 in x ; 1:17 in y
sho grid/all u

! and overlay the vectors using "ppl aline"
ppl line,1,0,0 ; ppl pen,1,7 ! a medium thickness black line for vectors
    (region/j=`j` ; repeat/i=1:61 (region/i=`i` ;
          ppl aline,1,`xx`,`yy`,`xx+u`,`yy+v`))

! add a scale arrow
ppl window,off ; ppl aline,1,200,100,220,100
label 190 100 1 0 0.12 @sr20 m/s

! the repeat command I've split for legibility over three lines but should
! be entered as a single line.  Note that while the region definitions
seem redundant, the vectors don't appear if you omit them!

Hope this is something you can adapt to your purpose.
Good luck,

|__Room 2070 Bldg#3 NOAA/PMEL__|

On Tue, 22 Oct 2002, Salvador Calabria Montero wrote:

> Hello,
> I would like to draw vector in another format different from the defult way
> Ferret does, that is, what I need is to draw barb vectors: vector without
> head, and with a barb that shows the speed.
> I have been looking up in Ferret manual, and in the mail archives, but I have
> not found nothing related yet, though I found a reference in the FAQ section
> (Wind barbs/stick vectors) but with no link to any page.
> I wonder if you know to do it if it is possible.
> Thank you very much in advance.

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement