Changeset 3296 for TI02-CSML/trunk/csml/API/ops_PointSeriesFeature.py
- Timestamp:
- 04/02/08 12:19:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/trunk/csml/API/ops_PointSeriesFeature.py
r3271 r3296 91 91 92 92 93 fileList=[] 94 if hasattr(self.value.rangeSet, 'valueArray'): 95 fextract=self.value.rangeSet.valueArray.valueComponent.insertedExtract.components 96 uom = self.value.rangeSet.valueArray.valueComponent.insertedExtract.uom 93 #fileList=[] 94 95 if self.value.rangeSet.quantityList.CONTENT: 96 #inline 97 data=self.value.rangeSet.quantityList.CONTENT.split()[minIndex:maxIndex+1] 98 fillvalue=None 99 units=self.value.rangeSet.quantityList.uom 97 100 else: 98 fextract=self.value.rangeSet.arrayDescriptor.components 99 uom = self.value.rangeSet.arrayDescriptor.uom 100 for f in fextract.fileList.fileNames.CONTENT.split(): 101 fileList.append(f) 102 103 data, fillvalue=fextract.getDataFromChunks(minIndex, maxIndex) 104 105 units=[uom.CONTENT] 101 #file extract 102 if hasattr(self.value.rangeSet, 'valueArray'): 103 fextract=self.value.rangeSet.valueArray.valueComponent.insertedExtract.components 104 uom = self.value.rangeSet.valueArray.valueComponent.insertedExtract.uom 105 else: 106 fextract=self.value.rangeSet.arrayDescriptor.components 107 uom = self.value.rangeSet.arrayDescriptor.uom 108 #for f in fextract.fileList.fileNames.CONTENT.split(): 109 #fileList.append(f) 110 111 data, fillvalue=fextract.getDataFromChunks(minIndex, maxIndex) 112 113 units=[uom.CONTENT] 106 114 107 115 #Now write out the CSML Feature: … … 139 147 140 148 totalArraySize=10 141 descriptor=csml.parser.NetCDFExtract(id=sdid,fileName=csml.parser.csString(ncname),variableName=self.name,arraySize=csml.parser.csString(totalArraySize)) 142 143 149 if hasattr(self, 'name'): 150 varname=self.name 151 else: 152 varname=self.id 153 descriptor=csml.parser.NetCDFExtract(id=sdid,fileName=csml.parser.csString(ncname),variableName=csml.parser.csString(varname),arraySize=csml.parser.csString(totalArraySize)) 154 144 155 #the parameter of the feature is of type Phenomenon, here href creates "xlink:href=..." 145 156 param=self.parameter … … 149 160 csmlWrap=csml.csmllibs.csmlfeaturewrap.CSMLWrapper() 150 161 subsettedFeature=csmlWrap.createPointSeriesFeature(value=cvg,parameter=param,location=self.location,featureID=self.id,description=self.description) 151 152 162 153 163 … … 155 165 nc=cdms.open(pathToSubsetNetCDF,'w') 156 166 var=MV.array(data) 157 var.id= self.name.CONTENT158 var.name= self.name.CONTENT167 var.id=varname 168 var.name=varname 159 169 var.units=units[0] # hopefully there is just one unit in this list.. 160 170 setattr(var, 'missing_value' ,fillvalue)
Note: See TracChangeset
for help on using the changeset viewer.