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

Home » Public Forums » archive » Plotting Vectors with Coyote Graphics Programs
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
Plotting Vectors with Coyote Graphics Programs [message #88132] Sat, 22 March 2014 13:20 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

I've written a new vector plotting program, cgVelocityVectors, today in
the manner of the NASA Astronomy Library routine PartVelVec. I had a
couple of objectives in mind. First, I wanted an easier way to make a
vector length key so users could easily match the length of a vector to
its magnitude. Second, I wanted to add a couple of features to the
program to make the vectors more attractive. For example, I wanted to be
able to draw vectors with solid arrow heads.

A length key or legend can easily be contructed using two keywords,
ReferenceVector and Length. ReferenceVector is used to specify a
reference magnitude against which all vectors are scaled before they are
displayed. Length specifies the length of the reference vector, in
normalized coordinates. This allows you to adjust vector length on the
plot with respect to a reference vector. You always are certain what a
length means. Vectors can be overplotted on maps, contour plots, and in
other graphics windows.

You can learn more about the program here:

https://www.idlcoyote.com/graphics_tips/vectors.html

And you can read the documentation for the program here:

https://www.idlcoyote.com/idldoc/cg/cgvelocityvectors.html

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: Plotting Vectors with Coyote Graphics Programs [message #88148 is a reply to message #88132] Mon, 24 March 2014 12:34 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I've written a new vector plotting program, cgVelocityVectors, today
in
> the manner of the NASA Astronomy Library routine PartVelVec. I had a
> couple of objectives in mind. First, I wanted an easier way to make a
> vector length key so users could easily match the length of a vector to
> its magnitude. Second, I wanted to add a couple of features to the
> program to make the vectors more attractive. For example, I wanted to be
> able to draw vectors with solid arrow heads.

As sometimes happens, I don't realize I have written a program All Wrong
until I actually try to use the program or write an article about it.
This time I was trying to use the program when I got that sinking
feeling in the pit of my stomach.

In any case, cgVelocityVectors has been completely revamped this morning
to answer the call in two completely different test cases. It seems to
be working the way I expect it to work now. But, naturally, I leave it
up to you to test thoroughly. :-)

While I was frantically fooling around with it, Matt Argall asked if I
could add an ORDERED keyword, so that if you are selecting a fraction of
the original vectors to plot, it would take an ordered selection of
vectors, rather than a random selection of vectors. I have complied with
his request in this new version.

You can find the updated version here. (Note that other programs have
also changed in the Coyote Library (e.g., a new Range keyword in
SetDefaultValue) that is used in cgVelocityVectors, so if you didn't
update your Coyote Library this morning, you should get the entire
library.)

http://www.idlcoyote.com/programs/cgvelocityvectors.pro

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: Plotting Vectors with Coyote Graphics Programs [message #88179 is a reply to message #88148] Wed, 26 March 2014 08:46 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I've written a new vector plotting program, cgVelocityVectors, today.

Sigh...

Dick Jackson has been on a relentless campaign to convince me of how
poorly this routine is named. I didn't disagree with him, exactly, but I
wasn't convinced that his alternatives were any better. I was waiting
for inspiration from the muse. But, as some of you who write programs
know, you can sometimes wait a hell of long time for the muse to show up
and give you a good name.

Fortunately, the muse came through for me today in the shower (her usual
place of residence). I realized the name I was looking for was
cgDrawVectors. This has two distinct advantages. One, it gets rid of the
word "velocity", which Dick hates. And, two, it comes after cgDrawShapes
in the list of programs in the on-line documentation. About as natural a
place to find it as I can devise. Plus, as a bonus, it actually
describes what the program does!

Some of you have already been using cgVelocityVectors. Phillip Bitzer
has shown me an incredible radar image of a tornado in Alabama using it.
You will have to make a name change in your programs, I'm afraid. The
alternative is to "retire" cgVelocityVectors, but to do so only three
days after he joined the work force seems crazy, even to me.

As a bonus, and to convince you to make the name change, I added a
MapCoord keyword to cgDrawVectors this morning that makes it much easier
to add vectors to map projections created with cgMap or Map_Proj_Init.

http://www.idlcoyote.com/programs/cgdrawvectors.pro

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: Plotting Vectors with Coyote Graphics Programs [message #88181 is a reply to message #88179] Wed, 26 March 2014 11:01 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
David Fanning wrote, On 2014-03-26, 8:46am:
> David Fanning writes:
>
>> I've written a new vector plotting program, cgVelocityVectors, today.
>
> Sigh...
>
> Dick Jackson has been on a relentless campaign to convince me of how
> poorly this routine is named. [...]
>
> Fortunately, the muse came through for me today in the shower (her usual
> place of residence). I realized the name I was looking for was
> cgDrawVectors. This has two distinct advantages. One, it gets rid of the
> word "velocity", which Dick hates.

Oh, I love the word "velocity"! It's just that words like "field strength",
"maximum slope", "acceleration" and "direction to Coyote's nearest watering
hole" wanted equal opportunity. :-)

> [...] Plus, as a bonus, it actually describes what the program does!

I remember a Comp. Sci. prof exhorting us to always use routine names with that
"verb"-"object" pattern. He'd be pleased.

--

Cheers,
-Dick

Dick Jackson Software Consulting Inc.
Victoria, BC, Canada
www.d-jackson.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Map Projection Bug?
Next Topic: Function syntax for any object class

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

Current Time: Wed Oct 08 13:52:09 PDT 2025

Total time taken to generate the page: 0.00591 seconds