-
Notifications
You must be signed in to change notification settings - Fork 1
/
Application.py
40 lines (31 loc) · 1.12 KB
/
Application.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'''
Created on May 13, 2014
@author: tpmaxwel
'''
import cdms2
from PointCloudViewer import CPCPlot
#from VolumeViewer import VolumePlot
from SliceViewer import SlicePlot
from RectilinearGridPlot import RectGridPlot
from ConfigurationFunctions import PlotType
class DV3D:
def __init__( self, **args ):
self.use_gui = args.get( 'gui', False )
if self.use_gui: self.initGui()
def initGui(self):
pass
def init(self, **args ):
init_args = args[ 'init' ]
( grid_file, data_file, interface, varnames, grd_coords, var_proc_op, ROI, subSpace ) = init_args
df = cdms2.open( data_file )
var = df[ varnames[0] ]
grid_metadata = var.getGrid()
plot_type = PlotType.getPointsLayout( grid_metadata )
if plot_type == PlotType.Grid:
g = RectGridPlot(gui=self.use_gui)
# g = SlicePlot(gui=self.use_gui)
# g = VolumePlot(gui=self.use_gui)
g.init( **args )
else:
g = CPCPlot(gui=self.use_gui)
g.init( **args )