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)
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)
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)
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)
def startNetcdf(self, attrs): uri = _getatt(attrs, 'uri') nc = cs.NetcdfNode(uri=uri) self.push(nc)
def startCoordinateTransformRef(self, attrs): ref = _getatt(attrs, 'ref') csnode = self.peek() csnode.addCoordinateTransform(ref)
def startParameter(self, attrs): self.startAttribute(attrs) # Parameters are attributes name = _getatt(attrs, 'name') self.peek().parameters[name].tag = 'parameter'
def startCoordinateSystem(self, attrs): name = _getatt(attrs, 'name') ncnode = self.peek() csnode = cs.CoordinateSystemNode(name) ncnode.setCoordinateSystem(csnode) self.push(csnode)
def startCoordinateAxisRef(self, attrs): ref = _getatt(attrs, 'ref') csnode = self.peek() csnode.addCoordinateAxis(ref)
def startParameter(self, attrs): self.startAttribute(attrs) # Parameters are attributes name = _getatt(attrs, 'name') self.peek().parameters[name].tag='parameter'