[netcdf-java] adding new variable to existing netcdf file ...

John Caron caron at unidata.ucar.edu
Wed Jan 9 12:58:50 MST 2008


Hi Ufuk:

  /**
   * Open an existing Netcdf file for writing data. Fill mode is true.
   * Cannot add new objects, you can only read/write data to existing Variables.
   */
  static public NetcdfFileWriteable openExisting(String location) throws IOException;

We are looking at the possibility to change this, but for now you cant add or modify the metadata. You have to rewrite the entire file. ucar.nc2.FileWriter is one way to do that.

[BE] Ufuk Utku Turuncoglu wrote:
> Hi,
> 
> I try to and new variable to an existing netcdf file. I open the file 
> using,
> 
> ncfile = NetcdfFileWritable.openExisting(....)
> 
> method, but when i adding variable with "ncfile.addVariable(....)", it 
> gives me "not in define mode" error. How can i solve the problem. Is 
> there any other method? Any suggestions will be helpful.
> 
> Best wishes,
> 
> --ufuk
> _______________________________________________
> netcdf-java mailing list
> netcdf-java at unidata.ucar.edu
> For list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/ 


More information about the netcdf-java mailing list