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

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

subsetting by index initially working for rawfileextracts (more testing needed)

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_RawFileExtract
10import ops_ArrayGenerator
11import ops_AbstractFeature
12import ops_PointFeature
13import ops_PointSeriesFeature
14import ops_ProfileFeature
15import ops_ProfileSeriesFeature
16import ops_GridFeature
17import ops_GridSeriesFeature
18import ops_TrajectoryFeature
19import csmlContainer
20
21def addMethods(obj, meths):
22    for meth in meths:
23        setattr(obj, meth.__name__, meth)
24
25#Assign methods to parser classes
26#Dataset methods:
27addMethods(csml.parser.Dataset, [ops_Dataset.parse, ops_Dataset.getSecurity, ops_Dataset.getFeatureList, ops_Dataset.getFeature, ops_Dataset.getFileExtract])
28
29#AbstractFileExtract methods:
30addMethods(csml.parser.FileExtract, [ops_FileExtract.getData])
31
32#RawFileExtract methods:
33addMethods(csml.parser.RawFileExtract, [ops_RawFileExtract.getData])
34
35#ArrayGenerator methods:
36#addMethods(csml.parser.ArrayGenerator, [ops_ArrayGenerator.getGeneratedValues])
37
38##AbstractFeature methods:
39addMethods(csml.parser.AbstractFeature, [ops_AbstractFeature.testmethod, ops_AbstractFeature.getAllowedSubsettings])
40
41##PointFeature methods:
42#addMethods(csml.parser.PointFeature,[ops_PointFeature.testmethod])
43
44##PointSeriesFeature methods:
45#addMethods(csml.parser.PointSeriesFeature, [ops_PointSeriesFeature.testmethod,ops_PointSeriesFeature.getDomainReference, ops_PointSeriesFeature.getAllowedSubsettings])
46
47##ProfileFeature methods:
48#addMethods(csml.parser.ProfileFeature,[ops_ProfileFeature.testmethod])
49
50##ProfileSeriesFeature methods:
51addMethods(csml.parser.ProfileSeriesFeature,[ops_ProfileSeriesFeature.testmethod, ops_ProfileSeriesFeature.getDomain, ops_ProfileSeriesFeature.subsetToProfile,ops_ProfileSeriesFeature.subsetToPointSeries,ops_ProfileSeriesFeature._subsetProfileSeries])
52
53##GridFeature methods:
54#addMethods(csml.parser.GridFeature,[ops_GridFeature.testmethod])
55
56##GridSeriesFeature methods:
57addMethods(csml.parser.GridSeriesFeature,[ops_GridSeriesFeature.getAllowedSubsettings,ops_GridSeriesFeature.getDomain,ops_GridSeriesFeature.subsetToGridSeries, ops_GridSeriesFeature.getUom,ops_GridSeriesFeature.getSliceIndices, ops_GridSeriesFeature._subsetGrid,ops_GridSeriesFeature.subsetToProfileSeries, ops_GridSeriesFeature.subsetToProfile,ops_GridSeriesFeature.subsetToPointSeries])
58
59##TrajectoryFeature methods:
60#addMethods(csml.parser.TrajectoryFeature, [ops_TrajectoryFeature.testmethod])
Note: See TracBrowser for help on using the repository browser.