source: TI02-CSML/trunk/csml/API/__init__.py @ 2206

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI02-CSML/trunk/csml/API/__init__.py@2206
Revision 2206, 2.0 KB checked in by domlowe, 13 years ago (diff)

nearest neighbour working for times, plus separation of subsetting into core functions and feature specific ones

Line 
1''' __init__.py  '''
2
3
4#import element tree and the parser api
5from cElementTree import *
6import csml.parser
7import ops_Dataset
8import ops_FileExtract
9import ops_ArrayGenerator
10import ops_AbstractFeature
11import ops_PointFeature
12import ops_PointSeriesFeature
13import ops_ProfileFeature
14import ops_ProfileSeriesFeature
15import ops_GridFeature
16import ops_GridSeriesFeature
17import ops_TrajectoryFeature
18import csmlContainer
19
20def addMethods(obj, meths):
21    for meth in meths:
22        setattr(obj, meth.__name__, meth)
23
24#Assign methods to parser classes
25#Dataset methods:
26addMethods(csml.parser.Dataset, [ops_Dataset.parse, ops_Dataset.getSecurity, ops_Dataset.getFeatureList, ops_Dataset.getFeature, ops_Dataset.getFileExtract])
27
28#AbstractFileExtract methods:
29addMethods(csml.parser.FileExtract, [ops_FileExtract.getData])
30
31#ArrayGenerator methods:
32#addMethods(csml.parser.ArrayGenerator, [ops_ArrayGenerator.getGeneratedValues])
33
34##AbstractFeature methods:
35addMethods(csml.parser.AbstractFeature, [ops_AbstractFeature.testmethod, ops_AbstractFeature.getAllowedSubsettings])
36
37##PointFeature methods:
38#addMethods(csml.parser.PointFeature,[ops_PointFeature.testmethod])
39
40##PointSeriesFeature methods:
41#addMethods(csml.parser.PointSeriesFeature, [ops_PointSeriesFeature.testmethod,ops_PointSeriesFeature.getDomainReference, ops_PointSeriesFeature.getAllowedSubsettings])
42
43##ProfileFeature methods:
44#addMethods(csml.parser.ProfileFeature,[ops_ProfileFeature.testmethod])
45
46##ProfileSeriesFeature methods:
47#addMethods(csml.parser.ProfileSeriesFeature,[ops_ProfileSeriesFeature.testmethod])
48
49##GridFeature methods:
50#addMethods(csml.parser.GridFeature,[ops_GridFeature.testmethod])
51
52##GridSeriesFeature methods:
53addMethods(csml.parser.GridSeriesFeature,[ops_GridFeature.testmethod,ops_GridSeriesFeature.getDomain,ops_GridSeriesFeature.subsetToGridSeries, ops_GridSeriesFeature.getUom, ops_GridSeriesFeature._subsetGrid])
54
55##TrajectoryFeature methods:
56#addMethods(csml.parser.TrajectoryFeature, [ops_TrajectoryFeature.testmethod])
Note: See TracBrowser for help on using the repository browser.