Problem with GridDataset - more infor

Brian Etheridge Brian.Etheridge at lostwax.com
Mon Apr 2 05:09:35 MDT 2007


Hi,
Reading my previous email, I meant to say that no GeoGrids are available
and therefore we do NOT go into the iteration.

I have compared a netcdf file of the same data which works ok in my code
with the one which fails.  There are just a couple of differences:
The extract that works has the following

   float sea_water_potential_temperature(t, z, y, x);
    :long_name = "sea_water_potential_temperature";
    :standard_name = "sea_water_potential_temperature";
    :units = "C";
    :_FillValue = NaN; // float
    :add_offset = 0.0; // float
    :scale_factor = 1.0; // float

And the extract which doesn't has:

   float temperature(t, z, y, x);
    :long_name = "temperature";
    :standard_name = "sea_water_potential_temperature";
    :units = "C";
    :_FillValue = 1.0E30; // float
    :missing_value = 1.0E30; // float

The variable name has been changed.

I guess the _FillValue is immaterial, but there are two offsets missing
in the extract which doesn't work:

    :add_offset = 0.0; // float
    :scale_factor = 1.0; // float

Could these be essential when constructing the GeoGrid objects?

Thanks
Brian

________________________________

From: owner-netcdfgroup at unidata.ucar.edu
[mailto:owner-netcdfgroup at unidata.ucar.edu] On Behalf Of Brian Etheridge
Sent: 02 April 2007 10:54
To: netcdfgroup at unidata.ucar.edu
Subject: Problem with GridDataset



Hi, 
I am using the NetCDF data format and utility library
(netcdfUI-2.2.16.jar) to transfer weather data across the web and to
render a weather map image in a web page.  I have an application which
can render the data correctly, however, certain data extracts are
failing when I try to use a ucar.nc2.dataset.grid.GridDataset.  Here's
the code:

NetcdfDataset nc = NetcdfDataset.openDataset(location); 
GridDataset gd = new GridDataset(nc); 
Iterator it = gd.getGrids().iterator(); 
while (it.hasNext()) {                  
        GeoGrid gg = (GeoGrid)it.next(); 
        etc... 
} 

The problem is that there are are no GeoGrids available in the
GridDataset, so the code does go into the iteration, and there should
be.

This problem could be the result of the way I am constructing the NetCDF
file because there is a complex subset and reduction mechanism being
used to extract a portion of the original NetCDF data provided by the UK
Meteorological Office.  Thus, I am quite confident that the original
NetCDF file is correct.

I am able to render the NetCDF data in both ncdump and ncbrowse and it
looks ok. 

What could be missing in the NetCDF file which would allow it to look ok
in ncdump and ncbrowse but that would prevent GeoGrids being produced
from a GridDataset of the same data?

Any assistance most gratefully received. 

Thanks 
Brian 



More information about the netcdfgroup mailing list