Changeset 2105 for TI02-CSML/trunk/csml


Ignore:
Timestamp:
05/02/07 10:20:06 (13 years ago)
Author:
domlowe
Message:

Parser changes -  csml:id for Dataset, TimeSeriesDomain? to TimeSeries?, plus fixing description/id in subsetting code

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

Legend:

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

    r2095 r2105  
    5252        else:  
    5353            print 'crs not supported' 
    54                
    55  
    56  
    57          
     54  
    5855    ##Get names of variables in file and relate them to the subset selection  
    5956    selection={} 
    6057    for gridOrd in self.value.gridSeriesDomain.coordTransformTable.gridOrdinates: 
    6158        selection[gridOrd.gridAxesSpanned.CONTENT]=kwargs[gridOrd.coordAxisLabel.CONTENT] 
    62      
     59    
    6360     
    6461    strTimes, axisorder, fulldata=csml.API.genSubset.getTheData(self, selection, times, timeName) 
    65      
     62    
    6663     
    6764    #Okay, got the data now. Need to write CSML feature and NetCDF files. 
     
    8380     
    8481    #create a stand alone gridseries feature containing this coverage 
    85     subsettedFeature=csmlWrap.createGridSeriesFeature(value=cvg,datasetID="A",featureID="B",description="C") 
     82    subsettedFeature=csmlWrap.createGridSeriesFeature(value=cvg,featureID=self.id,description=self.description) 
    8683  
    8784     
  • TI02-CSML/trunk/csml/csmllibs/csmlfeaturetypes.py

    r2060 r2105  
    163163        if len(dimNames) <= 2: 
    164164                #it's an axis or bounds not a feature, try next variable 
    165             return None #(should this be None, None, None ?) 
     165            return None, None, None 
    166166        unitlist=[] 
    167167        for dim in dimNames: 
  • TI02-CSML/trunk/csml/csmllibs/csmlfeaturewrap.py

    r2073 r2105  
    5151        pass 
    5252 
    53     def createGridSeriesFeature(self,value, parameter=None,datasetID=None,featureID=None,description=None): 
     53    def createGridSeriesFeature(self,value, parameter=None,featureID=None,description=None): 
    5454        feat=csml.parser.GridSeriesFeature() 
    5555        if featureID: 
     
    5858            feat.id='No ID' 
    5959        if description: 
    60             feat.description=csml.parser.csString(description) 
     60            feat.description=description 
    6161        else: 
    62             feat.description=csml.parser.csString('No Description') 
     62            feat.description='No Description' 
    6363        feat.value=value 
    6464        #feat.parameter=parameter 
  • TI02-CSML/trunk/csml/parser.py

    r2073 r2105  
    580580        csElement.__init__(self,**kwargs) 
    581581         
    582 class TimeSeriesDomain(AbstractGML, csElement): 
     582class TimeSeries(AbstractGML, csElement): 
    583583    def __init__(self, **kwargs): 
    584584        AbstractGML.__init__(self,**kwargs) 
     
    590590    def __init__(self, **kwargs): 
    591591        AbstractDiscreteCoverage.__init__(self,**kwargs) 
    592         children={'pointSeriesDomain':[CSML('TimeSeriesDomain'),'TimeSeriesDomain' ,CSML('pointSeriesDomain') ], 'rangeSet':[GML('rangeSet'), 'RangeSet'],'coverageFunction':[GML('coverageFunction'),'csString']} 
     592        children={'pointSeriesDomain':[CSML('TimeSeries'),'TimeSeries' ,CSML('pointSeriesDomain') ], 'rangeSet':[GML('rangeSet'), 'RangeSet'],'coverageFunction':[GML('coverageFunction'),'csString']} 
    593593        addchildren(self,children) 
    594594        csElement.__init__(self,**kwargs) 
     
    868868 
    869869         
    870 class Dataset(AbstractGML, csElement):     
     870class Dataset(csElement):     
    871871    ''' Dataset class, needed as root of tree''' 
    872872    def __init__(self, **kwargs): 
    873         AbstractGML.__init__(self,**kwargs) 
     873        a=[CSML('id')] 
     874        addatts(self,a) 
    874875        children = {'featureCollection':[CSML('CSMLFeatureCollection') ,'CSMLFeatureCollection'],'storageDescriptor':[CSML('CSMLStorageDescriptor'), 'CSMLStorageDescriptor']} 
    875876        addchildren(self,children) 
Note: See TracChangeset for help on using the changeset viewer.