NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: [netcdf-java] GridCoordSys introduces rounding error when converting from km to m and integer axis-type

  • To: Heiko Klein <Heiko.Klein@xxxxxx>
  • Subject: Re: [netcdf-java] GridCoordSys introduces rounding error when converting from km to m and integer axis-type
  • From: John Caron <caron@xxxxxxxxxxxxxxxx>
  • Date: Tue, 25 Aug 2009 17:49:16 -0600
Heiko Klein wrote:
The class ucar.nc2.dt.grid.GridCoordSys converts internally all projection-axes to km. But it seems like it does not convert the datatype to a float or double datatype and introduces therefore large rounding errors.

I have given my axes as m (in integer):
-3716017, -3712004, -3707991

The isRegular function of Coordinate1D sees (with a debugger attched) the values:
-3716, -3712, -3707
and as such fails with my approx. 4km grid-distance.



Best regards,

Heiko


this will be fixed in the next release of 4.1, thanks for reporting!



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