1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 from os import system
24 from re import search
25
26 from isosurface_3D import Iso3D
27
28
31 """Class containting the function for OpenDX."""
32
33
34 self.relax = relax
35
36
37 self.iso3d = Iso3D(relax)
38
39
40 - def map(self, run=None, params=None, map_type='Iso3D', res_num=None, inc=20, lower=None, upper=None, axis_incs=10, file="map", dir="dx", point=None, point_file="point", remap=None):
41 """Function for mapping the given space and creating OpenDX files."""
42
43
44 index = None
45 if res_num:
46 for i in xrange(len(self.relax.data.res[run])):
47 if self.relax.data.res[run][i].num == res_num:
48 index = i
49 break
50 if index == None:
51 raise RelaxNoResError, res_num
52
53
54 if search("^[Ii]so3[Dd]", map_type):
55 if len(params) != 3:
56 raise RelaxError, "The 3D isosurface map requires a 3 parameter model."
57
58
59 self.iso3d.map_space(run, params, res_num, index, inc, lower, upper, axis_incs, file, dir, point, point_file, remap)
60 else:
61 raise RelaxError, "The map type '" + map_type + "' is not supported."
62
63
64 - def run(self, file="map", dir="dx", dx_exe="dx", vp_exec=1):
65 """Function for running OpenDX."""
66
67
68 dir_text = ""
69 if dir != None:
70 dir_text = " -directory " + dir
71
72
73 execute_text = ""
74 if vp_exec:
75 execute_text = " -execute"
76
77
78 system(dx_exe + dir_text + " -program " + file + ".net" + execute_text + " &")
79