Hi all,
I would like to know how can I define a FlatField with a range component
taking table values (no topology). I tried the following:
class TestTableValuesAsRange {
public TestTableValuesAsRange()
throws RemoteException, VisADException
{
// Generate the index
RealType index = RealType.getRealType("index");
Set index_set = new Integer1DSet(index, 5);
// My range component
List1DSet list_set =new List1DSet(new float[] {1.0f, 2.0f, 3.0f},
RealType.getRealType("list_of_system_ids"), null, null);
RealType id=RealType.getRealType("System_id", null, list_set);
// Create a FunctionType ( index -> id )
FunctionType data_type = new FunctionType(index, id);
// Create the flat field
FlatField aFlatField = new FlatField( data_type, index_set);
// Put some samples values
aFlatField.setSamples(new double [][] {{1.0, 1.0, 2.0, 1.0, 3.0}});
// Print out
System.out.println("Results is " + aFlatField);
}
public static void main (String[] args)
throws RemoteException, VisADException
{
TestTableValuesAsRange myTest = new TestTableValuesAsRange();
}
}
but, i'm always getting:
Exception in thread "main" visad.UnimplementedException:
List1DSet.valueToIndex
at visad.List1DSet.valueToIndex(List1DSet.java:82)
at visad.FlatField.packValues(FlatField.java:932)
at visad.FlatField.setSamples(FlatField.java:700)
at visad.FlatField.setSamples(FlatField.java:652)
at TestTableValuesAsRange.<init>(TestTableValuesAsRange.java:26)
at TestTableValuesAsRange.main(TestTableValuesAsRange.java:36)
Do I need to sub-class List1DSet in order to use it? Can I do the same
thing using something else?
Thanks,
Sylvain Létourneau
Research Officer
National Research Council of Canada
Montreal road, Building M-50
Ottawa, Ontario Canada K1A 0R6
Phone:(613) 990-1178
Fax:(613) 952-0215