1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 from Numeric import Float64, zeros
24 from math import pi
25
26 from ri_comps import calc_fixed_csa, calc_fixed_dip, comp_csa_const_func, comp_dip_const_func
27
28
30 - def __init__(self, frq=None, gx=None, gh=None, mu0=None, h_bar=None):
31 """Reduced spectral density mapping."""
32
33
34 self.data = Data()
35
36
37 self.data.gx = gx
38 self.data.gh = gh
39 self.data.mu0 = mu0
40 self.data.h_bar = h_bar
41
42
43 self.data.num_frq = 1
44
45
46 self.data.dip_const_fixed = 0.0
47 self.data.csa_const_fixed = [0.0]
48 self.data.dip_const_func = 0.0
49 self.data.csa_const_func = zeros(1, Float64)
50
51
52 frqX = 2.0 * pi * frq
53
54
55 self.data.frq_list = zeros((1, 5), Float64)
56 self.data.frq_list[0, 1] = frqX
57 self.data.frq_list[0, 1] = frq - frqX
58 self.data.frq_list[0, 1] = frq
59 self.data.frq_list[0, 1] = frq + frqX
60 self.data.frq_sqrd_list = self.data.frq_list ** 2
61
62
63
65 """Function for calculating the sigma NOE value."""
66
67 return (noe - 1.0) * r1 * self.data.gx / self.data.gh
68
69
70 - def func(self, r=None, csa=None, r1=None, r2=None, noe=None):
71 """Function for calculating the three spectal density values.
72
73 Three values are returned, J(0), J(wX), and J(wH) (or J(0.87wH)).
74 """
75
76
77 calc_fixed_dip(self.data)
78 calc_fixed_csa(self.data)
79
80
81 comp_dip_const_func(self.data, r)
82 comp_csa_const_func(self.data, csa)
83
84
85 d = self.data.dip_const_func
86 c = self.data.csa_const_func[0]
87
88
89 sigma_noe = self.calc_sigma_noe(noe, r1)
90
91
92 j0 = -1.5 / (3.0*d + c) * (0.5*r1 - r2 + 0.6*sigma_noe)
93
94
95 jwx = 1.0 / (3.0*d + c) * (r1 - 1.4*sigma_noe)
96
97
98 jwh = sigma_noe / (5.0*d)
99
100
101 return j0, jwx, jwh
102
103
106 """Empty container for storing data."""
107