Re: working on multiple z buffers at once? [message #75059] |
Wed, 16 February 2011 07:23  |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
NG isn't an option yet (sysadmin hasn't gotten around to upgrading. I think it's time to prod him). CG would probably work if there was a programmatic way to tell a cgWindow "output the display to a postscript file", but I don't think there is (David?).
But David's point that the Z buffer is persistent even when you switch to another device and back is a good one - I think that I can make do by just using the Z buffer for the big grid, just outputting to postscript for the individual plots, and using ImageMagick to make .pngs of the individual plots.
-Jeremy.
|
|
|
Re: working on multiple z buffers at once? [message #75065 is a reply to message #75059] |
Wed, 16 February 2011 04:29   |
Gray
Messages: 253 Registered: February 2010
|
Senior Member |
|
|
On Feb 15, 10:15 pm, Jeremy Bailin <astroco...@gmail.com> wrote:
> So I'm looping through files, and after processing each file I have a plot. In the end I want to have:
> 1. A copy of the plot for each file.
> 2. A master figure that has the plots for all the files on it, in a nice grid.
> I'd like these as both postscript and .png ideally, but I at least need postscript of the individual plots and a .png of the master figure.
>
> So what I'd really like to do is to be able to output to several different postscript files at once. Barring that, I'd like to be able to output to several different z buffers at once.
>
> My best idea so far is to create a z buffer, write the first plot in the grid to it, tvread() it out to a variable, then plot out the first individual plot to a postscript and/or png file, then re-create the old z buffer by putting the image back in, add the second plot, tvread() it back to a variable, etc....
>
> Which, I'm sure, would work. But seems a little less than elegant. Does anyone have any better suggestions?
>
> -Jeremy.
Hm. David will have to comment, but I might have been wrong about
using CG windows in a buffer... but you can definitely do that with
NG! Hopefully your plots don't have too many points...
|
|
|
Re: working on multiple z buffers at once? [message #75066 is a reply to message #75065] |
Wed, 16 February 2011 04:27   |
Gray
Messages: 253 Registered: February 2010
|
Senior Member |
|
|
On Feb 15, 10:15 pm, Jeremy Bailin <astroco...@gmail.com> wrote:
> So I'm looping through files, and after processing each file I have a plot. In the end I want to have:
> 1. A copy of the plot for each file.
> 2. A master figure that has the plots for all the files on it, in a nice grid.
> I'd like these as both postscript and .png ideally, but I at least need postscript of the individual plots and a .png of the master figure.
>
> So what I'd really like to do is to be able to output to several different postscript files at once. Barring that, I'd like to be able to output to several different z buffers at once.
>
> My best idea so far is to create a z buffer, write the first plot in the grid to it, tvread() it out to a variable, then plot out the first individual plot to a postscript and/or png file, then re-create the old z buffer by putting the image back in, add the second plot, tvread() it back to a variable, etc....
>
> Which, I'm sure, would work. But seems a little less than elegant. Does anyone have any better suggestions?
>
> -Jeremy.
I think you want to use CG or NG for this - you want buffered objects
which can each store figures and that you can reference by name. CG
will almost certainly be faster. Set up however many cgWindows you
need.
|
|
|
Re: working on multiple z buffers at once? [message #75067 is a reply to message #75066] |
Wed, 16 February 2011 04:24   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jeremy Bailin writes:
> So I'm looping through files, and after processing each file I have a plot. In the end I want to have:
> 1. A copy of the plot for each file.
> 2. A master figure that has the plots for all the files on it, in a nice grid.
> I'd like these as both postscript and .png ideally, but I at least need postscript of the individual plots and a .png of the master figure.
>
> So what I'd really like to do is to be able to output to several different postscript files at once. Barring that, I'd like to be able to output to several different z buffers at once.
>
> My best idea so far is to create a z buffer, write the first plot in the grid to it, tvread() it out to a variable, then plot out the first individual plot to a postscript and/or png file, then re-create the old z buffer by putting the image back in, add the second plot, tvread() it back to a variable, etc....
>
> Which, I'm sure, would work. But seems a little less than elegant. Does anyone have any better suggestions?
Good luck! :-)
You can have one open PostScript file at a time.
You can return as often as you like to your Z
buffer, if you just don't erase it when you come
back to it.
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.")
|
|
|
Re: working on multiple z buffers at once? [message #75128 is a reply to message #75059] |
Thu, 17 February 2011 06:42   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jeremy Bailin writes:
> NG isn't an option yet (sysadmin hasn't gotten around to upgrading. I think it's time to prod him). CG would probably work if there was a programmatic way to tell a cgWindow "output the display to a postscript file", but I don't think there is (David?).
You can now use the CREATE_PS keyword with cgControl
to pass the name of a PostScript file. Using this keyword
will automatically and programmatically cause the cgWindow
app to create a PostScript file of its commands.
IDL> cgPlot, cgDemoData(1), /Window
IDL> cgControl, Create_PS='test.ps'
Get an updated Library, because I found an odd problem in
cgDefCharsize that I still don't understand. I modified
cdDefCharsize recently to use Str_Size to create default
character sizes for the Coyote Graphics routines. This
allows the text to get bigger when the window gets bigger,
and vice versa. But, for reasons I don't fully understand,
using Str_Size in a PostScript context causes an extra
page of PostScript to be produced. For the moment, I've
disabled its use in PostScript, which--as it happens--I
didn't need anyway. So, the problem is fixed, although I
don't completely understand why. :-)
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.")
|
|
|
|
Re: working on multiple z buffers at once? [message #75176 is a reply to message #75128] |
Fri, 18 February 2011 08:25  |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
> You can now use the CREATE_PS keyword with cgControl
> to pass the name of a PostScript file. Using this keyword
> will automatically and programmatically cause the cgWindow
> app to create a PostScript file of its commands.
By the way, I don't suppose you could add equivalent controls to programmatically create the raster files? :-)= (or is the answer: just span a call to convert yourself!)
-Jeremy.
|
|
|