Bug in Trigrid ? [message #1854] |
Thu, 24 March 1994 18:55  |
hahn
Messages: 108 Registered: November 1993
|
Senior Member |
|
|
I found some erroneous data being generated on the boundary
by trigrid when interpolating x,y,z triplets into a matrix.
The problem depends on the system you run IDL on:
When you run the following program on a rs6000 or a pc you
get incorrect results while running on a sun you get
correct results. The problem occurs with version 3.1 and 3.5.1
of IDL (I don't have access to older version).
I assume that triangulate/trigrid is used very much I wonder
if there is a bug in IDL or in my program:
pro ttrig
x = findgen(30) ; generate some artifical data to show problem
y = x
Z = x # y + 200 ; matrix to plot as reference.
surface, z, zrange=[ 0, 1000 ]
; Now pick 30 values randomly choosen to feed into trigrid
seed = 12345
i = 30 * randomu ( seed, 30 )
j = 30 * randomu ( seed, 30 )
a = x(i)
b = y(j)
c = a * b + 200
triangulate, a, b, tr
zmat = trigrid ( a, b, c, tr )
; zmat should be very close the the original matrix Z above
; or am I missing something ???
window, 1 ; open another window for a-b comparison
surface, zmat, zrange=[ 0, 1000 ] ; qed
end
|
|
|