# Changeset 724

Ignore:
Timestamp:
Aug 21, 2012 10:02:39 AM (10 years ago)
Message:

update Fit Peaks.htm to Matt's suggestion
modifications to findOffset to make it more robust

Location:
trunk
Files:
3 edited

Unmodified
Removed
• ## trunk/GSASIImath.py

 r721 ## keep this def findOffset(SGData,Fhkl): def findOffset(SGData,A,Fhkl): if SGData['SpGrp'] == 'P 1': return [0,0,0] hklShape = Fhkl.shape steps = np.array(hklShape) Hmax = 2*np.asarray(G2lat.getHKLmax(4.5,SGData,A),dtype='i') Fmax = np.max(np.absolute(Fhkl)) hklHalf = np.array(hklShape)/2 DH = [] Dphi = [] while i < 20: while i < 20 and len(DH) < 50: F = Flist[i] hkl = np.unravel_index(Fdict[F],hklShape) dH = H-hkl dang = ang-ang0 if np.any(np.abs(dH)-6 > 0):    #keep low order DHs if np.any(np.abs(dH)-Hmax > 0):    #keep low order DHs continue DH.append(dH) i += 1 DH = np.array(DH) print ' map offset no.of terms: %d'%(len(DH)) Dphi = np.array(Dphi) X,Y,Z = np.mgrid[0:1:1./steps[0],0:1:1./steps[1],0:1:1./steps[2]] chisq = np.min(Mmap) DX = -np.array(np.unravel_index(np.argmin(Mmap),Mmap.shape)) print ' map offset chi**2: %.3f, map offset: %d %d %d, no. terms: %d'%(chisq,DX[0],DX[1],DX[2],len(DH)) print ' map offset chi**2: %.3f, map offset: %d %d %d'%(chisq,DX[0],DX[1],DX[2]) return DX CErho = np.real(fft.fftn(fft.fftshift(CEhkl))) print ' No.cycles = ',Ncyc,'Residual Rcf =%8.3f%s'%(Rcf,'%')+' Map size:',CErho.shape roll = findOffset(SGData,CEhkl) roll = findOffset(SGData,A,CEhkl) mapData['Rcf'] = Rcf break peak = (np.array(x1[1:4])-rMI)/incre peak = fixSpecialPos(peak,SGData,Amat) if not len(peaks): peaks.append(peak) if keepDup: if noDuplicate(peak,peaks,Amat): peak = fixSpecialPos(peak,SGData,Amat) peaks.append(peak) mags.append(x1[0])
• ## trunk/GSASIIphsGUI.py

 r721 generalData = data['General'] SGData = generalData['SGData'] dlg = SymOpDialog(G2frame,SGData,True) dlg = SymOpDialog(G2frame,SGData,True,True) try: if dlg.ShowModal() == wx.ID_OK: XYZ = -XYZ XYZ = XYZ+cent+Cell if Force: XYZ = G2spc.MoveToUnitCell(XYZ) if New: atom = copy.copy(atomData[ind]) generalData = data['General'] SGData = generalData['SGData'] dlg = SymOpDialog(G2frame,SGData,False) dlg = SymOpDialog(G2frame,SGData,False,True) try: if dlg.ShowModal() == wx.ID_OK: XYZ = -XYZ XYZ = XYZ+cent+Cell if Force: XYZ = G2spc.MoveToUnitCell(XYZ) if noDuplicate(XYZ,atomData): atom = copy.copy(atomData[ind]) generalData = data['General'] SGData = generalData['SGData'] dlg = SymOpDialog(G2frame,SGData,False) dlg = SymOpDialog(G2frame,SGData,False,True) try: if dlg.ShowModal() == wx.ID_OK: XYZ = -XYZ XYZ = XYZ+cent+Cell if Force: XYZ = G2spc.MoveToUnitCell(XYZ) atom = atomData[ind] atom[cx:cx+3] = XYZ
• ## trunk/help/Fit Peaks.htm

 r676 Von DreeleVon Dreele16275182932012-05-05T16:28:00Z2012-07-03T19:35:00Z2012-08-21T14:48:00Z9183110439190210843Argonne National Laboratory86241224690251272014.00 mso-font-kerning:14.0pt;} a:link, span.MsoHyperlink {mso-style-priority:99; {mso-style-noshow:yes; mso-style-priority:99; color:blue; text-decoration:underline; style='mso-fareast-font-family:"Times New Roman"'>2.      Now add refinement of the peak positions. This can be done by clicking on all the refinement flags for the individual peaks or it is possible to set them all at the same time using this recipe:

add refinement of the peak positions. This can be done by clicking on all the refinement flags for the individual peaks or it is possible to set them all at the same time using this recipe:

b.      double-click on the refine label above the peak position class=GramE>single-click on the refine label above the peak position check-boxes. The entire column of checkboxes is highlighted in blue. Press the n would turn them off).

Next, repeat the refinement using the Peak Fitting/LSQ PeakFit menu item in the Peak List window.

Now, select peak widths for refinement. This can be done by refining sigma (Gaussian width) and/or gamma (Lorentzian width) for individual peaks, but here we can constrain the peaks to follow an instrumental broadening equation. Select the Instrumental Parameters item in the data tree. This opens a window for peak profile terms

Note: See TracChangeset for help on using the changeset viewer.