Another attempt... [Fwd: XYT and XYZT grid with only 1 X and 1 Y point in axis]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<body bgcolor="#ffffff" text="#000000">
Hi Folks,<br>
I wondering if this is a bug or a feature.&nbsp; getGrids recognizes grids
with only 1 X and 1 Y in the case below where there is no vertical
axis, but reports no grids when there is a vertical axis.&nbsp; Can somebody
explain why?<br>
To be sure, I ran the attached code using the 2.2.09 release.<br>
-------- Original Message --------
<table border="0" cellpadding="0" cellspacing="0">
      <th align="right" nowrap="nowrap" valign="baseline">Subject: </th>
      <td>XYT and XYZT grid with only 1 X and 1 Y point in axis</td>
      <th align="right" nowrap="nowrap" valign="baseline">Date: </th>
      <td>Mon, 08 Aug 2005 11:24:31 -0500</td>
      <th align="right" nowrap="nowrap" valign="baseline">From: </th>
      <td>Roland Schweitzer <a class="moz-txt-link-rfc2396E" 
      <th align="right" nowrap="nowrap" valign="baseline">To: </th>
      <td>netcdf-java <a class="moz-txt-link-rfc2396E" 

I am using the Java netCDF library (version 2.2.something -- how to I 
tell which from the jar?) to extract the GeoGrids from the netCDF 
dataset from these two URLs.

Both are degenerate in the sense that there is only one X and one Y in 
the "grid", but none the less in the case of the XYT file the GeoGrids 
are returned successfully.

However in the second case where a similar XY grid is defined, but 
includes a Z axis getGrids() returns an empty list.  I think it should 
be able to return grids (albeit degenerate) just the same as the XYT case.

XYT Grid:

<a class="moz-txt-link-freetext" 

XYZT Grid:

<a class="moz-txt-link-freetext" 


package gov.noaa.pmel.tmap;

import java.util.Iterator;
import java.util.List;

import ucar.nc2.dataset.CoordinateAxis1D;
import ucar.nc2.dataset.NetcdfDataset;
import ucar.nc2.dataset.grid.GeoGrid;
import ucar.nc2.dataset.grid.GridCoordSys;
import ucar.nc2.dataset.grid.GridDataset;
import ucar.nc2.dods.DODSNetcdfFile;

 * @author Roland Schweitzer
public class OneByOneGrid {

     * @param args
    public static void main(String[] args) {
        String[] data = {
""; };

        for (int i = 0; i < data.length; i++) {
            System.out.println("Data set: " + data[i]);
            try {
                String url = DODSNetcdfFile.canonicalURL(data[i]);
                NetcdfDataset ncds = NetcdfDataset.openDataset(url);
                GridDataset gridDs = new GridDataset(ncds);
                List grids = gridDs.getGrids();
                if (grids.size() > 0) {
                    for (Iterator git = grids.iterator(); git.hasNext();) {
                        GeoGrid grid = (GeoGrid);
                        GridCoordSys gcs = grid.getCoordinateSystem();
                        CoordinateAxis1D xAxis = (CoordinateAxis1D) 
                        CoordinateAxis1D yAxis = (CoordinateAxis1D) 
                        if (xAxis != null) {
                        if (yAxis != null) {
                        if (gcs.hasVerticalAxis()) {
                            CoordinateAxis1D zAxis = gcs.getVerticalAxis();
                        if (gcs.hasTimeAxis()) {
                            CoordinateAxis1D tAxis = gcs.getTimeAxis();
                } else {
                    System.out.println("\tNo grids found.");
            } catch (Exception e) {