Re: ps_start and cgDCBar error [message #78808] |
Thu, 29 December 2011 07:11  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Dave writes:
> when I use ps_start and cgDCbar program with the latest coyote
> package. I got following errors:
>
> For cgDCbar, there is line
>
> 'PS': IF supportTrueColorTHEN DEVICE, DECOMPOSED=0
>
> which supportTrueColor is not defined.
Yikes, yes, a change from a couple of days ago was incorrectly
implemented. I tested the change then, but not in PostScript. Fixed
now.
> For ps_start.pro, I fin this program can change filename, like:
>
> outfilename = 'D:\test.ps'
> ps_start, filename=outfilename
> print, outfilename
>>> 'test.ps'
This problem is about 100 years old! Well, maybe not that
old, but it goes deep into the bowels of the very first
object program I ever wrote: fsc_psconfig__define. I had
a look in there, but it gives me the creeps. Is it possible
that anyone has written worse code in a more important and
heavily used program!?
Anyway, since I was fixing this, I just decided I would
fix it at the PS_Start level, and while I was at it, I
would fix a long-standing annoyance with PS_Start. Namely,
I always call the darn thing like this:
PS_Start, 'test.ps'
So, I have defined both a filename parameter and a
FILENAME keyword for this routine, so you can continue
to use it the way you have always used, it. Or you
can use it the way that feels most natural to me.
In either case, your filename variable won't be
changed. :-)
Since I was checking things in, I'll just tell you
about another change I made to cgContour. I've been
doing a lot of map projection stuff lately, and I
prefer to use Map_Proj_Init for my map projections,
rather than the ancient Map_Set.
Unfortunately, this makes it quite a bit more
difficult to draw map grids, continental outlines, etc
on my images, because these routines have not really
been set up to work with Map_Proj_Init. I've fixed
a number of these programs with my Coyote Graphics
map projection routines, but one that still bothered
me was putting contour plots onto map projections,
a very common thing to do.
If you use Map_Set, then you can just set the OVERPLOT
keyword on cgContour and the contours go onto the
map projection like a champ. Not so when you use
Map_Proj_Init, because your plot needs to be set up
in projected XY map coordinates, which is a fairly
technical thing for a lot of people to do.
But, since all of this is done for you in my cgMap
object, I just decided that I would add a MAP_OBJECT
keyword to cgContour, so that I could pass the
map object that sets up the map projection space
to the contour plot, and the contour plot could use
that to both set up the projected map coordinate
space, and to convert the longitude and latitude
vectors you get from may scientific data files to
the proper XY projected grids you need for the
contour plot to go onto the map correctly.
Anyway, this works like a champ for setting up
map projection spaces and drawing contours, both
filled and otherwise, onto them.
You can find the latest Coyote Library programs in
the usual places:
http://www.idlcoyote.com/programs/zip_files/coyoteprograms.z ip
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.")
|
|
|
|