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] Differing results reading an unlimited dimension between Java and C (?) binary distribution

Hi Jean-Michel:

Thats pretty strange. Can you put the file on an ftp or http server so we can 
look at it?

BTW, which version on netcdf-java are you using?


Jean-Michel.Perraud@xxxxxxxx wrote:
Hi,

I have a lat/lon/time data set for which the lat dimension is unlimited. On 
disk the file is ~14 GiB. It was created using the Java API. More precisely, a 
C# application calling netCDF-Java through IKVM; worked beautifully. Colleagues 
and I tried to read this file from other tools (R via Rnetcdf, ncdump, etc.). 
The values of the lat variable are not read correctly (either all zeroes, or a 
mix with other numbers presumably from other variables).

Has anyone had similar issues? This is really not a blocking issue and can live 
with it, but I am intrigued. Below are sample code and CDL. I cannot 
investigate more in-depth due to approaching milestones, but happy to provide 
clarifications if needed.
I am reluctant to cross-post for now, but this may well be an issue outside of 
the Java API.

Cheers

### From IronPython or Jython, using the Java API, read works as expected:
clr.AddReferenceToFileAndPath(r"C:\lib\netcdf\netcdfAll-4.0.dll")
clr.AddReferenceToFileAndPath(r"C:\bin\ikvm\bin\IKVM.OpenJDK.ClassLibrary.dll")
from ucar.nc2 import NetcdfFile
netcdfFile = NetcdfFile.open(r"\\somename\tmp\scenarioA.nc")
latVar = netcdfFile.findVariable("lat")
latArray = latVar.read()
latArray
# prints:
# <ucar.ma2.ArrayFloat+D1 object at 0x000000000000002B [-39.097 -39.047 -38.997 
-3
# 8.947 -38.897 -38.847 -38.797 -38.747 -38.697 -38.647 -38.597 -38.547 -38.497 
-3
netcdfFile.close()

### using ncdump from a linux distro on a ncks subset. Same behavior without 
the full 14GB data set.

netcdf smallScenarioA {
dimensions:
        lat = UNLIMITED ; // (4 currently)
        lon = 9 ;
        time = 40907 ;
variables:
        char cellId(lat, lon) ;
                cellId:long_name = "Cell ID" ;
        float lat(lat) ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
                lat:standard_name = "latitude" ;
        float lon(lon) ;
                lon:units = "degrees_east" ;
                lon:axis = "X" ;
                lon:standard_name = "longitude" ;
        float runoff(lat, lon, time) ;
                runoff:long_name = "runoff" ;
                runoff:units = "mm" ;
                runoff:missing_value = -9999.f ;
                runoff:_FillValue = -9999.f ;
        int time(time) ;
                time:units = "days since 1895-01-01" ;
                time:axis = "T" ;
                time:standard_name = "time" ;
                time:long_name = "time" ;

// global attributes:
                :history = "Sat May 30 19:58:55 2009: ncks -d lat,30,33 -d 
lon,160,168 scenarioA.nc smallScenarioA.nc" ;
data:

 cellId =
  "",
  "",
  "",
  "" ;

 lat = 0, 0, 0, 0 ;

 lon = 146.6, 146.65, 146.7, 146.75, 146.8, 146.85, 146.9, 146.95, 147 ;
_______________________________________________
netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/



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