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

Home » Public Forums » archive » (cG) windbarb problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
(cG) windbarb problem [message #88157] Tue, 25 March 2014 06:09 Go to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
Hi all,

I am using the Windbarb program and I am having the following problems:

1) The angle of the barb is not properly represented
2) The position of the barb is wrong

I have reproduced both errors in the following example

device, dec=0

!p.background=255
!p.color=0

limit=[20.,-128.,53.,-65.]

map_set, 0, 0, limit=limit, position=[0,0,1,1], /noborder, /isotropic, /mercator

map_continents, /countries, /coasts

windbarb, [-110], [35], [50.], [45.], length=0.2, color=[0,0,0]

plots, [-110], [35], psym=1

I was expecting the barb to be oriented 45 deg and it is not the case... Also, I was expecting the barb to start at the exact position -110, 35.

Thank you in advance for your help,
nata
Re: (cG) windbarb problem [message #88158 is a reply to message #88157] Tue, 25 March 2014 06:23 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
nata writes:

> I am using the Windbarb program and I am having the following problems:
>
> 1) The angle of the barb is not properly represented
> 2) The position of the barb is wrong
>
> I have reproduced both errors in the following example
>
> device, dec=0
>
> !p.background=255
> !p.color=0
>
> limit=[20.,-128.,53.,-65.]
>
> map_set, 0, 0, limit=limit, position=[0,0,1,1], /noborder, /isotropic, /mercator
>
> map_continents, /countries, /coasts
>
> windbarb, [-110], [35], [50.], [45.], length=0.2, color=[0,0,0]
>
> plots, [-110], [35], psym=1
>
> I was expecting the barb to be oriented 45 deg and it is not the case... Also, I was expecting the barb to start at the exact position -110, 35.
>
> Thank you in advance for your help,

Yes, there are probably all *kinds* of things wrong with that old
program. But, no time to work on it at the moment. Sorry.

It needs to be completely rewritten, I would think.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: (cG) windbarb problem [message #88159 is a reply to message #88158] Tue, 25 March 2014 06:26 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
OK. I would suggest to not distribute programs that do not work properly.
Is there an alternative? I am also having problems with velovect
Re: (cG) windbarb problem [message #88160 is a reply to message #88159] Tue, 25 March 2014 06:32 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den tisdagen den 25:e mars 2014 kl. 14:26:06 UTC+1 skrev nata:
> OK. I would suggest to not distribute programs that do not work properly.
>
> Is there an alternative?

Google finds several different files with that name, as well as wind_barb.pro.

/Mats
Re: (cG) windbarb problem [message #88161 is a reply to message #88159] Tue, 25 March 2014 06:39 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
nata writes:

> OK. I would suggest to not distribute programs that do not work properly.
> Is there an alternative? I am also having problems with velovect

Yes, I'm looking to hire five more people to help me manage my business.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: (cG) windbarb problem [message #88162 is a reply to message #88160] Tue, 25 March 2014 06:41 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
I fixed the routine by using the CLIP keyword and by modifying the lines 245 and 246
x1 = clip[0] > (xx[j] + sindr * sr) < clip[2]
y1 = clip[1] > (yy[j] + cosdr * sr * aspect) < clip[3]:
by
x1 = clip[0] > (xx[j]) < clip[2]
y1 = clip[1] > (yy[j]) < clip[3]

Now everything is working properly

device, dec=0

!p.background=255
!p.color=0

limit=[20.,-128.,53.,-65.]

dim=[800,800]

window, 0, xsize=dim[0], ysize=dim[1]

map_set, 0, 0, limit=limit, position=[0,0,1,1], /noborder, /isotropic, /mercator

map_continents, /countries, /coasts

uv_box=!map.uv_box
aspect_ratio=(uv_box[2]-uv_box[0])/(uv_box[3]-uv_box[1])

data=intarr(100,100)
temp=map_image(data,xstart,ystart,xsize,ysize,latmin=limit[0 ],latmax=limit[2],$
lonmin=limit[1],lonmax=limit[3],/compress)

clip=[xstart,ystart,xstart+xsize,ystart+ysize]/float([dim,di m])

windbarb, [-110], [35], [50.], [45.], length=0.3, color=[0,0,0], clip=clip, aspect=1.

plots, [-110], [35], psym=1
Re: (cG) windbarb problem [message #88165 is a reply to message #88162] Tue, 25 March 2014 06:55 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
nata writes:

> I fixed the routine by using the CLIP keyword and by modifying the lines 245 and 246
> x1 = clip[0] > (xx[j] + sindr * sr) < clip[2]
> y1 = clip[1] > (yy[j] + cosdr * sr * aspect) < clip[3]:
> by
> x1 = clip[0] > (xx[j]) < clip[2]
> y1 = clip[1] > (yy[j]) < clip[3]
>
> Now everything is working properly

You can also find a hardcoded "60" on line 216. If you change that to 45
you may like the results more.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: (cG) windbarb problem [message #88169 is a reply to message #88165] Tue, 25 March 2014 07:40 Go to previous message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
I prefer the 60
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Trouble plotting GSHHS shapefile
Next Topic: a GDL Workshop in June 2014

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

Current Time: Wed Oct 08 13:46:47 PDT 2025

Total time taken to generate the page: 0.00528 seconds