- Timestamp:
- 16/08/06 12:04:19 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/trunk/Scanner/csmllibs/csmlfeaturetypes.py
r1404 r1405 84 84 85 85 def createCSMLGridSeriesFeatures(self): 86 #This functionassumes that the variables (features) are shared across identically structured files86 #This method assumes that the variables (features) are shared across identically structured files 87 87 #should be supplied with a featurefilemap object (see csmlfiles for FileMapMaker) 88 89 88 representativeFiles=self.ffmap.getRepresentativeFiles() 90 89 for repfile in representativeFiles: 91 90 self.repfilename,self.listOfFiles=self._populateListOfFiles(repfile) 92 91 self._getFilesAndTimes() 93 94 92 #Open representative file and create feature members: 95 93 DI = csmllibs.csmldataiface.DataInterface() … … 105 103 #it's an axis or bounds not a feature, try next variable 106 104 continue 107 108 105 GridSeriesFeature_element=csmllibs.Parser.GridSeriesFeature() 109 106 GridSeriesFeature_element.id=str(allVarNames[i]) 110 107 desc = self._getDescriptiveName(DI) 111 108 GridSeriesFeature_element.description=csmllibs.Parser.Description(desc) 112 113 #*********************************************************************** 114 #GridSeriesDomain: 115 #*********************************************************************** 109 #DOMAIN 116 110 gsDomain=csmllibs.Parser.GridSeriesDomain() 117 #*********************************************************************** 118 # domainReference element 119 #*********************************************************************** 120 # 111 #DOMAIN REFERENCE 121 112 tpl=csmllibs.Parser.TimePositionList() 122 113 if self.timestorage =='inline': … … 127 118 tpl.timePositions = csmllibs.csmlfileextracts.createSingleExtract(self.extractType, repfilename, self.timedim, len(self.timeString.split())) 128 119 tpl.frame='%s:%s'%(self.caltype,self.units) 129 130 120 gsDomain.domainReference=tpl 131 121 grid=csmllibs.Parser.Grid() 132 133 #*********************************************************************** 134 #coverageFunction 122 #COVERAGE FUNCTION 135 123 mr =csmllibs.Parser.MappingRule(csmllibs.csmlextra.getMappingRule(len(dimNames))) 136 137 124 GridSeriesFeature_element.coverageFunction=mr 138 139 #*********************************************************************** 140 # gml:rangeSet element 141 #*********************************************************************** 125 #RANGESET 142 126 arrSz = DI.getArraySizeOfVar() 143 144 127 try: 145 128 strUom = DI.getVariableAttribute('units') 146 129 except AttributeError: 147 # if units attribute doesn't exist: 148 strUom ="dimensionless or units not determined" 149 130 # if units attribute doesn't exist: 131 strUom ="dimensionless or units not determined" 150 132 rs=csmllibs.Parser.RangeSet() 151 133 if self.valuestorage=='inline': 152 #T o do, store the rangeset inline - use Datablock class???134 #TO DO, store the rangeset inline - use Datablock class??? 153 135 pass 154 136 else: … … 163 145 self.extractType= DI.extractType 164 146 fe = self._getCorrectExtractType() 165 166 147 varSize=DI.getShapeOfVar() 167 148 fe.arraySize=varSize … … 171 152 rs.aggregatedArray=aa 172 153 GridSeriesFeature_element.rangeSet=rs 173 ###################################################### 174 175 176 # #*********************************************************************** 177 # # domainComplement element (and sub-elements) 178 # #*********************************************************************** 154 #DOMAIN COMPLEMENT 179 155 grid.srsName='urn:EPSG:GeographicCRS:4326' 180 156 numSpDims=len(varSize) -1 … … 183 159 ge =csmllibs.Parser.GridEnvelope(low=DI.getLowLimits(), high=DI.getHighLimits()) 184 160 grid.limits=ge 185 186 187 161 #add an axisName element(s) for each spatial dimension. 188 162 # and an ordinate element … … 192 166 axisname ='dim'+str(i) 193 167 axes.append(axisname) 194 195 196 168 #ordinates 197 169 grid.ordinates=[] … … 203 175 ord.definesAxis=dimName 204 176 #look up file extract name in dictionary 205 177 #(axisid stored in dictionary = current filename + variable name) 206 178 axisid=self.repfilename+dimName 207 179 if self.spatialstorage=='fileextract': … … 218 190 self.fms.append(GridSeriesFeature_element) 219 191 DI.closeFile() 220 192 ###End of createCSMLGridSeriesFeatures### 221 193 222 194
Note: See TracChangeset
for help on using the changeset viewer.