[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Netcdf question



"Renaud, William A." <address@hidden> writes:

> Hi Ed,
>
> I have a question from one of our users here.  He has a large netcdf file
> and needs to change only one matrix in the file.  Is there a utility to
> allow only one part to change, or will he need to dump the whole file, edit
> that one piece, and reload the whole file?  From what I can tell, ncgen only
> 'creates' files, it doesn't allow editing of an existing file.

You might want to look at the NCO tools, which provide a lot of
functionality on the command line:

http://nco.sourceforge.net/

>
> On a related note, does the ordering of statements in the data section
> matter?  From my testing, it appears that the order of elements in the
> binary file is based on the order in the variables statement, not the data
> statement.  Is this the case?  If so, my suggestion was to append the 'new'
> data at the end of the file and the reload.  That way, he doesn't have to
> make his edits in the middle of the large file.  Does that sound like it
> will work?
>

Variables are indeed ordered in the order that they are defined in.

Adding a variable will probably cause all the data to be rewritten
because you are adding new metadata (i.e. the metadata relating to the
new variable).

Can your user use an unlimited dimension and just add to it? This can
be done without the whole file being rewritten...

Ed

-- 
Ed Hartnett  -- address@hidden