[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java UnitFormatManager exception



Mark A Ohrenschall wrote:

Exception in thread "main" java.lang.NoClassDefFoundError: 
ucar/units/UnitFormatManager
       at ucar.nc2.dataset.conv.SimpleUnit.<clinit>(SimpleUnit.java:39)
       at ucar.nc2.dataset.grid.GridCoordSys.makeTimes(GridCoordSys.java:504)
       at ucar.nc2.dataset.grid.GridCoordSys.<init>(GridCoordSys.java:134)
       at ucar.nc2.dataset.grid.GridDataset.addGeoGrid(GridDataset.java:110)
       at ucar.nc2.dataset.grid.GridDataset.<init>(GridDataset.java:96)
       at com.barrodale.netcdfSupport.LoadNetCDF.load(LoadNetCDF.java:725)
       at datablade.Test.<init>(Test.java:38)
       at datablade.Test.main(Test.java:49)

An ncdump of the offending netCDF file being read by the Java program:

netcdf sst100_anal_temp {
dimensions:
       time = UNLIMITED ; // (31 currently)
       lat = 141 ;
       lon = 360 ;
variables:
       float anal_temp(time, lat, lon) ;
               anal_temp:long_name = "Analysis Temperature" ;
               anal_temp:units = "DegC" ;
               anal_temp:scale_factor = 0.1f ;
               anal_temp:missing_value = 999.9f ;
               anal_temp:_FillValue = 9999.f ;
               anal_temp:valid_min = -10.f ;
               anal_temp:valid_max = 70.f ;
       float lat(lat) ;
               lat:long_name = "Latitude" ;
               lat:units = "degrees_north" ;
       float lon(lon) ;
               lon:long_name = "Longitude" ;
               lon:units = "degrees_east" ;
       float time(time) ;
               time:long_name = "Time" ;
               time:units = "hours since 1997-01-01" ;

// global attributes:
               :title = "SST 100 KM FIELD" ;
               :history = "Thu Sep 25 12:02:58 2003: ncatted -a 
units,anal_temp,m,c,DegC sst100_anal_temp.nc\n",
   "Thu Sep 25 11:56:25 2003: ncks -v anal_temp sst100.nc sst100_anal_temp.nc" ;
}

Anyone have any ideas what might be causing this problem?

Thanks,

Mark

hi mark:

you need units.jar in your classpath to use the GeoGrid stuff

ftp://ftp.unidata.ucar.edu/pub/netcdf-java/units.jar

have a look at this page:

http://www.unidata.ucar.edu/packages/netcdf-java/