Appending data.


> I would like to add data to a netCDF file one record at a time. The reason
> is I have data files containing many Megabytes of data records. Storing the 
> data in an array before writing into a netCDF file is not feasible. Is there 
> a simple way to do this ? I read in the User's Guide that only one variable
> can have unlimited dimension.

Actually only one dimension can be unlimited, but any number of variables
may use the unlimited dimension.  There was a mistake in the description of
the ncinquire function in the User's Guide that referred to the

  variable ID of the dimension defined with unlimited size

where it should have said the

  dimension ID of the dimension defined with unlimited size

that may have caused the confusion.  This is corrected in the next version.

>                               In this case I am forced to find out the number
> of records in order to set the dimensions of the data. This is also very
> cumbersome.

Finding out the current number of records in a netCDF file only requires a
call to ncinquire to get the dimension ID of the record dimension, followed
by a call to ncdiminq to get the (current) size of the unlimited, which is
also the current number of records.

>           Is there a way around this ? I know netCDF data is meant to be 
> appendable (-->FAQ) and I have looked in the Users' Guide but there is no 
> mention of "append" in the index. Your help would be greatly appreciated.

I've added index entries for appending data in the next version of the
manual as well.

We're still furiously documenting and testing netCDF version 2.3 for a
release Real Soon Now ...


P.S.  Sorry if you got a previous version of this message with an empty
body.  It got loose before I could stop it.

  • 1993 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: