Changeset 1571

Ignore:
Timestamp:
Nov 15, 2014 12:01:30 PM (8 years ago)
Message:

fix typos in small angle tutorials
add menu with copy & reset to instrument parameters for SASD data
copy masks now copies the lower threshold
work on indexing incommensurate powder patterns, plots

Location:
trunk
Files:
9 edited

Unmodified
Removed

• trunk/GSASIIindex.py

 r1445 N = len(HKL) if N == 0: return False hklds = list(np.array(HKL).T[3])+[1000.0,0.0,] hklds = list(np.array(HKL).T[-2])+[1000.0,0.0,] hklds.sort()                                        # ascending sort - upper bound at end hklmax = [0,0,0] break hkl = HKL[pos]                                 # put in hkl if hkl[4] >= 0:                                 # peak already assigned - test if this one better opeak = peaks[hkl[4]] dold = abs(opeak[7]-hkl[3]) if hkl[-1] >= 0:                                 # peak already assigned - test if this one better opeak = peaks[hkl[-1]] dold = abs(opeak[7]-hkl[-2]) dnew = min(dm,dp) if dold > dnew:                             # new better - zero out old else:                                       # old better - do nothing continue hkl[4] = ipk hkl[-1] = ipk peak[4:7] = hkl[:3] peak[8] = hkl[3]                                # fill in d-calc peak[8] = hkl[-2]                                # fill in d-calc for peak in peaks: peak[3] = False
• trunk/GSASIIplot.py

 r1559 view = Page.toolbar._views.forward()[0][:2] wid = view[1]-view[0] found = HKL[np.where(np.fabs(HKL.T[5]-xpos) < 0.002*wid)] found = HKL[np.where(np.fabs(HKL.T[-1]-xpos) < 0.002*wid)] if len(found): h,k,l = found[0][:3] Page.canvas.SetToolTipString('%d,%d,%d'%(int(h),int(k),int(l))) if len(found[0]) > 6:   #SS reflections h,k,l,m = found[0][:4] Page.canvas.SetToolTipString('%d,%d,%d,%d'%(int(h),int(k),int(l),int(m))) else: h,k,l = found[0][:3] Page.canvas.SetToolTipString('%d,%d,%d'%(int(h),int(k),int(l))) else: Page.canvas.SetToolTipString('') Plot.axvline(peak[0],color='b') for hkl in G2frame.HKL: clr = 'r' if len(hkl) > 6 and hkl[3]: clr = 'g' if G2frame.qPlot: Plot.axvline(2.*np.pi/G2lat.Pos2dsp(Parms,hkl[5]),color='r',dashes=(5,5)) Plot.axvline(2.*np.pi/G2lat.Pos2dsp(Parms,hkl[-1]),color=clr,dashes=(5,5)) if G2frame.dPlot: Plot.axvline(G2lat.Pos2dsp(Parms,hkl[5]),color='r',dashes=(5,5)) Plot.axvline(G2lat.Pos2dsp(Parms,hkl[-1]),color=clr,dashes=(5,5)) else: Plot.axvline(hkl[5],color='r',dashes=(5,5)) Plot.axvline(hkl[-1],color=clr,dashes=(5,5)) elif G2frame.PatternTree.GetItemText(PickId) in ['Reflection Lists'] or \ 'PWDR' in G2frame.PatternTree.GetItemText(PickId): view = Page.toolbar._views.forward()[0][:2] wid = view[1]-view[0] found = HKL[np.where(np.fabs(HKL.T[5]-xpos) < 0.002*wid)] found = HKL[np.where(np.fabs(HKL.T[-1]-xpos) < 0.002*wid)] if len(found): h,k,l = found[0][:3] HKL = np.array(G2frame.HKL) for hkl in G2frame.HKL: Plot.axvline(hkl[5],color='r',dashes=(5,5)) Plot.axvline(hkl[-1],color='r',dashes=(5,5)) xmin = peaks[0][0] xmax = peaks[-1][0]
• trunk/GSASIIpwd.py

 r1551 if not ext: HKLs.append([h,k,l,d,-1]) return HKLs def getHKLMpeak(dmin,SGData,SSGData,Vec,maxH,A): 'needs a doc string' HKL = G2lat.GenHLaue(dmin,SGData,A) HKLs = [] vec = np.array(Vec) SSdH = [vec*h for h in range(-maxH,maxH+1)] SSdH = dict(zip(range(-maxH,maxH+1),SSdH)) for h,k,l,d in HKL: ext = G2spc.GenHKLf([h,k,l],SGData)[0] if not ext: HKLs.append([h,k,l,0,d,-1]) for dH in SSdH: if dH: DH = SSdH[dH] H = [h+DH[0],k+DH[1],l+DH[2]] d = 1/np.sqrt(G2lat.calc_rDsq(H,A)) if d >= dmin: HKLs.append([h,k,l,dH,d,-1]) return HKLs if peak[2] and peak[3]: peakPos.append(peak[0]) peakDsp.append(peak[8]) peakDsp.append(peak[-1])    #d-calc peakWt.append(1/sig**2) peakPos = np.array(peakPos)