source: TI02-CSML/trunk/parser/API/ops_AbstractFileExtract.py @ 1042

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI02-CSML/trunk/parser/API/ops_AbstractFileExtract.py@1042
Revision 1042, 844 bytes checked in by domlowe, 14 years ago (diff)

subsetToGridSeries part working

Line 
1''' ops_AbstractFileExtract  contains operations for AbstractFileExtracts'''
2from API import *
3
4def testmethod(self):
5    print 'testmethod for AbstractFileExtract feature'
6    return 'testmethod AbstractFileExtract'
7
8
9def getData(self, fileposition=None, **kwargs):
10    #should handle setAxis or setVariable as cdms netcdf model
11    #file position defines the position of the filename if a list of filenames exists
12    #**kwargs can hold subsetting request.
13    print fileposition
14   
15    #get the right file
16    if fileposition:
17        file=self.fileName.split()[fileposition]
18    else:
19        file=self.fileName
20   
21    #open the file
22    DI = csmldataiface.DataInterface()
23    DI=DI.getUnknownInterfaceType(file)
24    DI.openFile(file)
25   
26    #get the data
27    DI.setAxis(self.variableName)
28    data=DI.getDataForAxis()
29    return data
Note: See TracBrowser for help on using the repository browser.