1 '''Module to initiate all global variables for theia.'''
2
3
4
5
7 '''Initiate globals with dictionary.
8
9 dic: dictionary holding values for globals. [dictionary]
10
11 '''
12
13 global info
14 global warning
15 global text
16 global cad
17 global fname
18 global fclib
19 global antiClip
20 global short
21 global clipFactor
22
23 global FCFactor
24
25
26 global zero
27 global inf
28 global flatK
29
30
31 global inOrder
32 global types
33 global typeStrings
34
35
36 zero = 1.e-10
37 inf = 1.e15
38 flatK = 1.e-5
39 clipFactor = 2.
40 FCFactor = 0.001
41
42
43 inOrder = {
44
45 'bm': ['Wx','Wy','WDistx','WDisty','Wl','P',
46 'X','Y','Z','Theta','Phi','Alpha','Ref'],
47
48 'mr': ['X','Y','Z','Theta','Phi','Wedge','Alpha',
49 'HRK','ARK','Diameter','Thickness','N','HRr','HRt','ARr','ARt',
50 'KeepI', 'Ref'],
51
52 'sp': ['RonHR', 'TonHR', 'RonAR', 'TonAR',
53 'X','Y','Z','Theta','Phi','Wedge','Alpha',
54 'HRK','ARK','Diameter','Thickness','N','HRr','HRt','ARr','ARt',
55 'KeepI', 'Ref'],
56
57 'bs': ['X','Y','Z','Theta','Phi','Wedge','Alpha',
58 'HRK','ARK','Diameter','Thickness','N','HRr','HRt','ARr','ARt',
59 'KeepI', 'Ref'],
60
61 'th': ['X','Y','Z','Theta','Phi','Focal','Diameter',
62 'R','T','KeepI','Ref'],
63
64 'tk': ['X','Y','Z','Theta','Phi','K1','K2','Diameter',
65 'Thickness','N','R','T','KeepI','Ref'],
66
67 'bd': ['X','Y','Z','Theta','Phi','Diameter','Thickness', 'Ref'],
68 'gh': ['X','Y','Z','Theta','Phi','Diameter', 'Ref'],
69 'bo': ['X', 'Y', 'Z']}
70
71
72 types = {'X': float, 'Y': float, 'Z': float,
73 'Theta': float, 'Phi': float, 'Diameter': float,
74 'Thickness': float, 'Ref': str, 'K1': float, 'K2': float,
75 'KeepI': bool, 'T': float, 'R': float, 'N': float, 'Focal': float,
76 'HRK': float, 'ARK': float,
77 'HRr': float, 'HRt': float,'ARr': float,'ARt': float,
78 'Wedge': float, 'Alpha': float,
79 'RonHR': int, 'TonHR': int, 'RonAR': int, 'TonAR': int,
80 'Wx': float, 'Wy': float, 'WDistx': float, 'WDisty': float,
81 'Wl': float, 'P': float}
82
83
84 typeStrings = {float: 'float', int: 'int', str: 'string', bool: 'boolean'}
85
86
87 info = dic['info']
88 warning = dic['warning']
89 text = dic['text']
90 cad = dic['cad']
91 fname = dic['fname']
92 fclib = dic['fclib']
93 antiClip = dic['antiClip']
94 short = dic['short']
95