Changeset 1929 for TI02-CSML/trunk


Ignore:
Timestamp:
02/01/07 10:28:45 (13 years ago)
Author:
domlowe
Message:

added !getData method to GridSeriesFeature (works for inline data only at the moment)

Location:
TI02-CSML/trunk/csml
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/API/__init__.py

    r1902 r1929  
    3333 
    3434##AbstractFeature methods: 
    35 #addMethods(csml.parser.AbstractFeature, [ops_AbstractFeature.testmethod, ops_AbstractFeature.getAllowedSubsettings]) 
     35addMethods(csml.parser.AbstractFeature, [ops_AbstractFeature.testmethod, ops_AbstractFeature.getAllowedSubsettings]) 
    3636 
    3737##PointFeature methods: 
     
    5151 
    5252##GridSeriesFeature methods: 
    53 #addMethods(csml.parser.GridSeriesFeature,[ops_GridFeature.testmethod, ops_GridSeriesFeature.getAllowedSubsettings,ops_GridSeriesFeature.getDomainReference,ops_GridSeriesFeature.getDomainComplement,ops_GridSeriesFeature.getDomain,ops_GridSeriesFeature.subsetToGridSeries]) 
     53addMethods(csml.parser.GridSeriesFeature,[ops_GridFeature.testmethod,ops_GridSeriesFeature.getDomain,ops_GridSeriesFeature.subsetToGridSeries]) 
    5454 
    5555##TrajectoryFeature methods: 
  • TI02-CSML/trunk/csml/API/ops_GridSeriesFeature.py

    r1902 r1929  
    1515    return ['subsetToGridSeries']  #other operations 
    1616 
     17 
    1718def getDomain(self): 
    18     #need some sort of domain 
    19     pass 
     19    #returns domain as a dictionary of ordinates {name: [values], ...} 
     20    domain={} 
     21    for gridOrd in self.value.gridSeriesDomain.coordTransformTable.gridOrdinates: 
     22        name=gridOrd.coordAxisLabel.CONTENT 
     23        if isinstance(gridOrd.coordAxisValues, csml.parser.FileExtract): 
     24            #not tested with file extracts yet: (01/01/07) 
     25            domain[name]=gridOrd.coordAxisValues.getData() 
     26        else: 
     27            vals=gridOrd.coordAxisValues.coordinateList.CONTENT 
     28            valList=[] 
     29            for val in vals.split(','):  #remove commas 
     30                valList.append(val) 
     31            domain[name]=valList 
     32    return domain 
    2033 
    2134def subsetToGridSeries(self,   csmlpath=None, ncpath=None,**kwargs): 
  • TI02-CSML/trunk/csml/testfiles/apicalls.py

    r1922 r1929  
    11'''apicalls.py  - test the api''' 
    22 
    3 import csml 
     3import csml,sys 
    44 
    5 f='./testfiles/gridseries/testout.xml' 
     5f='./gridseries/testout.xml' 
    66 
    77#Initialise the CSML container 
     
    2525print feature.id 
    2626print feature.description 
     27 
     28#new style domain: 
     29print feature.getDomain() 
     30sys.exit() 
    2731 
    2832#get the domain of the feature 
Note: See TracChangeset for help on using the changeset viewer.