Re: Problems to get data into VisAD

Hi Olav,

> Here you can see the complete message.
> 
> java.lang.NullPointerException
>         at visad.Gridded3DSet.makeIsoLines(Gridded3DSet.java:1695)
>         at visad.ShadowType.makeContour(ShadowType.java:3525)
>         at visad.java2d.ShadowTypeJ2D.makeContour(ShadowTypeJ2D.java:286)
>         at
> visad.ShadowFunctionOrSetType.doTransform(ShadowFunctionOrSetType.java:2058)
>         at
> visad.java2d.ShadowFunctionOrSetTypeJ2D.doTransform(ShadowFunctionOrSetTypeJ2D.java:98)
>         at
> visad.java2d.DefaultRendererJ2D.doTransform(DefaultRendererJ2D.java:101)
>         at visad.java2d.RendererJ2D.doAction(RendererJ2D.java:140)
>         at visad.DisplayImpl.doAction(DisplayImpl.java:1521)
>         at visad.java2d.DisplayImplJ2D.doAction(DisplayImplJ2D.java:306)
>         at visad.ActionImpl.run(ActionImpl.java:243)
>         at visad.util.ThreadPool$ThreadMinnow.run(ThreadPool.java:95)

Thank you. Assuming line numbers match between our JVMs
(not always true), the fix for this Exception should be in:

  ftp://ftp.ssec.wisc.edu/pub/visad-2.0/Gridded3DSet.java

> Thank you for your explanation.  I have switched to UnionSet. Still now
> I have a problem to get my data  (e.g. temperature)  into the FlatField.
> When I use this code
> 
> UnionSet finalSet = new UnionSet(reader.getCoordinateTuple (),domainSet);
> FlatField val_ff = new FlatField (funcDomainTemperature, finalSet);
> 
> for(i=0; i<axis.size (); i++)
>       {
>          double[][] variableValues = (double[][])variable.get (i);
>          int y = variableValues.length-1;
> 
>          double[][] tempSamples = new double[1][variableValues[y].length];
>          for(j = 0; j < variableValues[y].length; j++)
>          {
>             tempSamples[0][j] =  variableValues[y][j];
>          }
> 
>          val_ff.setSamples (tempSamples);
> 
>       }
> 
> I get the following message
> 
> visad.FieldException: setSamples: bad array length
>         at visad.FlatField.setSamples(FlatField.java:697)
>         at visad.FlatField.setSamples(FlatField.java:652)
>         at
> de.cle.visad.loader.TecPlotAdapterGraphicsTest01.main(TecPlotAdapterGraphicsTest01.java:130)

This error means that variableValues[y].length (the length
of tempSamples[0]) is not equal to the number of samples in
your UnionSet. Note that it is strange that your code is
calling val_ff.setSamples() 'axis.size' times inside your
loop. Since you only have one FlatField val_ff, you should
only call setSamples() once. And the array you pass it should
have values for all the samples in your UnionSet (the sum of
the numbers of samples in its constituents).

Good luck,
Bill