This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Tom, I'm able to read this dataset, with the xml_metadata variable, in three ways: ncdump ucar.nc2.NCdumpW NhPrint (my java program that uses Caron's API) I'll stop by to discuss. Steve On Thu, Jul 15, 2010 at 09:11:29AM -0600, Tom Margolis wrote: > Hi John, > > I found a small problem with the Unidata API (v. 4.1.20100227.0121) reading > char variables. > > When the Unidata API reads the attached file, it fails to read the > xml_metadata variable, which has a type of 'char'. > > public static void main(String[] args) > { > try > { > ucar.nc2.dt.grid.GridDataset gridDataset = > ucar.nc2.dt.grid.GridDataset.open( > "/path/to/attached/20090902_v_184000_l_0000000.nc" ); > ucar.nc2.Variable var = gridDataset.getNetcdfDataset().findVariable( > "xml_metadata" ); > > // This attempt to read() will fail with > java.lang.IllegalStateException: ucar.ma2.InvalidRangeException: Invalid > Section rank > var.read(); > } > catch( IllegalStateException exc ) > { > exc.printStackTrace(); > } > } > > > If you think the latest stable release of the API fixes this problem, > great; otherwise, would you mind looking into it? > > Thanks, > Tom -- Steve Sullivan address@hidden 303-497-2823 FL/2, Research Applications Laboratory National Center for Atmospheric Research PO Box 3000 Boulder CO 80307 USA