ipk = 0 intI = 0.0 sigI = 0.0 rflg = 0 for h in range(-hmax, hmax + 1): for k in range(-kmax, kmax + 1): for l in range(-lmax, lmax + 1): if h == k == l == 0: continue # test for centering centering = xl.center(h, k, l, center_type) if centering == False: continue Qpeak = xl.huq(h, k, l, UB_IPNS) # units of 1/d if Qpeak[0] > 0.0: continue # x pointing downstream if Qpeak[1] > 0.0: continue # only detectors on -y side lenQpeak = math.sqrt(pylab.dot( Qpeak, Qpeak)) # magnitude or length of Qpeak dsp = 1.0 / lenQpeak if dsp < dmin: continue # ISAW uses IPNS coordinate system for SNS data peak_params = xl.calc_2th_wl_IPNS( Qpeak) # ISAW uses IPNS coordinate system for SNS data two_theta = (peak_params[0] / 180.0) * math.pi wl = peak_params[1]
ipk = 0 intI = 0.0 sigI = 0.0 rflg = 0 for h in range(-hmax, hmax+1): for k in range(-kmax, kmax+1): for l in range(-lmax, lmax+1): if h == k == l == 0: continue # test for centering centering = xl.center(h, k, l, center_type) if centering == False: continue Qpeak = xl.huq(h, k, l, UB_rotated) # units of 1/d if Qpeak[0] > 0.0: continue # x pointing downstream # if Qpeak[1] > 0.0: continue # only detectors on -y side lenQpeak = math.sqrt(numpy.dot(Qpeak, Qpeak)) # magnitude or length of Qpeak dsp = 1.0 / lenQpeak if dsp < dmin: continue # ISAW uses IPNS coordinate system for SNS data peak_params = xl.calc_2th_wl_IPNS(Qpeak) # ISAW uses IPNS coordinate system for SNS data two_theta = (peak_params[0] / 180.0) * math.pi wl = peak_params[1] if wl < wlmin: continue if wl > wlmax: continue
# Begin determining and storing peaks for h in range(-hmax, hmax + 1): for k in range(-kmax, kmax + 1): for l in range(-lmax, lmax + 1): # h = 3 # for testing # k = -5 # l = -4 if h == k == l == 0: continue # R centering for sapphire sumhkl = -h + k + l if sumhkl % 3 != 0: continue Qpeak = xl.huq(h, k, l, UB_IPNS) if Qpeak[0] > 0.0: continue # x pointing downstream if Qpeak[1] > 0.0: continue # only detectors on -y side lenQpeak = math.sqrt(np.dot(Qpeak, Qpeak)) # magnitude or length of Qpeak dsp = 1.0 / lenQpeak if dsp < dmin: continue # ISAW uses IPNS coordinate system for SNS data peak_params = xl.calc_2th_wl_IPNS(Qpeak) two_theta = math.radians(peak_params[0]) wl = peak_params[1] if wl < wlmin: continue