Interesting Filled Contour Problem [message #79911] |
Mon, 16 April 2012 12:12 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
I ran into an interesting filled contour problem today.
The data set was large (4051,2032). Rendering it as a
filled contour plot with the CELL_FILL keyword was taking
on the order of 80-100 seconds to render. (Slow even by
function graphics standards, and this is direct graphics!)
Since there was no particular reason to use the CELL_FILL
keyword, whose algorithm is always slower than the normal
FILL keyword, I tried using FILL. The plot rendered in
about 5 seconds, but didn't look anything LIKE the previous
plot! Weird.
In a round-about way, I discovered that if I made sure
that the minimum value of the data was really zero (the
Min function reported the value as zero!), then the
filled contour plot would render exactly like the previous
plot.
Print, Min(data)
0.000000
data = data > 0.0
Even weirder, but now at least it was rending in about 5 seconds
or 20 times faster than before. I've seen this before, but never
managed to figure out a solution. Has anyone else seen this?
Any, to make this as fast as possible, I decided to render
the plot, not as a filled contour plot, but as a partitioned
image. That plot rendered in 0.2 seconds and looked exactly
like the previous two plots. So, that's not too bad: 100s -> 0.2 s.
I've written about this here, and made the data available
if you want to play with it.
http://www.idlcoyote.com/graphics_tips/fastfill.php
Anyone who can explain that Min(data) thing will get an
automatic invite to the IDL Expert Programming Association
annual meeting this Fall.
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.")
|
|
|