1
2
3
4
5
6
7
8
9
10
11
12
13
14 """
15 This package contains the Atom class in SrRietveld, which is an script interface
16 to access the atom information
17 """
18
19 __id__ = "$Id: atom.py 6726 2011-08-25 09:36:23Z yshang $"
20
21 from diffpy.refinementdata.refinable import Refinable
22 from diffpy.srrietveld.paramnames import PARAMNAMES
23
24 -class Atom(Refinable):
25
26 """Atom is a Refinable component which contains multiple parameters.
27 A composite function may also contain other functions.
28
29 data member:
30
31 formula: a string of the function definition in C style
32 variables: a space separated string of all variables in the formula
33 """
34 - def __init__(self, owner, name=None, handle=None, formula=None, variables=None, shape=None):
35 """Initialization.
36
37 @type owner: a data project
38 @param owner: the owner, which is usually a refinement.
39 @type name: string
40 @param name the name of the pattern
41 @type handle: a HDF5Handle object
42 @param handle: a HDF5Handle pointing to the underlying HDF5 node.
43 @type formula: string
44 @param formula: a string of the function definition in C style
45 @type variables: a space separated string
46 @param variables: a space separated string of all variables
47
48 A name is passed to the initialization method when creating a node.
49
50 A handle is passed to the inialization method in two cases:
51 1. when loading from a HDF5 file;
52 2. when creating a HDF5 file but the object is a hard link to
53 a preexisiting one.
54
55 In the case when both name and handle are given, name will be simply ignored.
56 In the case when neither name nor handle is given, an exception will be raised.
57
58 Generally, in the scripting interface, users do not have to call this
59 constructor directly
60 """
61 Refinable.__init__(self, owner, name, handle, shape)
62 return
63
64
66 '''Get the engine type for this refinement
67
68 @return: the string of the engine type, for example I{"gsas"} or I{"fullprof"}'''
69
70 return self.owner.owner.getEngineType()
71
73 '''
74 Get the Biso values
75
76 @return: the Biso values
77 '''
78 return self.getByPath(PARAMNAMES[self.getEngineType()]["Biso"])
79
81 '''
82 Get the Biso standard deviations
83
84 @return: the Biso standard deviations
85 '''
86 return self.getSigmaByPath(PARAMNAMES[self.getEngineType()]["Biso"])
87
89 '''
90 Get atom name. The atom name is the atom type with the id number
91
92 @return: the atom name string
93 '''
94 return self.getByPath(PARAMNAMES[self.getEngineType()]["name"]).first()
95
97 '''
98 Get the occupations of the atom
99
100 @return: the occupation values
101 '''
102 return self.getByPath(PARAMNAMES[self.getEngineType()]["occupation"])
103
105 '''
106 Get atom type
107
108 @return: the atoms type
109 '''
110 return self.getByPath(PARAMNAMES[self.getEngineType()]["type"]).first()
111
113 '''
114 Get the Uiso values
115
116 @return: the Uiso values
117 '''
118 return self.getByPath(PARAMNAMES[self.getEngineType()]["Uiso"])
119
121 '''
122 Get the Uiso standard deviations
123
124 @return: the Uiso standard deviations
125 '''
126 return self.getSigmaByPath(PARAMNAMES[self.getEngineType()]["Uiso"])
127
129 '''
130 Get the x fractional coordinates
131
132 @return: the x fractional coordinate values
133 '''
134 return self.getByPath(PARAMNAMES[self.getEngineType()]["X"])
135
137 '''
138 Get the x fractional coordinate standard deviations
139
140 @return: the x fractional coordinate standard deviations
141 '''
142 return self.getSigmaByPath(PARAMNAMES[self.getEngineType()]["X"])
143
145 '''
146 Get the y fractional coordinates
147
148 @return: the y fractional coordinate values
149 '''
150 return self.getByPath(PARAMNAMES[self.getEngineType()]["Y"])
151
153 '''
154 Get the y fractional coordinate standard deviations
155
156 @return: the y fractional coordinate standard deviations
157 '''
158 return self.getSigmaByPath(PARAMNAMES[self.getEngineType()]["Y"])
159
161 '''
162 Get the z fractional coordinates
163
164 @return: the z fractional coordinate values
165 '''
166 return self.getByPath(PARAMNAMES[self.getEngineType()]["Z"])
167
169 '''
170 Get the z fractional coordinate standard deviations
171
172 @return: the z fractional coordinate standard deviations
173 '''
174 return self.getSigmaByPath(PARAMNAMES[self.getEngineType()]["Z"])
175