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
|
|
|
Re: Bug in Trigrid ? [message #1949 is a reply to message #1854] |
Mon, 28 March 1994 07:48  |
manizade
Messages: 9 Registered: October 1993
|
Junior Member |
|
|
I have noticed another sort of unattractive behavior in trigrid.
Given an input set of points, I asked it to perform a linear
interpolation. The interpolation produced values that were
outside of the range of the input data. The magnitude of the
discrepancy increased as the number of points in the output
grid was increased.
I posted the details months ago, and got a resoundingly silent
response. I don't use trigrid because I don't trust what it is
doing. I am considering writing my own routine to do trigrid's job.
I would be thankful if anyone has details on the method that
trigrid is trying to implement. Sources of information on the
general topic of gridding/interpolation of random data would also
be of interest.
--
Serdar S. Manizade <manizade@aol3.wff.nasa.gov>
Airborne Oceanographic Lidar Project
NASA/GSFC/Wallops Flight Facility, Wallops Island, VA
|
|
|