Example #1
0
 def startCoordinateTransform(self, attrs):
     name = _getatt(attrs, 'name')
     authority = _getatt(attrs, 'authority')
     transformType = _getatt(attrs, 'transformType')
     ctnode = cs.CoordinateTransformNode(name, authority, transformType)
     nsnode = self.peek()
     nsnode.setCoordinateTransform(ctnode)
     self.push(ctnode)
Example #2
0
 def startCoordinateTransform(self, attrs):
     name = _getatt(attrs, 'name')
     authority = _getatt(attrs, 'authority')
     transformType = _getatt(attrs, 'transformType')
     ctnode = cs.CoordinateTransformNode(name, authority, transformType)
     nsnode = self.peek()
     nsnode.setCoordinateTransform(ctnode)
     self.push(ctnode)
Example #3
0
 def startCoordinateAxisBoundary(self, attrs):
     ncnode = self.peek()
     name = _getatt(attrs, 'name')
     shape = _getatt(attrs, 'shape', default=None)
     datatype = _getatt(attrs, 'type')
     if shape is None:
         shapelist = None
     else:
         shapelist = string.split(shape)
     varnode = cs.CoordinateAxisBoundaryNode(name, datatype, shapelist)
     ncnode.setVariable(varnode)
     self.push(varnode)
Example #4
0
 def startCoordinateAxisBoundary(self, attrs):
     ncnode = self.peek()
     name = _getatt(attrs, 'name')
     shape = _getatt(attrs, 'shape', default=None)
     datatype = _getatt(attrs, 'type')
     if shape is None:
         shapelist = None
     else:
         shapelist = string.split(shape)
     varnode = cs.CoordinateAxisBoundaryNode(name, datatype, shapelist)
     ncnode.setVariable(varnode)
     self.push(varnode)
Example #5
0
 def startVariable(self, attrs):
     ncnode = self.peek()
     name = _getatt(attrs, 'name')
     shape = _getatt(attrs, 'shape', default=None)
     datatype = _getatt(attrs, 'type')
     coordinateSystems = _getatt(attrs, 'coordinateSystems')
     if shape is None:
         shapelist = None
     else:
         shapelist = string.split(shape)
     varnode = cs.VariableNode(name, datatype, shapelist, coordinateSystems)
     ncnode.setVariable(varnode)
     self.push(varnode)
Example #6
0
 def startVariable(self, attrs):
     ncnode = self.peek()
     name = _getatt(attrs, 'name')
     shape = _getatt(attrs, 'shape', default=None)
     datatype = _getatt(attrs, 'type')
     coordinateSystems = _getatt(attrs, 'coordinateSystems')
     if shape is None:
         shapelist = None
     else:
         shapelist = string.split(shape)
     varnode = cs.VariableNode(name, datatype, shapelist, coordinateSystems)
     ncnode.setVariable(varnode)
     self.push(varnode)
Example #7
0
 def startCoordinateAxis(self, attrs):
     ncnode = self.peek()
     name = _getatt(attrs, 'name')
     shape = _getatt(attrs, 'shape', default=None)
     if shape is None:
         shapelist = None
     else:
         shapelist = string.split(shape)
     datatype = _getatt(attrs, 'type')
     units = _getatt(attrs, 'units')
     axis = _getatt(attrs, 'axis')
     axisType = None
     if axis is not None:
         try:
             axisType = cdToCsAxisType[string.lower(var.axis)]
         except:
             pass
     positive = _getatt(attrs, 'positive')
     boundaryRef = _getatt(attrs, 'bounds')
     varnode = cs.CoordinateAxisNode(name, datatype, units, shapelist, axisType, positive, boundaryRef)
     ncnode.setCoordinateAxis(varnode)
     self.push(varnode)
Example #8
0
 def startCoordinateAxis(self, attrs):
     ncnode = self.peek()
     name = _getatt(attrs, 'name')
     shape = _getatt(attrs, 'shape', default=None)
     if shape is None:
         shapelist = None
     else:
         shapelist = string.split(shape)
     datatype = _getatt(attrs, 'type')
     units = _getatt(attrs, 'units')
     axis = _getatt(attrs, 'axis')
     axisType = None
     if axis is not None:
         try:
             axisType = cdToCsAxisType[string.lower(var.axis)]
         except:
             pass
     positive = _getatt(attrs, 'positive')
     boundaryRef = _getatt(attrs, 'bounds')
     varnode = cs.CoordinateAxisNode(name, datatype, units, shapelist,
                                     axisType, positive, boundaryRef)
     ncnode.setCoordinateAxis(varnode)
     self.push(varnode)
Example #9
0
 def startNetcdf(self, attrs):
     uri = _getatt(attrs, 'uri')
     nc = cs.NetcdfNode(uri=uri)
     self.push(nc)
Example #10
0
 def startCoordinateTransformRef(self, attrs):
     ref = _getatt(attrs, 'ref')
     csnode = self.peek()
     csnode.addCoordinateTransform(ref)
Example #11
0
 def startParameter(self, attrs):
     self.startAttribute(attrs)  # Parameters are attributes
     name = _getatt(attrs, 'name')
     self.peek().parameters[name].tag = 'parameter'
Example #12
0
 def startCoordinateSystem(self, attrs):
     name = _getatt(attrs, 'name')
     ncnode = self.peek()
     csnode = cs.CoordinateSystemNode(name)
     ncnode.setCoordinateSystem(csnode)
     self.push(csnode)
Example #13
0
 def startCoordinateTransformRef(self, attrs):
     ref = _getatt(attrs, 'ref')
     csnode = self.peek()
     csnode.addCoordinateTransform(ref)
Example #14
0
 def startCoordinateAxisRef(self, attrs):
     ref = _getatt(attrs, 'ref')
     csnode = self.peek()
     csnode.addCoordinateAxis(ref)
Example #15
0
 def startCoordinateSystem(self, attrs):
     name = _getatt(attrs, 'name')
     ncnode = self.peek()
     csnode = cs.CoordinateSystemNode(name)
     ncnode.setCoordinateSystem(csnode)
     self.push(csnode)
Example #16
0
 def startCoordinateAxisRef(self, attrs):
     ref = _getatt(attrs, 'ref')
     csnode = self.peek()
     csnode.addCoordinateAxis(ref)
Example #17
0
 def startNetcdf(self, attrs):
     uri = _getatt(attrs, 'uri')
     nc = cs.NetcdfNode(uri=uri)
     self.push(nc)
Example #18
0
 def startParameter(self, attrs):
     self.startAttribute(attrs)      # Parameters are attributes
     name = _getatt(attrs, 'name')
     self.peek().parameters[name].tag='parameter'