Skip to content
This repository has been archived by the owner on Oct 18, 2019. It is now read-only.

Latest commit

 

History

History
24 lines (18 loc) · 853 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 853 Bytes

ncml

Python tools for manipulating NCML (NetCDF Markup) files

These tools allow you to modify NcML by:

  • adding or removing global attributes
  • adding or removing variable attributes
  • removing variables and dimensions

Example:

      import ncml
      nc = ncml.Dataset.NcmlDataset('original.ncml')            # create an Ncmldataset object from a local NcML file
   
      nc.removeDimension('time2')                            # remove dimension
      nc.removeVariable('time2')                             # remove variable
      nc.addDatasetAttribute('Conventions','CF-1.6')         # add global attribute
      nc.addVariableAttribute('Temperature','units','degC')   # add variable attribute
      nc.removeVariableAttribute('Salinity','units')          # remove variable attribute
      
      nc.writeNcmlBack('modified.ncml')