|
Re: Multilayered plots [message #45048 is a reply to message #45043] |
Tue, 02 August 2005 11:19  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
"Hrafnkell" <hrafnkellpalsson@hotmail.com> writes:
> Hello
>
> Every six hours i have to plot around 600 pictures from meteorological
> data (actually skewt diagrams) for weather forecast on the internet so
> efficient plotting routines are very desirable. Currently each picture
> is made in two phases, first a background is plotted (axes and some
> lines in the cartesian plane) with one routine and then that background
> is overplotted with another routine. The thing is that the background
> is the same for all of the pictures and it takes some time to plot so
> it's kinda stupid to plot it 600 times.
>
> You can see the pictures here
> http://www.os.is/~or/vedurspa/serkort.html by clicking one of the
> diamonds. The latter routine overplots the two fat irregular lines
> (blue and red).
>
> How can I weasel out of plotting the background every time? A routine
You could plot the background once and then save the draw window with
IMG = TVRD().
Then for each plot that you need to do, run "TV, IMG" and the
background will be returned to the original. The coordinate system is
preserved as long as you don't issue a PLOT or AXIS command, so you
can proceed to immediately OPLOT as much as you want.
In this case PLOTIMAGE is overkill because you've already established
the coordinate grid, and you don't need to rescale the image to fit
the draw window.
Craig
|
|
|
Re: Multilayered plots [message #45050 is a reply to message #45048] |
Tue, 02 August 2005 11:28  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Hrafnkell writes:
> Every six hours i have to plot around 600 pictures from meteorological
> data (actually skewt diagrams) for weather forecast on the internet so
> efficient plotting routines are very desirable. Currently each picture
> is made in two phases, first a background is plotted (axes and some
> lines in the cartesian plane) with one routine and then that background
> is overplotted with another routine. The thing is that the background
> is the same for all of the pictures and it takes some time to plot so
> it's kinda stupid to plot it 600 times.
>
> You can see the pictures here
> http://www.os.is/~or/vedurspa/serkort.html by clicking one of the
> diamonds. The latter routine overplots the two fat irregular lines
> (blue and red).
>
> How can I weasel out of plotting the background every time? A routine
> which cleanes specific parts of the display seems utopic...I tried to
> save the background as .png picture and then plotting the image with
> Craig Markwardt's plotimage routine. That was quite a lot faster but i
> was still plotting the background every time and besides, the
> background didn't look good at all (i presume that partly explains the
> speed-up)
I'd use smoke and mirrors. That is to say, a pixmap and "DEVICE, COPY"
Plot your background on a pixmap window that is the same size as your
"display window":
WSet, displayWindow
Window, /Free, /Pixmap, XSize=!D.X_Size, YSize=!D.Y_Size
pixmapID = !D.Window
Plot, backgroundStuff, ....
Then, when you are plotting your display windows, copy the background
from the pixmap:
WSet, newDisplayWindow
DEVICE, Copy=[0, 0, !D.X_Size, !D.Y_Size, 0, 0, pixmapID}
Plot, newStuff...
This is about 1000 times faster than TVing the image, and
probably 10,000 times faster than what you are doing now. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|