Changeset 2863
- Timestamp:
- 31/08/07 14:24:41 (14 years ago)
- Location:
- TI02-CSML/trunk/csml
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/trunk/csml/API/ops_AbstractFeature.py
r2758 r2863 12 12 def getAllowedSubsettings(self): 13 13 return ['none'] 14 15 14 16 15 def getDomainUnits(self): … … 29 28 return None 30 29 30 def getBoundingBox(self): 31 return None 31 32 32 33 def getSliceIndices(self, selection): -
TI02-CSML/trunk/csml/API/ops_Dataset.py
r2692 r2863 89 89 return extract 90 90 91 def getCSMLBoundingBox(self): 92 #returns a complete boundingBox object including temporal domain and crs 93 if hasattr(self.featureCollection, 'boundedBy'): 94 return csml.API.csmlbbox.CSMLBoundingBox(self.featureCollection.boundedBy) 95 else: 96 return None 97 98 91 99 def getBoundingBox(self): 92 100 ''' get boundingBox, returns the boundingBox of the CSMLFeatureCollection (assumes there is only one...)''' -
TI02-CSML/trunk/csml/API/ops_GridSeriesFeature.py
r2758 r2863 20 20 return ['subsetToGridSeries', 'subsetToProfileSeries'] #other operations 21 21 22 23 24 22 def getCSMLBoundingBox(self): 23 #returns a complete boundingBox object including temporal domain and crs 24 if hasattr(self.value.gridSeriesDomain, 'boundedBy'): 25 return csml.API.csmlbbox.CSMLBoundingBox(self.featureCollection.boundedBy) 26 else: 27 return None 28 29 def getBoundingBox(self): 30 bbox=self.value.gridSeriesDomain 31 try: 32 lower1=eval(bbox.boundedBy.lowerCorner.CONTENT.split()[0]) 33 lower2=eval(bbox.boundedBy.lowerCorner.CONTENT.split()[1]) 34 upper1=eval(bbox.boundedBy.upperCorner.CONTENT.split()[0]) 35 upper2=eval(bbox.boundedBy.upperCorner.CONTENT.split()[1]) 36 return [lower1,lower2,upper1,upper2] 37 except: 38 return None 39 40 25 41 def getDomain(self): 26 42 #returns domain as a dictionary of ordinates {name: [values], ...} -
TI02-CSML/trunk/csml/testfiles/gridseries/subset.py
r2758 r2863 42 42 43 43 #define a selection (based on the domain) 44 subsetDictionary={} 45 #subsetDictionary['time']=('2794-12-1T0:0:0.0', '2804-12-1T0:0:0.0') 46 subsetDictionary['time']='2704-12-01T00:00:00.0' 47 #subsetDictionary['latitude']=(-90,60) 44 #subsetDictionary={} 45 ##subsetDictionary['time']=('2794-12-1T0:0:0.0', '2804-12-1T0:0:0.0') 46 #subsetDictionary['time']='2704-12-01T00:00:00.0' 47 ##subsetDictionary['latitude']=(-90,60) 48 ##subsetDictionary['longitude']=(-31.1265,30.258) 49 #subsetDictionary['latitude']=(-5,5) 48 50 #subsetDictionary['longitude']=(-31.1265,30.258) 49 subsetDictionary['latitude']=(-5,5)50 subsetDictionary['longitude']=(-31.1265,30.258)51 51 #request subsetted data from features (can set paths here) and add to container 52 52 #subset a feature … … 55 55 56 56 #csmlContainer.add(feature.subsetToGridSeries(outputdir,ncname='mygridseries.nc',**subsetDictionary)) 57 csmlContainer.add(feature.subsetToGridSeries(outputdir,ncname='mygridseries.nc',latitude=(-90,90), longitude=(-180,180),time= '2704-12-01T00:00:00.0'))57 csmlContainer.add(feature.subsetToGridSeries(outputdir,ncname='mygridseries.nc',latitude=(-90,90), longitude=(-180,180),time=('2804-12-01T00:00:00.0','2904-12-01T00:00:00.0'))) 58 58 59 59 ##subset another feature (in fact it's the same feature again, but this time subsetting to a profileseries)
Note: See TracChangeset
for help on using the changeset viewer.