[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grid3 and ill-conditioned matrix stuff



Hello all,

I'm trying to grid3() some oceanographic data. Of course, grid3 wont let
me because it says my data is "Ill-conditioned matrix or all nodes
co-planar."
To get around this, I fooled with the DTOL keyword as per docs. This is what
I got foolin' around. Note xData, yData, and zData are all in same units
(meters), but delta in x and y is large (x and y are utm surface coords
range is about ~500 meters and data is randomly scattered) compared with
delta in z (depth, ranges 0-15 meters and data is on 0.1 m intervals).
My vData values are small with small delta (ranges ~ 2.0-4.0).
I just can't find a way to grid this data gridded!!

I just kept adding 0's to DTOL to see if I could get it to work, after
a bunch of tries with "ill-conditioned" error, I started to see other
errors show up:

IDL> vGrid = grid3(xData, yData, zData, vData,
DTOL=0.0000000000000000000000000000000000001D)
% GRID3: Ill-conditioned matrix or all nodes co-planar.
% Execution halted at:  TBINTERP3D         64
F:\AppFiles\dev\libs\IDL\tbowers\tbMathLib\tbInterp3D.pro
%                       TBDATAINTERPXYZVFROMFILES   86
F:\AppFiles\dev\libs\IDL\tbowers\tbDataLib\tbDataInterpXYZVFromFiles.pro
%                       $MAIN$
IDL> vGrid = grid3(xData, yData, zData, vData,
DTOL=0.00000000000000000000000000000000000000001D)
% GRID3: Ill-conditioned matrix or all nodes co-planar.
% Execution halted at:  TBINTERP3D         64
F:\AppFiles\dev\libs\IDL\tbowers\tbMathLib\tbInterp3D.pro
%                       TBDATAINTERPXYZVFROMFILES   86
F:\AppFiles\dev\libs\IDL\tbowers\tbDataLib\tbDataInterpXYZVFromFiles.pro
%                       $MAIN$
% Program caused arithmetic error: Floating underflow

Note that in 2nd try here, I still get ill-conditioned error but also
start to see a floating underflow error. So, I pressed on, adding more 0's
with each try. Eventually I got to:

IDL> vGrid = grid3(xData, yData, zData, vData,
DTOL=0.000000000000000000000000000000000000000000001D)
% GRID3: Ill-conditioned matrix or all nodes co-planar.
% Execution halted at:  TBINTERP3D         64
F:\AppFiles\dev\libs\IDL\tbowers\tbMathLib\tbInterp3D.pro
%                       TBDATAINTERPXYZVFROMFILES   86
F:\AppFiles\dev\libs\IDL\tbowers\tbDataLib\tbDataInterpXYZVFromFiles.pro
%                       $MAIN$
% Program caused arithmetic error: Floating underflow
IDL> vGrid = grid3(xData, yData, zData, vData,
DTOL=0.0000000000000000000000000000000000000000000001D)
% Program caused arithmetic error: Floating divide by 0
% Program caused arithmetic error: Floating underflow
% Program caused arithmetic error: Floating illegal operand
IDL> help, vGrid, /STRUCT
VGRID           FLOAT     = Array[25, 25, 25]
IDL> print, max(vGrid)
     0.000000

Aha! Finally no "ill-cond." error and vGrid is returned from the
grid3() call, BUT, get more errors and vGrid is all 0's.

Persevering, I kept setting DTOL ridiciously lower jsut to see what'd
happen:

IDL> vGrid = grid3(xData, yData, zData, vData,
DTOL=0.000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000001D)
% Program caused arithmetic error: Floating divide by 0
% Program caused arithmetic error: Floating illegal operand
IDL> print, max(vGrid)
     0.000000

Hmmm... The Floating underflow disappeared. vGrid is still 0'd out.

And my info...
IDL> print, !version
{ x86 Win32 Windows 5.3.1 Feb 23 2000}

So, finally to the question. How in the world can I get my data
gridded?? Do I have to normalize the data in some way?


An example of my data. xData, yData, zData, vData in 1st, 2nd,
3rd, 4th columns respectively. xData, yData, zData are in
same units (meters).

xData         yData            zData      vData

573777.43   4344653.40   00.8   2.82174045
573777.43   4344653.40   00.9   2.82353044
573777.43   4344653.40   01.0   2.81546044
573777.43   4344653.40   01.1   2.81331551
573777.43   4344653.40   01.3   2.80542541
573777.43   4344653.40   01.4   2.80256045
573777.43   4344653.40   01.5   2.79836047
573777.43   4344653.40   01.6   2.79995549
573777.43   4344653.40   01.7   2.79396546
573777.43   4344653.40   01.8   2.79660046
573777.43   4344653.40   01.9   2.79473543
573777.43   4344653.40   02.0   2.79735047
573777.43   4344653.40   02.1   2.78900546
573777.43   4344653.40   02.2   2.78365546
573777.43   4344653.40   02.3   2.78647548
573777.43   4344653.40   02.4   2.77646548
573777.43   4344653.40   02.5   2.77406549
573733.55   4344680.41   00.7   2.90471047
573733.55   4344680.41   00.8   2.90716046
573733.55   4344680.41   00.9   2.90973544
573733.55   4344680.41   01.0   2.91222548
573733.55   4344680.41   01.1   2.90891045
573733.55   4344680.41   01.2   2.91715544
:
:
etc.

BTW, since data is collected on (actually processed to) even multiples
of 0.1 meter (but not necessarily on EVERY 0.1 m interval), there are
never 2 data points at any 3-D (xyz) coordinate. Althouth, as you can
see, the x and y coords do repeat alot because we take alot of data at
each sampling "station".

Thanks very much in advance...
tb