Changeset 2014 for TI02-CSML/branches
- Timestamp:
- 17/01/07 14:33:47 (14 years ago)
- Location:
- TI02-CSML/branches/CSML-v1.0x-ddc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/branches/CSML-v1.0x-ddc/Examples/parsing/apicalls.py
r1557 r2014 3 3 import csml 4 4 5 f=' Examples/parsing/test.xml'5 f='testedited.xml' 6 6 7 7 #Initialise the CSML container … … 19 19 20 20 #select a feature by name (gml:id) 21 print '\n Selecting feature with gml:id = %s' %flist[ 4]22 feature=csmldoc.getFeature(flist[ 4])21 print '\n Selecting feature with gml:id = %s' %flist[0] 22 feature=csmldoc.getFeature(flist[0]) 23 23 24 24 f#eature 'bestname' … … 45 45 #define a selection (based on the domain ref/complement) 46 46 #timeSelection=['2881-3-16T0:0:0.0', '2881-4-16T0:0:0.0', '2881-5-16T0:0:0.0', '2881-6-16T0:0:0.0', '2881-7-16T0:0:0.0', '2881-8-16T0:0:0.0', '2881-9-16T0:0:0.0'] 47 timeSelection=['2794-12-1T0:0:0.0', '2844-12-1T0:0:0.0'] 47 #timeSelection=['2794-12-1T0:0:0.0', '2844-12-1T0:0:0.0'] 48 timeSelection=['1901-1-1T0:0:0.0' ,'1901-2-1T0:0:0.0'] 48 49 49 50 spatialSubsetDictionary= {} -
TI02-CSML/branches/CSML-v1.0x-ddc/csml/API/ops_GridSeriesFeature.py
r1594 r2014 6 6 import csml.API.ops_AbstractFeature 7 7 import csml.csmllibs.netCDFWriter 8 8 import sys 9 9 10 10 def testmethod(self): … … 39 39 #build domain complement dictionary: 40 40 valList=[] 41 for val in ordinate.axisValues.split(','): 42 valList.append(val) 41 for val in ordinate.axisValues.split(' '): 42 if val !='': 43 valList.append(val) 43 44 domaincomp[ordinate.definesAxis]=valList 44 45 … … 118 119 continue #already got data from this file, try next time 119 120 data=comp.getData(fileposition=filePos, times=self.times, **kwargs) 121 120 122 self.files.append(comp.fileName.split()[filePos]) 121 123 if fulldata ==[]: … … 126 128 filesFetched.append(filePos) 127 129 axisorder = data.getAxisIds() #will need later! 130 #Stephen - at this point the fulldata variable holds the data subset, so you might not need more than this? 131 #print fulldata 132 128 133 try: 129 134 caltype=self.domain.domainReference.frame.split(':',1)[0] … … 132 137 except: 133 138 csml.csmllibs.csmltime.setcdtimeCalendar(csml.csmllibs.csmltime.cdtime.DefaultCalendar) 139 140 141 134 142 ### define domain and rangeSet to use for feature in csml document#### 135 143 domain=csml.parser.GridSeriesDomain() -
TI02-CSML/branches/CSML-v1.0x-ddc/csml/csmllibs/csmldataiface.py
r2013 r2014 392 392 kwargs[key]=(0.0, lonMax) 393 393 sel=cdms.selectors.Selector(**kwargs) 394 subset1=self.file(self.varobj. name,sel)394 subset1=self.file(self.varobj.id,sel) 395 395 kwargs[key]=(lonMin,359.9999) 396 396 sel=cdms.selectors.Selector(**kwargs) 397 subset2=self.file(self.varobj. name,sel)397 subset2=self.file(self.varobj.id,sel) 398 398 #concatenate arrays along longitude 399 399 longitudeAxis=subset1.getAxisIndex('longitude') # this needs to be more robust test. … … 401 401 else: 402 402 sel=cdms.selectors.Selector(**kwargs) 403 subset=self.file(self.varobj. name,sel)403 subset=self.file(self.varobj.id,sel) 404 404 data = subset 405 405 return data
Note: See TracChangeset
for help on using the changeset viewer.