Re: Why?

OK...we're trying to create a Gridded1DSet with the units "seconds" for
time. I don't know why it keeps creating units of Kelvin for the set.
Below is the line we use to create validSet:

Gridded1DSet validSet = new Gridded1DSet(wantedMathType, validTimeSet,
                                         validTimeSet[0].length);

wantedMathType is a MathType of the data we want ie. MaxTemp whose units
are Celsius. Am I right in this respect? Do we want wantedMathType to be
"Time" instead of "MaxTemp"? When I did a getSetUnits(), we got "Cel"
which I assume is short for Celsius.

The question is whether the wantedMathType should be the "time" or the
wanted type of the range tuple ie. MaxTemp or MinTemp.

I tried using the other Gridded1DSet constructor like this:

//trying to use the same units as existing field
Unit[] unitArray = flatField.getDomainSet().getSetUnits();
Gridded1DSet validSet = new Gridded1DSet(wantedMathType, validTimeSet,
                                         validTimeSet[0].length, null,
                                         unitArray, null);

This in turn gave me the following exception:

visad.UnitException: Set: Units must be convertable with DomainType
default Units
        at visad.Set.<init>(Set.java:157)
        at visad.SimpleSet.<init>(SimpleSet.java:57)
        at visad.SampledSet.<init>(SampledSet.java:46)
        at visad.GriddedSet.<init>(GriddedSet.java:72)
        at visad.Gridded1DSet.<init>(Gridded1DSet.java:64)
        at visad.Gridded1DSet.<init>(Gridded1DSet.java:52)
        at
au.gov.bom.aifs.autotaf.DataRepresentation.FieldManipulation.interpolateProjection(FieldManipulation.java:248)
        at
au.gov.bom.aifs.autotaf.DataRepresentation.FieldManipulation.interpolateField(FieldManipulation.java:306)
        at progTest.main(progTest.java:21)

I don't quite understand what this message means. Can someone please
explain? I need to know how to create a set with the right MathType/Units
and then be able to resample it so that MinTemp and MaxTemp use Celsius.

Thanks in advance.

Eug.

   _--_|\     Eugene Tan <E.Tan@xxxxxxxxxx>
  /      \    AutoTAF Project Developer 
  \_.--.*/    Bureau of Meteorology, Melbourne, VIC 3001, Australia
        v     Telephone: +613 9669 4652

On Mon, 13 Dec 1999, Bill Hibbard wrote:

> This Exception is being thrown when it tries to convert Units
> from 'validSet' to the domain Set of FlatField 'f'.  I am not
> an expert on CDL, but it looks like the domain of 'f' is
> Time with Units 's' (for seconds).  From the UnitException
> message I'd guess that 'validSet' must have Units 'K' (for
> Kelvin).  That is, you are trying to resample a field over
> a time domain to a set of temperature values.  Make sure that
> 'validSet' is a set of times with 's' Units.  You could do
> a print of 'validSet' at this point to see if its Units are
> 'K'.
> 
> Please let me know if still have problems.
> 
> 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
> 




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