On Tue, 14 Dec 1999, Bill Hibbard wrote:
> Yes, the MathType of the Gridded1DSet should be "Time" rather
> than "MaxTemp", since the Gridded1DSet is a set of time values
> rather than a set of temperature values. The domain set of this
> field is a time index into a set of temperatures, rather than a
> set of temperatures itself.
OK...I've tried using Gridded1DSet with the following constructor:
//field1 is a FieldImpl with FunctionType (Real):
//(Time) -> (MinTemp, MaxTemp)
Gridded1DSet validSet = Gridded1DSet(field1.getDomainSet().getType(),
field1.getDomainSet().getSamples(),
field1.getDomainSet().getLength());
And then resampled like this:
field1 = (FieldImpl)field1.resample(validSet, Data.WEIGHTED_AVERAGE,
Data.NO_ERRORS);
We were trying to create an identical field to the original one to learn
how to use the resample function but it seems to fail because all the
values that we get in the field become NaN.
Our data (with one NaN) looks like this:
time = 0, 10800, 21600, 32400, 43200, 54000, 64800, 75600, 86400, 97200,
108000, 118800, 129600, 140400, 151200, 162000;
MinTemp = 33,32,37,23,30,30,32,30,31,31,31,31,18,21,12,12;
MaxTemp = 30,NaN,20,25,25,20,25,27,28,29,30,29,27.5,30,30.4,15;
But our output is this:
time = 0, 10800, 21600, 32400, 43200, 54000, 64800, 75600, 86400, 97200,
108000, 118800, 129600, 140400, 151200, 162000;
MinTemp = NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN,
NaN, NaN, NaN;
MaxTemp = NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN,
NaN, NaN, NaN;
Thanks in advance.
Eug.
_--_|\ Eugene Tan <E.Tan@xxxxxxxxxx>
/ \ AutoTAF Project Developer
\_.--.*/ Bureau of Meteorology, Melbourne, VIC 3001, Australia
v Telephone: +613 9669 4652