def makeuniq(self, symmetry): """ Flip orientations to a particular choice Be aware that if the unit cell is distorted and you do this, you might have problems... """ from ImageD11.sym_u import find_uniq_u, getgroup g = getgroup(symmetry)() for k in list(self.ubisread.keys()): self.ubisread[k] = find_uniq_u(self.ubisread[k], g) for k in list(self.grains.keys()): self.grains[k].set_ubi(find_uniq_u(self.grains[k].ubi, g))
from __future__ import print_function from ImageD11 import sym_u from ImageD11.grain import read_grain_file c = sym_u.cubic() c.makegroup() import glob fl = glob.glob("x*.ubi") for f in fl: gl = read_grain_file(f) x = int(f.split("_")[0][1:]) y = int(f.split("_")[1].split(".")[0][1:]) for g in gl: ubi = sym_u.find_uniq_u(g.ubi, c) g.set_ubi(ubi) print(x, y, end=' ') for i in range(3): for j in range(3): print(g.u[i][j], end=' ') print()
# open up a set of ubi files ubifl = glob.glob(sys.argv[1] + "/*.ubi") ubi_all = {} #print "Make cubic point group" c = sym_u.cubic() c.makegroup() for fname in ubifl: #print fname # Flip to standard setting ubi_all[fname] = [ sym_u.find_uniq_u(ubi, c) for ubi in indexing.readubis(fname) ] # Now try to make these into a unique set. # # For each ubi: # compute the reciprocal peak positions of central lattice # see if these match a previous one. pks = [ (5, 3, -1), (5, -3, 1), (-5, 3, 1), (-5, -3, 1), (-5, 3, -1), (5, -3, -1),