Changeset 2550


Ignore:
Timestamp:
06/06/07 15:36:09 (12 years ago)
Author:
domlowe
Message:

more on pointseries and qxf

Location:
TI02-CSML/trunk/csml/API
Files:
2 edited

Legend:

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

    r2548 r2550  
    8383     
    8484    
    85     #Now write out the CSML Feature 
     85    #Now write out the CSML Feature: 
     86    #create a PointSeriesCoverage 
     87    cvg=csml.parser.PointSeriesCoverage() 
     88    cvg.id=csml.csmllibs.csmlextra.getRandomID() 
     89     
     90    #create a TimeSeriesDomain (appropriate domain for a PointSeriesFeature 
     91    ptsd=csml.parser.TimeSeries() 
     92    ptsd.id=csml.csmllibs.csmlextra.getRandomID() 
     93    #create (and populate) a TimePositionList. Using keyword arguements for conciseness. 
     94    ptsd.timePositionList=csml.parser.TimePositionList(CONTENT=csml.csmllibs.csmlextra.stringify(selectedTimes)) 
     95         
     96    sdid=csml.csmllibs.csmlextra.getRandomID() # for the storage descriptor 
     97    #create a RangeSet 
     98    rs=csml.parser.RangeSet() 
     99    va=csml.parser.ValueArray() 
     100    vc=csml.parser.MeasureOrNullList() 
     101    vc.href='#%s'%sdid 
     102    vc.arcrole="http://ndg.nerc.ac.uk/xlinkUsage/insert#QuantityList" 
     103    vc.role="http://ndg.nerc.ac.uk/fileFormat/csmlStorageDescriptor" 
     104    vc.show='embed' 
     105    try: 
     106        vc.uom=self.value.rangeSet.valueArray.valueComponent.uom 
     107    except: 
     108        vc.uom = 'unknown'  #TODO, 
     109    va.valueComponent=vc 
     110    va.id=csml.csmllibs.csmlextra.getRandomID() 
     111    rs.valueArray=va 
     112     
     113     
     114    #Add the domain and rangeSet as attributes of the coverage 
     115    cvg.pointSeriesDomain=ptsd 
     116    cvg.rangeSet=rs 
     117     
     118    totalArraySize=10 
     119    descriptor=csml.parser.NetCDFExtract(id=sdid,fileName=csml.parser.csString(pathToSubsetNetCDF),variableName=self.name,arraySize=csml.parser.csString(totalArraySize)) 
     120 
     121     
     122    #the parameter of the feature is of type Phenomenon, here href creates "xlink:href=..." 
     123    param=csml.parser.Phenomenon(href='CFStandardNames.xml#temperature') 
     124     
     125     
     126     
     127    #create a stand alone pointseries feature containing this coverage 
     128    csmlWrap=csml.csmllibs.csmlfeaturewrap.CSMLWrapper() 
     129    subsettedFeature=csmlWrap.createPointSeriesFeature(value=cvg,parameter=param,location=self.location,featureID=self.id,description=self.description) 
     130     
     131     
     132     
    86133     
    87134    #Now write out the NetCDF File:    
     
    106153    var.setAxis(0,timeAx)       
    107154    nc.write(var) 
    108     nc.close() 
    109     sys.exit() 
     155    nc.close()    
    110156    print 'NetCDF file written to %s'%pathToSubsetNetCDF 
    111157    return subsettedFeature, pathToSubsetNetCDF, descriptor 
  • TI02-CSML/trunk/csml/API/ops_ProfileSeriesFeature.py

    r2527 r2550  
    127127     
    128128     
    129     #gridseries coverage 
     129    #profileseries coverage 
    130130    cvg=csml.parser.ProfileSeriesCoverage() 
    131131    cvg.rangeSet=rs 
Note: See TracChangeset for help on using the changeset viewer.