resample error

Hello,

I have a huge data set that I represent as a FlatField with an
IrregularSet:

visad.Irregular3DSet: Dimension = 3 Length = 29160
  Dimension 0: Range = -113.36517 to -112.88341
  Dimension 1: Range = 40.001995 to 40.280354
  Dimension 2: Range = 1388.6608 to 18293.148

This Field looks fine. (toString gives me valid stuff)
I have defined a smaller Linear3DSet:

Linear3DSet: Length = 27
  Dimension 1: Length = 3 Range = -113.3 to -112.9
  Dimension 2: Length = 3 Range = 40.1 to 40.27
  Dimension 3: Length = 3 Range = 1400.0 to 18000.0

and tried to resample:

    FlatField field = (FlatField) raw_field.resample(set,
                                         Data.NEAREST_NEIGHBOR, 
                                         Data.NO_ERRORS);

but get the following Exception:

java.lang.NullPointerException
        at visad.Irregular3DSet.valueToTri(Irregular3DSet.java:225)
        at visad.Irregular3DSet.valueToIndex(Irregular3DSet.java:297)
        at visad.FlatField.resample(FlatField.java:3284)
...

Any ideas?

Also, the creation of the huge IrregularSet is very slow. Any tips for
speeding it up?  I'm using:

Irregular3DSet(MathType type, float[][] samples)

and the javadoc says: "topology is computed by the constructor." Is
there a better way to construct this set? I only need the field for
resampling from.

Thanks,
Doug

-- 
*----------------------------------------------------------------------*
| Doug Lindholm, Software Engineer          |  E-mail: lind@xxxxxxxx   |
| Research Applications Program             |   Phone: 303-497-8374    |
| National Center for Atmospheric Research  |                          |
| P.O. Box 3000                             |     There's no place     |
| Boulder, Colorado 80307-3000              |        like $HOME        |
*----------------------------------------------------------------------*