Ignore:
Timestamp:
30/06/08 11:51:21 (11 years ago)
Author:
domlowe
Message:

Global attribtues now preserved except when they are data dependent CF attributes (which need recalculating). So far this is only implemented for gridseries to gridseries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/csmllibs/netCDFWriter.py

    r4019 r4033  
    1010        #initiates a new NetCDF file 
    1111        self.nc=cdms.open(fileName,'w') 
    12  
    13     def setGlobalAttributes(self, **kwargs): 
    14         #sets global attributes 
    15         pass 
    1612     
    1713    def addAxis(self,axisName, data,isLon=None,isLat=None,isTime=None,**kwargs): 
     
    5046                return axis 
    5147     
    52      
     48    def addGlobalAttributes(self, globalattDict): 
     49        ''' 'given a dictionary, add the key value pairs to the netcdf file as global attributes''' 
     50        for key in globalattDict.keys(): 
     51             setattr(self.nc, key, globalattDict[key]) 
    5352     
    5453    def addTimeVariable(self,timeval):   
Note: See TracChangeset for help on using the changeset viewer.