[MMTK] How to create new NetCDF file from template?

Jose Borreguero borreguero at gmail.com
Wed Nov 5 23:44:06 UTC 2008

Dear MMTK users,

I want to create a fresh new NetCDF file with the same structure as some
existing NetCDF file. I have trouble cloning the variables:

*def cloneNetCDF(outfile,template):
    pin=NetCDFFile(template, 'r')   #this is the existing file
    pout=NetCDFFile(outfile, 'w')    #this is the new file
    for name,size in pin.dimensions: pout.createDimension(name,size)
    for name,var in template.variables: I-have-no-clue()*
  * return pout*

Could anyone point me as how to clone the variables?

Jose M. Borreguero
Postdoctoral Associate
Oak Ridge National Laboratory
P.O. Box 2008, M.S. 6164
Oak Ridge, TN 37831
phone: 865-241-3071 fax: 865-576-5491
Email: borreguerojm at ornl.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://starship.python.net/pipermail/mmtk/attachments/20081105/d1263aab/attachment.htm>

More information about the mmtk mailing list