comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Bug in Trigrid ?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Bug in Trigrid ? [message #1854] Thu, 24 March 1994 18:55 Go to next message
hahn is currently offline  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 Go to previous message
manizade is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: reading JCAMP files
Next Topic: Looking for material on PV-WAVE

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:24:37 PDT 2025

Total time taken to generate the page: 0.19939 seconds