Changeset 2014 for TI02-CSML/branches


Ignore:
Timestamp:
17/01/07 14:33:47 (13 years ago)
Author:
domlowe
Message:

changed cdms id to name, temporarily fixed commas in data string

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  
    33import csml 
    44 
    5 f='Examples/parsing/test.xml' 
     5f='testedited.xml' 
    66 
    77#Initialise the CSML container 
     
    1919 
    2020#select a feature by name (gml:id) 
    21 print '\n Selecting feature with gml:id = %s' %flist[4] 
    22 feature=csmldoc.getFeature(flist[4]) 
     21print '\n Selecting feature with gml:id = %s' %flist[0] 
     22feature=csmldoc.getFeature(flist[0]) 
    2323 
    2424f#eature 'bestname' 
     
    4545#define a selection (based on the domain ref/complement) 
    4646#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'] 
     48timeSelection=['1901-1-1T0:0:0.0' ,'1901-2-1T0:0:0.0'] 
    4849 
    4950spatialSubsetDictionary= {} 
  • TI02-CSML/branches/CSML-v1.0x-ddc/csml/API/ops_GridSeriesFeature.py

    r1594 r2014  
    66import csml.API.ops_AbstractFeature 
    77import csml.csmllibs.netCDFWriter 
    8  
     8import sys 
    99 
    1010def testmethod(self): 
     
    3939                #build domain complement dictionary: 
    4040                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) 
    4344                domaincomp[ordinate.definesAxis]=valList 
    4445                 
     
    118119                continue #already got data from this file, try next time 
    119120            data=comp.getData(fileposition=filePos, times=self.times, **kwargs) 
     121 
    120122            self.files.append(comp.fileName.split()[filePos]) 
    121123            if fulldata ==[]: 
     
    126128            filesFetched.append(filePos) 
    127129        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        
    128133    try: 
    129134        caltype=self.domain.domainReference.frame.split(':',1)[0] 
     
    132137    except: 
    133138        csml.csmllibs.csmltime.setcdtimeCalendar(csml.csmllibs.csmltime.cdtime.DefaultCalendar) 
     139     
     140     
     141     
    134142    ### define domain and rangeSet to use for feature in csml document#### 
    135143    domain=csml.parser.GridSeriesDomain() 
  • TI02-CSML/branches/CSML-v1.0x-ddc/csml/csmllibs/csmldataiface.py

    r2013 r2014  
    392392                    kwargs[key]=(0.0, lonMax) 
    393393                    sel=cdms.selectors.Selector(**kwargs) 
    394                     subset1=self.file(self.varobj.name,sel) 
     394                    subset1=self.file(self.varobj.id,sel) 
    395395                    kwargs[key]=(lonMin,359.9999) 
    396396                    sel=cdms.selectors.Selector(**kwargs) 
    397                     subset2=self.file(self.varobj.name,sel) 
     397                    subset2=self.file(self.varobj.id,sel) 
    398398                    #concatenate arrays along longitude 
    399399                    longitudeAxis=subset1.getAxisIndex('longitude') # this needs to be more robust test. 
     
    401401                else: 
    402402                    sel=cdms.selectors.Selector(**kwargs) 
    403                     subset=self.file(self.varobj.name,sel) 
     403                    subset=self.file(self.varobj.id,sel) 
    404404        data = subset 
    405405        return data 
Note: See TracChangeset for help on using the changeset viewer.