[netcdf-java] What is necessary to write a georeferenced data set?

Is there a document that outlines the requirements for writing a NetCDF so
that the data contained therein can later be read as GeoGrids and/or
GridDatatypes?  For example I want to be able to do this:

    GridDataset gridDataset = GridDataset.open(netcdfFilePath);
    GridDatatype gridDatatype =
gridDataset.findGridDatatype("gridded_data_name");
    Array dataArray = gridDatatype.readDataSlice(monthIndex, -1, latIndex,
lonIndex);

My problem is that I have written data which have lon, lat, time dimensions
and corresponding lon, lat, and time variables, but after I open the NetCDF
as a GridDataset I can't get the data out as a GeoGrid or GridDatatype.  I
assume that the issue is that while creating/writing the NetCDF I've not
done something required to make it so that the data can be read as desired,
so I'm looking for a list of requirements I can satisfy which will make
this so.

The Javadoc is confusing in that the interface
​for ​
​​
GridCoordSystem mentions
​the​
 following assumptions​
:

X and Y are 1 or 2 dimensional
T is 1 or 2 dimensional. The 2D case is that it depends on runtime.
We can create Dates out of the T and RT coordinate values.
Z, E, RT are 1-dimensional
An optional VerticalTransform can provide a height or pressure coordinate
that may be 1-4 dimensional.

However
​the Javadoc ​
for the corresponding
​
​
GridCoordSystem ​
class
​only mention​
s t
​he​
​
s
​e assumptions​
:

is georeferencing (has Lat, Lon or GeoX, GeoY axes)
x, y are 1 or 2-dimensional axes.
z, t are 1-dimensional axes.​

​I have written NetCDF files which ​don't adhere completely to either of
the above sets of assumptions, however variables contained within those
NetCDF files can be read as GeoGrids/GridDatatypes.  It'd be nice to have
some clarity as to what is and is not required to create a NetCDF that can
be treated as a GridDataset containing data that can be referenced as a
GeoGrid/GridDatatype -- can anyone clarify this?

Thanks in advance for any suggestions or clarification.

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