from ImageD11 import grain import numpy as np import pylab import sys energy = float(sys.argv[1]) pks = sys.argv[2] ubi = sys.argv[3] tilt = float(sys.argv[4]) TOLERANCE=float(sys.argv[5]) c=WWMcrystal() c.set_wvln( 12.3985/ energy ) c.dmin = 0.6 u0 = grain.read_grain_file(ubi)[0].u # np.eye(3) #print u0 rx, ry, rz = getrxryrz( u0 ) c.set_orientation(u0) c.generate_hkls() c.generate_gve() d = WWMdiffractometer(c, pks) d.axistilt = tilt d.computek() d.computeomegas() print d.omega.shape def getom(d, hkl, fri): c = d.crystal
from WWMpeakassign import WWMcrystal, getrxryrz, WWMdiffractometer, \ rotmatx, rotmaty, rotmatz from ImageD11 import grain import numpy as np import sys energy = 78.395 ubi = "fitted.ubi" pks = sys.argv[1] # "wwm_setup_20160916_180a_.spc_pks.json" NPKS = int(sys.argv[2]) c=WWMcrystal() c.set_wvln( 12.3985/ energy ) c.dmin =5.43/np.sqrt(8.1) #c.dmin = #gr = grain.read_grain_file( ubi )[0] u0 = np.eye(3) rx, ry, rz = getrxryrz( u0 ) c.set_orientation(u0) c.generate_hkls() c.generate_gve( ) d = WWMdiffractometer(c, pks) d.computek() d.computeomegas() h = d.pars.heights order = np.argsort( h ) # there are 16 (111) peaks chosen = order[-NPKS:]