Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
"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
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/
Thx alot :) Now takes one minute to plot instead of four and a half. Quite a lot faster :)