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

[netCDFJava #MYQ-535816]: NetCDF 4 files for GeoGrid



Hi Mike, Rob,

What version of the netCDF-Java library are you using? I tried opening both in 
the version 2.2.22.23 ToolsUI and the RUC_*.nc file opened fine, the map.*.nc 
file did not open at all and gave a "Premature EOF" message.

I then tried opening them in the 4.0 alpha version of ToolsUI and they both 
opened fine. So, I don't think it is a CF problem but rather that the 2.2.22 
library doesn't fully implement reading netCDF-4 files. It was a 
proof-of-concept implementation of the nc4 read. The netCDF-Java 4.0 library 
will fully support reading netCDF-4 files. It is currently an alpha release and 
the API may still change. 

John might have more details on how complete the nc4 read support is at the 
moment and how much things will/may change between now and the beta release.

If you want to try it out, you can get the netCDF-Java 4.0 alpha release at

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

Ethan

> I've attached the 2 files.
> 
> Rob Weingruber is reading these files into a Java app, and instantiating
> a GeoGrid object.
> 
> The RUC_1213889728540.nc file seems to work fine.
> 
> But the map.z.mdv.nc file does not work properly - the X and Y axes seem
> to be 2-dimensional, and of type lat/lon.
> 
> Any advice you can give us would be most appreciated.
> 
> Below is a snippet of the code Rob is using to determine the nature of
> the axes.
> 
> Thanks very much for your help.
> 
> Mike
> 
> -------------------------------------------------------------------------
> 
> This little snippet of code is what checks for a 1D x and y axis.  If
> theyre not 1D, we have a problem....
> 
> GridDataset gridDataset = GridDataset.open(
> tempFile.toURI().toURL().toString() );
> 
> GeoGrid geoGrid = gridDataset.findGridByName( "TMP" );
> GridCoordSys coordSys = (GridCoordSys) geoGrid.getCoordinateSystem();
> CoordinateAxis xAxisTemp = coordSys.getXHorizAxis();
> if( !( xAxisTemp instanceof CoordinateAxis1D ) )
> {
> _log.log( RapLogLevel.SEVERE, getClass().getName() + ":
> retrieve(...) received a GeoGrid with a non-1D XAxis!" );
> return null;
> }
> CoordinateAxis yAxisTemp = coordSys.getYHorizAxis();
> if( !( yAxisTemp instanceof CoordinateAxis1D ) )
> {
> _log.log( RapLogLevel.SEVERE, getClass().getName() + ":
> retrieve(...) received a GeoGrid with a non-1D YAxis!" );
> return null;
> }
> 
> For the nc files we're looking at, the X and Y axis are both
> CoordinateAxis2D...
> 
> 
> 


Ticket Details
===================
Ticket ID: MYQ-535816
Department: Support netCDF Java
Priority: Normal
Status: Open