Re: Why?

Hi Eugene,

> 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;

Two suggestions:

1. First try resampling to:

  Set validSet = field1.getDomainSet();

2. Second, try using Gridded1DDoubleSet instead of
Gridded1DSet, and getDoubles() instead of getSamples().

If that doesn't fix it, then you'll have to put your code
and data somewhere that I get them to run your application
myself.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html

  • 1999 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: