#!/usr/bin/env /Users/toby/build/cctbx_build/bin/python ''' Generate symmetry operations in cctbx.sgtbx for use in testing the GSASII space group generation code. All 230 spacegroups are tested plus rhombohedral settings of R space groups. The output from this is placed in sgtbxtestinp.py which contains a dictionary sgtbx that can be used for testing. ''' from cctbx import sgtbx import sys import datetime def GenSGdat(spc): fp.write("'%s': [\n" % spc) s=sgtbx.space_group_info(spc) for s1 in s.group(): # print s1.as_double_array() fp.write("%s ,\n" % (s1.as_double_array(),)) fp.write("],\n\n") fp = open('sgtbxtestinp.py','w') fp.write("# output from sgtbx computed on platform %s on %s\n" % (sys.platform, datetime.date.today()) ) fp.write("sgtbx = {\n") #cubic GenSGdat('p 2 3') GenSGdat('f 2 3') GenSGdat('i 2 3') GenSGdat('p 21 3') GenSGdat('i 21 3') GenSGdat('p m 3') GenSGdat('p n -3') GenSGdat('f m 3') GenSGdat('f d -3') GenSGdat('i m -3') GenSGdat('p a 3') GenSGdat('i a 3') GenSGdat('p 4 3 2') GenSGdat('p 42 3 2') GenSGdat('f 4 3 2') GenSGdat('f 41 3 2') GenSGdat('i 4 3 2') GenSGdat('p 43 3 2') GenSGdat('p 41 3 2') GenSGdat('i 41 3 2') GenSGdat('p -4 3 m') GenSGdat('f -4 3 m') GenSGdat('i -4 3 m') GenSGdat('p -4 3 n') GenSGdat('f -4 3 c') GenSGdat('i -4 3 d') GenSGdat('p m -3 m') GenSGdat('p n -3 n') GenSGdat('p m -3 n') GenSGdat('p n -3 m') GenSGdat('f m -3 m') GenSGdat('f m -3 c') GenSGdat('f d -3 m') GenSGdat('f d -3 c') GenSGdat('i m -3 m') GenSGdat('i a -3 d') # ortho GenSGdat('p 2 2 2') GenSGdat('p 2 2 21') GenSGdat('p 21 21 2') GenSGdat('p 21 21 21') GenSGdat('c 2 2 21') GenSGdat('c 2 2 2') GenSGdat('f 2 2 2') GenSGdat('i 2 2 2') GenSGdat('i 21 21 21') GenSGdat('p m m 2') GenSGdat('p m c 21') GenSGdat('p c c 2') GenSGdat('p m a 2') GenSGdat('p c a 21') GenSGdat('p n c 2') GenSGdat('p m n 21') GenSGdat('p b a 2') GenSGdat('p n a 21') GenSGdat('p n n 2') GenSGdat('c m m 2') GenSGdat('c m c 21') GenSGdat('c c c 2') GenSGdat('a m m 2') GenSGdat('a b m 2') GenSGdat('a m a 2') GenSGdat('a b a 2') GenSGdat('f m m 2') GenSGdat('f d d 2') GenSGdat('i m m 2') GenSGdat('i b a 2') GenSGdat('i m a 2') GenSGdat('p m m m') GenSGdat('p n n n') GenSGdat('p c c m') GenSGdat('p b a n') GenSGdat('p m m a') GenSGdat('p n n a') GenSGdat('p m n a') GenSGdat('p c c a') GenSGdat('p b a m') GenSGdat('p c c n') GenSGdat('p b c m') GenSGdat('p n n m') GenSGdat('p m m n') GenSGdat('p b c n') GenSGdat('p b c a') GenSGdat('p n m a') GenSGdat('c m c m') GenSGdat('c m c a') GenSGdat('c m m m') GenSGdat('c c c m') GenSGdat('c m m a') GenSGdat('c c c a') GenSGdat('f m m m') GenSGdat('f d d d') GenSGdat('i m m m') GenSGdat('i b a m') GenSGdat('i b c a') GenSGdat('i m m a') # tetragonal GenSGdat('p 4') GenSGdat('p 41') GenSGdat('p 42') GenSGdat('p 43') GenSGdat('i 4') GenSGdat('i 41') GenSGdat('p -4') GenSGdat('i -4') GenSGdat('p 4/m') GenSGdat('p 42/m') GenSGdat('p 4/n') GenSGdat('p 42/n') GenSGdat('i 4/m') GenSGdat('i 41/a') GenSGdat('p 4 2 2') GenSGdat('p 4 21 2') GenSGdat('p 41 2 2') GenSGdat('p 41 21 2') GenSGdat('p 42 2 2') GenSGdat('p 42 21 2') GenSGdat('p 43 2 2') GenSGdat('p 43 21 2') GenSGdat('i 4 2 2') GenSGdat('i 41 2 2') GenSGdat('p 4 m m') GenSGdat('p 4 b m') GenSGdat('p 42 c m') GenSGdat('p 42 n m') GenSGdat('p 4 c c') GenSGdat('p 4 n c') GenSGdat('p 42 m c') GenSGdat('p 42 b c') GenSGdat('i 4 m m') GenSGdat('i 4 c m') GenSGdat('i 41 m d') GenSGdat('i 41 c d') GenSGdat('p -4 2 m') GenSGdat('p -4 2 c') GenSGdat('p -4 21 m') GenSGdat('p -4 21 c') GenSGdat('p -4 m 2') GenSGdat('p -4 c 2') GenSGdat('p -4 b 2') GenSGdat('p -4 n 2') GenSGdat('i -4 m 2') GenSGdat('i -4 c 2') GenSGdat('i -4 2 m') GenSGdat('i -4 2 d') GenSGdat('p 4/m m m') GenSGdat('p 4/m c c') GenSGdat('p 4/n b m') GenSGdat('p 4/n n c') GenSGdat('p 4/m b m') GenSGdat('p 4/m n c') GenSGdat('p 4/n m m') GenSGdat('p 4/n c c') GenSGdat('p 42/m m c') GenSGdat('p 42/m c m') GenSGdat('p 42/n b c') GenSGdat('p 42/n n m') GenSGdat('p 42/m b c') GenSGdat('p 42/m n m') GenSGdat('p 42/n m c') GenSGdat('p 42/n c m') GenSGdat('i 4/m m m') GenSGdat('i 4/m c m') GenSGdat('i 41/a m d') GenSGdat('i 41/a c d') # triclinic GenSGdat('p 1') GenSGdat('p -1') # monoclinic GenSGdat('p 2') GenSGdat('p 21') GenSGdat('c 2') GenSGdat('p m') GenSGdat('p c') GenSGdat('c m') GenSGdat('c c') GenSGdat('p 2/m') GenSGdat('p 21/m') GenSGdat('c 2/m') GenSGdat('p 2/c') GenSGdat('p 21/c') GenSGdat('c 2/c') # trigonal GenSGdat('p 3') GenSGdat('p 31') GenSGdat('p 32') GenSGdat('r 3') GenSGdat('r 3 r') GenSGdat('p -3') GenSGdat('r -3') GenSGdat('r -3 r') GenSGdat('p 3 1 2') GenSGdat('p 3 2 1') GenSGdat('p 31 1 2') GenSGdat('p 31 2 1') GenSGdat('p 32 1 2') GenSGdat('p 32 2 1') GenSGdat('r 3 2 h') GenSGdat('r 3 2 r') GenSGdat('p 3 m 1') GenSGdat('p 3 1 m') GenSGdat('p 3 c 1') GenSGdat('p 3 1 c') GenSGdat('r 3 m h') GenSGdat('r 3 m r') GenSGdat('r 3 c') GenSGdat('r 3 c r') GenSGdat('p -3 1 m') GenSGdat('p -3 1 c') GenSGdat('p -3 m 1') GenSGdat('p -3 c 1') GenSGdat('r -3 m') GenSGdat('r -3 m r') GenSGdat('r -3 c') GenSGdat('r -3 c r') # hexagonal GenSGdat('p 6') GenSGdat('p 61') GenSGdat('p 65') GenSGdat('p 62') GenSGdat('p 64') GenSGdat('p 63') GenSGdat('p -6') GenSGdat('p 6/m') GenSGdat('p 63/m') GenSGdat('p 6 2 2') GenSGdat('p 61 2 2') GenSGdat('p 65 2 2') GenSGdat('p 62 2 2') GenSGdat('p 64 2 2') GenSGdat('p 63 2 2') GenSGdat('p 6 m m') GenSGdat('p 6 c c') GenSGdat('p 63 c m') GenSGdat('p 63 m c') GenSGdat('p -6 m 2') GenSGdat('p -6 c 2') GenSGdat('p -6 2 m') GenSGdat('p -6 2 c') GenSGdat('p 6/m m m') GenSGdat('p 6/m c c') GenSGdat('p 63/m c m') GenSGdat('p 63/m m c') # non-standard GenSGdat('p 21 1 1') GenSGdat('p 1 21 1') GenSGdat('p 1 1 21') fp.write("}\n") fp.close()