Re: [netcdf-java] Cant read ...: not a valid CDM file.

  • To: David Rush <david.rush@xxxxxxx>
  • Subject: Re: [netcdf-java] Cant read ...: not a valid CDM file.
  • From: Christian Ward-Garrison <cwardgar@xxxxxxxx>
  • Date: Tue, 25 Jul 2017 12:57:36 -0600
Hi David,

It's hard to say. Can you provide us the file?

Cheers,
Christian

On Tue, Jul 25, 2017 at 12:50 PM, David Rush <david.rush@xxxxxxx> wrote:

> Hi.  I'm completely new to netcdf and have been given some netcdf data to
> read.
>
> I'm using netcdfAll-4.6.10.jar
>
> I found the example program in the tutorial and have implemented something
> very similar:
>
> import ucar.nc2.NetcdfFile;
>
> public class ReadNetCDF {
>
>   public static void main(String[] args) throws Exception {
>     ReadNetCDF x = new ReadNetCDF();
>     x.read("netCDF/example_nc");
>   }
>
>   public void read(String fileName) throws Exception {
>     NetcdfFile ncFile = null;
>     try {
>       ncFile = NetcdfFile.open(fileName);
>       System.out.println("ncFile = " + ncFile);
>       this.read(ncFile);
>     } finally {
>       if (ncFile != null) {
>         ncFile.close();
>       }
>     }
>   }
>
>   private void read(NetcdfFile nf) throws Exception {
>     System.out.println("nf = " + nf);
>   }
>
> }
>
> When I run that I get:
>
> Exception in thread "main" java.io.IOException: java.io.IOException: Cant
> read netCDF/example_nc: not a valid CDM file.
>
> at ucar.nc2.NetcdfFile.open(NetcdfFile.java:427)
>
> Suggestions?  Is the example_nc file I was given likely corrupt?
>
> David
>
>
> E-Mail to and from me, in connection with the transaction
> of public business, is subject to the Wyoming Public Records
> Act and may be disclosed to third parties.
>
> _______________________________________________
> NOTE: All exchanges posted to Unidata maintained email lists are
> recorded in the Unidata inquiry tracking system and made publicly
> available through the web.  Users who post to any of the lists we
> maintain are reminded to remove any personal information that they
> do not want to be made public.
>
>
> netcdf-java mailing list
> netcdf-java@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe, visit:
> http://www.unidata.ucar.edu/mailing_lists/
>
  • 2017 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: