Changeset 1900
- Timestamp:
- 20/12/06 12:34:52 (14 years ago)
- Location:
- TI02-CSML/branches/CSML2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/branches/CSML2/csmllibs/csmldataiface.py
r1887 r1900 340 340 attValue=self.axisobj.attributes[att] 341 341 return attValue 342 342 343 343 def getTimeUnits(self): 344 344 #this does the same as getAxisAttribute, but is a separate function as different formats handle time differently. -
TI02-CSML/branches/CSML2/csmllibs/csmlfeaturetypes.py
r1899 r1900 10 10 import csml.csmllibs 11 11 import sys 12 13 class axisList(object): 14 #utitily class to store the relationships between CSML dimensions and grid axes. 15 #not used yet 16 def __init__(self): 17 self.dims={} 18 19 def addDim(self, dimName, axisLabel, axesSpanned): 20 if type(axesSpanned) is not list: 21 axesSpanned=[axesSpanned] 22 self.dims[dimName]=[axisLabel, axesSpanned] 23 24 def getAxisLabel(self, dimName): 25 return self.dims[dimName][0] 26 27 def getAxesSpanned(self, dimName): 28 return self.dims[dimName][1] 29 12 30 13 31 class featureBuilder(object): … … 102 120 numFeatures=len(allVarNames) 103 121 #Create a GridSeriesFeature for each variable: 122 print 'TEST CODE' 123 104 124 for i in range(0, numFeatures): 105 125 DI.setVariable(allVarNames[i]) 106 dimNames=DI.getVariableAxes() 126 print allVarNames[i] 127 #set up the axisList for use later 128 AL=axisList() 129 dimNames=DI.getVariableAxes() 107 130 if len(dimNames) <= 2: 108 131 #it's an axis or bounds not a feature, try next variable … … 178 201 #store the rangeSet as an aggregatedArray 179 202 aa=cp.AggregatedArray() 180 aa.arraySize=[] 181 #aa.arraySize.append(arrSz) 182 #aa.uom=strUom 203 aa.arraySize=cp.csString(arrSz) 204 aa.uom=cp.csString(strUom) 183 205 aa.aggType=cp.csString('new') #can it be anything else? 184 206 aa.aggIndex=cp.csString('1') … … 194 216 rs.aggregatedArray=aa 195 217 gsCoverage.rangeSet=rs 196 197 218 gsFeature.parameter=csml.parser.Phenomenon(href='http://badc.rl.ac.uk/localparams#%s'%allVarNames[i]) 198 #gsFeature.parameter=csml.parser.Phenomenon()199 219 gsFeature.value=gsCoverage 200 220 self.fms.append(gsFeature) -
TI02-CSML/branches/CSML2/parser.py
r1899 r1900 221 221 def __init__(self, text=None,**kwargs): 222 222 if text != None: 223 if type(text) is not str: 224 text=str(text) 223 225 self.CONTENT=text 224 226 children={}
Note: See TracChangeset
for help on using the changeset viewer.