Changeset 1093


Ignore:
Timestamp:
05/06/06 12:52:57 (13 years ago)
Author:
domlowe
Message:

Can set file paths of output xml and netcdf. Added example to apicalls.py

Location:
TI02-CSML/trunk/parser
Files:
2 edited

Legend:

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

    r1086 r1093  
    5050         
    5151 
    52 def subsetToGridSeries(self, timeSubset,  **kwargs): 
    53     pathToSubsetCSML = 'temp.xml' 
    54     pathToSubsetNetCDF='temp.nc' 
     52def subsetToGridSeries(self, timeSubset,  csmlpath=None, ncpath=None,**kwargs): 
     53    if csmlpath is not None: 
     54        pathToSubsetCSML = csmlpath 
     55    else: 
     56        pathToSubsetCSML='temp.xml' 
     57    if ncpath is not None: 
     58        pathToSubsetNetCDF=ncpath 
     59    else: 
     60        pathToSubsetCSML='temp.nc' 
     61 
    5562    domainref = getDomainReference(self)  
    5663    self.times=timeSubset 
  • TI02-CSML/trunk/parser/apicalls.py

    r1086 r1093  
    1818print '\n Selecting feature with gml:id = %s' %flist[5] 
    1919feature=csml.getFeature(flist[5]) 
     20 
     21#feature 'bestname' 
     22print feature.id 
     23print feature.description 
    2024 
    2125#get the domain of the feature 
     
    4347spatialSubsetDictionary['longitude']=(90, 120.0) 
    4448 
    45 #request subsetted data from feature 
    46 subsetCSML, subsetNetCDF, arraySize=feature.subsetToGridSeries(timeSelection, **spatialSubsetDictionary) 
     49#request subsetted data from feature (can set paths here) 
     50subsetCSML, subsetNetCDF, arraySize=feature.subsetToGridSeries(timeSelection,  csmlpath='myfile.xml', ncpath='myfile.nc',**spatialSubsetDictionary) 
    4751 
    4852print subsetCSML #csml document (string) 
Note: See TracChangeset for help on using the changeset viewer.