source: trunk/testinp/gensgtbx.py @ 4386

Last change on this file since 4386 was 93, checked in by toby, 15 years ago

G2lattice: add GetBraviasNum? to interface GenHBravais to G2spc.SpcGroup? output

load test data only when needed

Makefile (etc): reorganize Makefile so that make all build targets where all sources

where all sources are provided

G2path: define a platform-specific path and prepend the bin directory if it exists; bin

is assumed to be locally built, which takes precedence over distributed files

  • Property svn:executable set to *
File size: 5.6 KB
Line 
1#!/usr/bin/env /Users/toby/build/cctbx_build/bin/python
2'''
3Generate symmetry operations in cctbx.sgtbx for use in testing the
4GSASII space group generation code. All 230 spacegroups are tested plus
5rhombohedral settings of R space groups.
6
7 The output from this is placed in sgtbxtestinp.py which contains a dictionary
8 sgtbx that can be used for testing.
9
10'''
11
12from cctbx import sgtbx
13import sys
14import datetime
15
16def GenSGdat(spc):
17    fp.write("'%s': [\n" % spc)
18    s=sgtbx.space_group_info(spc)
19    for s1 in s.group():
20#        print s1.as_double_array()
21        fp.write("%s ,\n" % (s1.as_double_array(),))
22    fp.write("],\n\n")
23
24fp = open('sgtbxtestinp.py','w')
25fp.write("# output from sgtbx computed on platform %s on %s\n" %
26         (sys.platform, datetime.date.today()) )
27fp.write("sgtbx = {\n")
28#cubic
29GenSGdat('p 2 3')
30GenSGdat('f 2 3')
31GenSGdat('i 2 3')
32GenSGdat('p 21 3')
33GenSGdat('i 21 3')
34GenSGdat('p m 3')
35GenSGdat('p n -3')
36GenSGdat('f m 3')
37GenSGdat('f d -3')
38GenSGdat('i m -3')
39GenSGdat('p a 3')
40GenSGdat('i a 3')
41GenSGdat('p 4 3 2')
42GenSGdat('p 42 3 2')
43GenSGdat('f 4 3 2')
44GenSGdat('f 41 3 2')
45GenSGdat('i 4 3 2')
46GenSGdat('p 43 3 2')
47GenSGdat('p 41 3 2')
48GenSGdat('i 41 3 2')
49GenSGdat('p -4 3 m')
50GenSGdat('f -4 3 m')
51GenSGdat('i -4 3 m')
52GenSGdat('p -4 3 n')
53GenSGdat('f -4 3 c')
54GenSGdat('i -4 3 d')
55GenSGdat('p m -3 m')
56GenSGdat('p n -3 n')
57GenSGdat('p m -3 n')
58GenSGdat('p n -3 m')
59GenSGdat('f m -3 m')
60GenSGdat('f m -3 c')
61GenSGdat('f d -3 m')
62GenSGdat('f d -3 c')
63GenSGdat('i m -3 m')
64GenSGdat('i a -3 d')
65# ortho
66GenSGdat('p 2 2 2')
67GenSGdat('p 2 2 21')
68GenSGdat('p 21 21 2')
69GenSGdat('p 21 21 21')
70GenSGdat('c 2 2 21')
71GenSGdat('c 2 2 2')
72GenSGdat('f 2 2 2')
73GenSGdat('i 2 2 2')
74GenSGdat('i 21 21 21')
75GenSGdat('p m m 2')
76GenSGdat('p m c 21')
77GenSGdat('p c c 2')
78GenSGdat('p m a 2')
79GenSGdat('p c a 21')
80GenSGdat('p n c 2')
81GenSGdat('p m n 21')
82GenSGdat('p b a 2')
83GenSGdat('p n a 21')
84GenSGdat('p n n 2')
85GenSGdat('c m m 2')
86GenSGdat('c m c 21')
87GenSGdat('c c c 2')
88GenSGdat('a m m 2')
89GenSGdat('a b m 2')
90GenSGdat('a m a 2')
91GenSGdat('a b a 2')
92GenSGdat('f m m 2')
93GenSGdat('f d d 2')
94GenSGdat('i m m 2')
95GenSGdat('i b a 2')
96GenSGdat('i m a 2')
97GenSGdat('p m m m')
98GenSGdat('p n n n')
99GenSGdat('p c c m')
100GenSGdat('p b a n')
101GenSGdat('p m m a')
102GenSGdat('p n n a')
103GenSGdat('p m n a')
104GenSGdat('p c c a')
105GenSGdat('p b a m')
106GenSGdat('p c c n')
107GenSGdat('p b c m')
108GenSGdat('p n n m')
109GenSGdat('p m m n')
110GenSGdat('p b c n')
111GenSGdat('p b c a')
112GenSGdat('p n m a')
113GenSGdat('c m c m')
114GenSGdat('c m c a')
115GenSGdat('c m m m')
116GenSGdat('c c c m')
117GenSGdat('c m m a')
118GenSGdat('c c c a')
119GenSGdat('f m m m')
120GenSGdat('f d d d')
121GenSGdat('i m m m')
122GenSGdat('i b a m')
123GenSGdat('i b c a')
124GenSGdat('i m m a')
125# tetragonal
126GenSGdat('p 4')
127GenSGdat('p 41')
128GenSGdat('p 42')
129GenSGdat('p 43')
130GenSGdat('i 4')
131GenSGdat('i 41')
132GenSGdat('p -4')
133GenSGdat('i -4')
134GenSGdat('p 4/m')
135GenSGdat('p 42/m')
136GenSGdat('p 4/n')
137GenSGdat('p 42/n')
138GenSGdat('i 4/m')
139GenSGdat('i 41/a')
140GenSGdat('p 4 2 2')
141GenSGdat('p 4 21 2')
142GenSGdat('p 41 2 2')
143GenSGdat('p 41 21 2')
144GenSGdat('p 42 2 2')
145GenSGdat('p 42 21 2')
146GenSGdat('p 43 2 2')
147GenSGdat('p 43 21 2')
148GenSGdat('i 4 2 2')
149GenSGdat('i 41 2 2')
150GenSGdat('p 4 m m')
151GenSGdat('p 4 b m')
152GenSGdat('p 42 c m')
153GenSGdat('p 42 n m')
154GenSGdat('p 4 c c')
155GenSGdat('p 4 n c')
156GenSGdat('p 42 m c')
157GenSGdat('p 42 b c')
158GenSGdat('i 4 m m')
159GenSGdat('i 4 c m')
160GenSGdat('i 41 m d')
161GenSGdat('i 41 c d')
162GenSGdat('p -4 2 m')
163GenSGdat('p -4 2 c')
164GenSGdat('p -4 21 m')
165GenSGdat('p -4 21 c')
166GenSGdat('p -4 m 2')
167GenSGdat('p -4 c 2')
168GenSGdat('p -4 b 2')
169GenSGdat('p -4 n 2')
170GenSGdat('i -4 m 2')
171GenSGdat('i -4 c 2')
172GenSGdat('i -4 2 m')
173GenSGdat('i -4 2 d')
174GenSGdat('p 4/m m m')
175GenSGdat('p 4/m c c')
176GenSGdat('p 4/n b m')
177GenSGdat('p 4/n n c')
178GenSGdat('p 4/m b m')
179GenSGdat('p 4/m n c')
180GenSGdat('p 4/n m m')
181GenSGdat('p 4/n c c')
182GenSGdat('p 42/m m c')
183GenSGdat('p 42/m c m')
184GenSGdat('p 42/n b c')
185GenSGdat('p 42/n n m')
186GenSGdat('p 42/m b c')
187GenSGdat('p 42/m n m')
188GenSGdat('p 42/n m c')
189GenSGdat('p 42/n c m')
190GenSGdat('i 4/m m m')
191GenSGdat('i 4/m c m')
192GenSGdat('i 41/a m d')
193GenSGdat('i 41/a c d')
194# triclinic
195GenSGdat('p 1')
196GenSGdat('p -1')
197# monoclinic
198GenSGdat('p 2')
199GenSGdat('p 21')
200GenSGdat('c 2')
201GenSGdat('p m')
202GenSGdat('p c')
203GenSGdat('c m')
204GenSGdat('c c')
205GenSGdat('p 2/m')
206GenSGdat('p 21/m')
207GenSGdat('c 2/m')
208GenSGdat('p 2/c')
209GenSGdat('p 21/c')
210GenSGdat('c 2/c')
211# trigonal
212GenSGdat('p 3')
213GenSGdat('p 31')
214GenSGdat('p 32')
215GenSGdat('r 3')
216GenSGdat('r 3 r')
217GenSGdat('p -3')
218GenSGdat('r -3')
219GenSGdat('r -3 r')
220GenSGdat('p 3 1 2')
221GenSGdat('p 3 2 1')
222GenSGdat('p 31 1 2')
223GenSGdat('p 31 2 1')
224GenSGdat('p 32 1 2')
225GenSGdat('p 32 2 1')
226GenSGdat('r 3 2 h')
227GenSGdat('r 3 2 r')
228GenSGdat('p 3 m 1')
229GenSGdat('p 3 1 m')
230GenSGdat('p 3 c 1')
231GenSGdat('p 3 1 c')
232GenSGdat('r 3 m h')
233GenSGdat('r 3 m r')
234GenSGdat('r 3 c')
235GenSGdat('r 3 c r')
236GenSGdat('p -3 1 m')
237GenSGdat('p -3 1 c')
238GenSGdat('p -3 m 1')
239GenSGdat('p -3 c 1')
240GenSGdat('r -3 m')
241GenSGdat('r -3 m r')
242GenSGdat('r -3 c')
243GenSGdat('r -3 c r')
244# hexagonal
245GenSGdat('p 6')
246GenSGdat('p 61')
247GenSGdat('p 65')
248GenSGdat('p 62')
249GenSGdat('p 64')
250GenSGdat('p 63')
251GenSGdat('p -6')
252GenSGdat('p 6/m')
253GenSGdat('p 63/m')
254GenSGdat('p 6 2 2')
255GenSGdat('p 61 2 2')
256GenSGdat('p 65 2 2')
257GenSGdat('p 62 2 2')
258GenSGdat('p 64 2 2')
259GenSGdat('p 63 2 2')
260GenSGdat('p 6 m m')
261GenSGdat('p 6 c c')
262GenSGdat('p 63 c m')
263GenSGdat('p 63 m c')
264GenSGdat('p -6 m 2')
265GenSGdat('p -6 c 2')
266GenSGdat('p -6 2 m')
267GenSGdat('p -6 2 c')
268GenSGdat('p 6/m m m')
269GenSGdat('p 6/m c c')
270GenSGdat('p 63/m c m')
271GenSGdat('p 63/m m c')
272# non-standard
273GenSGdat('p 21 1 1')
274GenSGdat('p 1 21 1')
275GenSGdat('p 1 1 21')
276fp.write("}\n")
277fp.close()
Note: See TracBrowser for help on using the repository browser.