- Timestamp:
- 08/06/07 10:04:31 (14 years ago)
- Location:
- TI02-CSML/trunk/csml/API
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/trunk/csml/API/__init__.py
r2548 r2562 43 43 44 44 ##PointSeriesFeature methods: 45 addMethods(csml.parser.PointSeriesFeature, [ops_PointSeriesFeature.testmethod,ops_PointSeriesFeature.getDomain, ops_PointSeriesFeature.subsetToPointSeries, ops_PointSeriesFeature.getAllowedSubsettings])45 addMethods(csml.parser.PointSeriesFeature, [ops_PointSeriesFeature.testmethod,ops_PointSeriesFeature.getDomain, ops_PointSeriesFeature.subsetToPointSeries,ops_PointSeriesFeature.subsetToPoint, ops_PointSeriesFeature.getAllowedSubsettings]) 46 46 47 47 ##ProfileFeature methods: -
TI02-CSML/trunk/csml/API/ops_FileExtract.py
r2548 r2562 123 123 fillvalue=DI.getVariableAttribute('_FillValue') 124 124 axisorder=DI.getVariableAxes() 125 units=[]126 for axis in axisorder:127 DI.setAxis(axis)128 units.append(DI.getAxisAttribute('units'))129 125 130 126 DI.closeFile() … … 133 129 except: 134 130 result =data 135 return result, fillvalue , units131 return result, fillvalue 136 132 137 133 def __calendar(file,timedim): -
TI02-CSML/trunk/csml/API/ops_PointSeriesFeature.py
r2550 r2562 41 41 pathToSubsetNetCDF=ncpath 42 42 if type(times) is str: 43 selection = csml.csmllibs.csmlextra.listify(times)43 selection = tuple(csml.csmllibs.csmlextra.listify(times)) 44 44 else: 45 selection = times 46 45 selection = times 47 46 tlist=[] 48 47 for val in self.value.pointSeriesDomain.timePositionList.CONTENT.split(): 49 48 tlist.append(val) 50 51 49 52 50 indices=[] … … 68 66 for domaintime in tlist: 69 67 if selection[0] == domaintime: 68 70 69 minIndex=tlist.index(domaintime) 71 70 maxIndex=minIndex 72 selectedTimes=selection [0]71 selectedTimes=selection 73 72 break 74 73 … … 80 79 81 80 fextract=self.value.rangeSet.arrayDescriptor.components 82 data, fillvalue, units=fextract.getDataFromChunks(minIndex, maxIndex) 81 uom = self.value.rangeSet.arrayDescriptor.uom 82 data, fillvalue=fextract.getDataFromChunks(minIndex, maxIndex) 83 83 84 units=[uom.CONTENT] 84 85 85 86 #Now write out the CSML Feature: … … 121 122 122 123 #the parameter of the feature is of type Phenomenon, here href creates "xlink:href=..." 123 param= csml.parser.Phenomenon(href='CFStandardNames.xml#temperature')124 param=self.parameter 124 125 125 126 126 127 127 #create a stand alone pointseries feature containing this coverage 128 128 csmlWrap=csml.csmllibs.csmlfeaturewrap.CSMLWrapper() 129 129 subsettedFeature=csmlWrap.createPointSeriesFeature(value=cvg,parameter=param,location=self.location,featureID=self.id,description=self.description) 130 130 131 132 131 133 132 134 133 #Now write out the NetCDF File: … … 141 140 142 141 floatTimes=[] 143 #determine base units for times:144 tOne=csml.csmllibs.csmltime.getCDtime( times[0])142 143 tOne=csml.csmllibs.csmltime.getCDtime(selection[0]) 145 144 tbase=csml.csmllibs.csmltime.getBaseUnits(tOne) 146 145 for time in selectedTimes: … … 158 157 159 158 159 def subsetToPoint(self, csmlpath=None, ncpath=None,time=None): 160 pseriesFeature, pathToSubsetNetCDF, descriptor=self.subsetToPointSeries(csmlpath,ncpath,time) 161 162 #now need to take this point series feature containing one time and rewrite it as a point feature. 163 pointFeature=csml.parser.PointFeature() 164 pointFeature.location=pseriesFeature.location 165 pointFeature.parameter=pseriesFeature.parameter 160 166 161 162 163 167 return pointFeature, pathToSubsetNetCDF, descriptor
Note: See TracChangeset
for help on using the changeset viewer.