[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem reading char variable
- Subject: Re: Problem reading char variable
- Date: Mon, 19 Jul 2010 10:56:51 -0600
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