Re: Why?

Can anyone please explain why the resample method in FieldImpl keeps
trying to convert the units for our variables? This is what the CDL file
looks like before it's converted into netCDF:

netcdf taf {
    Time = unlimited;
    double Time(Time);
    double MinTemp(Time);
      MinTemp:long_name = "minimumTemperature";
      MinTemp:units = "celsius";
    double MaxTemp(Time);
      MaxTemp:long_name = "maximumTemperature";
      MaxTemp:units = "celsius";
      Time = 0, 10800, 21600, 32400, 43200, 54000, 64800, 75600, 86400,
             97200, 108000, 118800, 129600, 140400, 151200, 162000;
      MinTemp = NaN,NaN,37,23,30,32,NaN,30,31,31,31,31,18.2,21.1,NaN,NaN;
      MaxTemp = NaN,20,25,29,29,26,22,20,18,18,21,25,24,NaN,NaN,NaN;

The program throws an exception at this line:

predictedField = (FieldImpl)f.resample(validSet, Data.NEAREST_NEIGHBOR,

This is what we get from printStackTrace(): 

visad.UnitException: Attempt to convert from unit "K" to unit "s"
        at visad.DerivedUnit.toThis(
        at visad.ScaledUnit.toThis(
        at visad.OffsetUnit.toThis(
        at visad.OffsetUnit.toThis(
        at visad.Unit.toThis(
        at visad.Unit.transformUnits(
        at visad.FlatField.resample(
        at progTest.main(

If we remove all the units from our CDL file, it works fine. We've also
tried using "kelvin" instead of "celsius" but ended up with the same
results. We've been trying to find a way to fix this up but have come to a
dead end. Can someone please help?



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

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