| Coyote Library Updates [message #77078] |
Sun, 31 July 2011 18:27  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
What with travel, lousy Internet connections, and what not,
I have been a bit lax about keeping everyone informed about
important changes to the Coyote Library.
A couple of changes to important programs are listed here.
(Other changes have been made, too. You can always get the
latest from the web page or SVN repository.)
cgIMAGE -- Apparently I had some good ideas for this program,
documented the changes (which mostly involved defining keywords
that affected the axes surrounding the image), then forgot to
actually implement the changes. Embarrassing. I could tell you
I was in the middle of this when the lion roared outside my
window, but it wouldn't be the truth. :-(
http://www.idlcoyote.com/programs/cgimage.pro
cgCONTOUR -- The XRange and YRange keywords mean slightly
different things in cgImage and cgContour. This has required
a new keyword ONIMAGE for cgContour that can work as an aid
for overlaying contour lines on top of images. In most cases,
the ONIMAGE keyword acts the same as the current OVERPLOT
keyword, but there are cases when it acts a LOT better
and more correctly.
http://www.idlcoyote.com/programs/cgcontour.pro
cgWINDOW -- One of the limitations of the way cgWindow
stores commands is that keyword values are evaluated
at the time the graphics command is added to the window.
This precludes the use of expressions as keywords and prevents
you from doing things like using a different line thickness
in a PostScript file, or using the Greek function to
supply a Greek symbol for a graphics title.
I have come up with a method for working around this limitation.
It involves a new keyword to the cgWindow command, named WKYEXPR.
With this keyword you list the command keywords that should be
"evaluated" at run-time. The actual keyword value will need to
be a string that can be "evaluated" with the IDL Execute command
to produce a "real" keyword value at the time the command is
executed. This allows you to set different values for the window
display and for the PostScript display, for example. The WKYEXPR
keyword can be used with any CGS routine that supports the current
WINDOW keyword.
Here is how you might use it, for example, with the cgPlot command.
cgPlot, cgDemoData(1), WKWEXPR=['TITLE', 'THICK'], /WINDOW, $
TITLE='"Greek Psi Symbol (" + Greek("psi") + ")"', $
THICK='(!D.Name EQ "PS") ? 3.5 : 1.0', $
CHARSIZE=1.5, COLOR='NAVY'
I've written an article to explain this in more detail:
http://www.idlcoyote.com/cg_tips/kwexpressions.php
The updated program is here:
http://www.idlcoyote.com/programs/cgwindow.pro
The entire Coyote Library can be downloaded here:
http://www.idlcoyote.com/programs/coyoteprograms.zip
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
|
|