Changeset 1890 for TI02-CSML/branches
- Timestamp:
- 19/12/06 09:19:29 (13 years ago)
- Location:
- TI02-CSML/branches/CSML2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/branches/CSML2/csmllibs/csmlfeaturetypes.py
r1887 r1890 90 90 #This method assumes that the variables (features) are shared across identically structured files 91 91 #should be supplied with a featurefilemap object (see csmlfiles for FileMapMaker) 92 print 'is this working at all?'93 92 representativeFiles=self.ffmap.getRepresentativeFiles() 94 93 for repfile in representativeFiles: … … 113 112 #GridSeriesFeature_element.description=csml.parser.Description(desc) 114 113 gsFeature.description=desc 115 # DOMAIN114 #value (coverage) 116 115 gsCoverage=csml.parser.GridSeriesCoverage() 117 116 gsDomain=csml.parser.GridSeriesDomain() 117 gcT=csml.parser.GridCoordinatesTable() 118 119 120 121 #add an axisName element(s) for each spatial dimension. 122 # and an ordinate element 123 axes=[] 124 for i in range (1, len(dimNames)): 125 #axisNames 126 axisname ='dim'+str(i) 127 axes.append(axisname) 128 129 ordinates=[] 130 for i in range (1, len(dimNames)): 131 ord=csml.parser.GridOrdinateDescription() 132 #ord.gridAxesSpanned='dim' + str(i) 133 #ord.sequenceRule=csml.csmllibs.csmlextra.getSeqRule(len(dimNames)) 134 #dimName=dimNames[len(dimNames)-i] 135 #ord.definesAxis=dimName 136 ##look up file extract name in dictionary 137 ##(axisid stored in dictionary = current filename + variable name) 138 #axisid=self.repfilename+dimName 139 #if self.spatialstorage=='fileextract': 140 ##refer to extract 141 #ord.axisValues='#'+self.fileExtractDictionary[axisid] 142 #else: 143 ##store inline 144 #DI.setAxis(dimName) 145 #ord.axisValues=csml.csmllibs.csmlextra.cleanString(str(DI.getDataForAxis())) 146 147 #ordinates.append(ord) 148 gcT.addChildElem('gridOrdinates',ord) 149 #grid.axisNames=axes 150 151 gsDomain.coordTransformTable=gcT 118 152 gsCoverage.gridSeriesDomain=gsDomain 119 153 gsFeature.value=gsCoverage 120 #gsDomain=csml.parser.GridSeriesDomain() 121 ##DOMAIN REFERENCE 154 gsDomain=csml.parser.GridSeriesDomain() 155 156 #DOMAIN REFERENCE 122 157 #tpl=csml.parser.TimePositionList() 123 158 #if self.timestorage =='inline': -
TI02-CSML/branches/CSML2/parser.py
r1883 r1890 82 82 def _getReverseSubsType(self, typename): 83 83 return typename 84 84 85 def addChildElem(self, childname, childobj): 86 #sometimes you want to add a child element but don't know if there is one already. In which case you want to create a list of child objects. 87 if hasattr(self, childname): 88 currentattribute=getattr(self,childname) 89 if type(getattr(self,childname)) is list: 90 currentattribute.append(childobj) 91 else: 92 newlist=[currentattribute] 93 newlist.append(childobj) 94 setattr(self,childname, newlist) 95 else: 96 setattr(self,childname, childobj) 97 85 98 def toXML(self, csmlfrag): 86 99 #process self and convert to XML
Note: See TracChangeset
for help on using the changeset viewer.