1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import sys
24
25
28 """Class containing the function for fixing or allowing parameter values to change."""
29
30 self.relax = relax
31
32
33 - def fix(self, run=None, element=None, fixed=1):
34 """Function for either fixing or allowing parameter values to change.
35
36 Keyword Arguments
37 ~~~~~~~~~~~~~~~~~
38
39 run: The name of the run.
40
41 element: Which element to fix.
42
43 fixed: A flag specifying if the parameters should be fixed or allowed to change.
44
45
46 Description
47 ~~~~~~~~~~~
48
49 The keyword argument 'element' can be any of the following:
50
51 'diff' - the diffusion tensor parameters. This will allow all diffusion tensor parameters
52 to be toggled.
53
54 an integer - if an integer number is given, then all parameters for the residue
55 corresponding to that number will be toggled.
56
57 'all_res' - using this keyword, all parameters from all residues will be toggled.
58
59 'all' - all parameter will be toggled. This is equivalent to combining both 'diff' and
60 'all_res'.
61
62
63 The flag 'fixed', if set to 1, will fix parameters, while a value of 0 will allow parameters
64 to vary.
65
66
67 Only parameters corresponding to the given run will be affected.
68 """
69
70
71 if self.relax.interpreter.intro:
72 text = sys.ps3 + "fix("
73 text = text + "run=" + `run`
74 text = text + ", element=" + `element`
75 text = text + ", fixed=" + `fixed` + ")"
76 print text
77
78
79 if type(run) != str:
80 raise RelaxStrError, ('run', run)
81
82
83 if type(element) != str and type(element) != int:
84 raise RelaxIntStrError, ('element', element)
85
86
87 if type(fixed) != int or (fixed != 0 and fixed != 1):
88 raise RelaxBinError, ('fixed', fixed)
89
90
91 self.relax.generic.fix.fix(run=run, element=element, fixed=fixed)
92