Changeset 724
- Timestamp:
- Aug 21, 2012 10:02:39 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r721 r724 676 676 ## keep this 677 677 678 def findOffset(SGData, Fhkl):678 def findOffset(SGData,A,Fhkl): 679 679 if SGData['SpGrp'] == 'P 1': 680 680 return [0,0,0] 681 681 hklShape = Fhkl.shape 682 682 steps = np.array(hklShape) 683 Hmax = 2*np.asarray(G2lat.getHKLmax(4.5,SGData,A),dtype='i') 683 684 Fmax = np.max(np.absolute(Fhkl)) 684 685 hklHalf = np.array(hklShape)/2 … … 696 697 DH = [] 697 698 Dphi = [] 698 while i < 20 :699 while i < 20 and len(DH) < 50: 699 700 F = Flist[i] 700 701 hkl = np.unravel_index(Fdict[F],hklShape) … … 710 711 dH = H-hkl 711 712 dang = ang-ang0 712 if np.any(np.abs(dH)- 6> 0): #keep low order DHs713 if np.any(np.abs(dH)-Hmax > 0): #keep low order DHs 713 714 continue 714 715 DH.append(dH) … … 716 717 i += 1 717 718 DH = np.array(DH) 719 print ' map offset no.of terms: %d'%(len(DH)) 718 720 Dphi = np.array(Dphi) 719 721 X,Y,Z = np.mgrid[0:1:1./steps[0],0:1:1./steps[1],0:1:1./steps[2]] … … 722 724 chisq = np.min(Mmap) 723 725 DX = -np.array(np.unravel_index(np.argmin(Mmap),Mmap.shape)) 724 print ' map offset chi**2: %.3f, map offset: %d %d %d , no. terms: %d'%(chisq,DX[0],DX[1],DX[2],len(DH))726 print ' map offset chi**2: %.3f, map offset: %d %d %d'%(chisq,DX[0],DX[1],DX[2]) 725 727 return DX 726 728 … … 801 803 CErho = np.real(fft.fftn(fft.fftshift(CEhkl))) 802 804 print ' No.cycles = ',Ncyc,'Residual Rcf =%8.3f%s'%(Rcf,'%')+' Map size:',CErho.shape 803 roll = findOffset(SGData, CEhkl)805 roll = findOffset(SGData,A,CEhkl) 804 806 805 807 mapData['Rcf'] = Rcf … … 914 916 break 915 917 peak = (np.array(x1[1:4])-rMI)/incre 918 peak = fixSpecialPos(peak,SGData,Amat) 916 919 if not len(peaks): 917 920 peaks.append(peak) … … 920 923 if keepDup: 921 924 if noDuplicate(peak,peaks,Amat): 922 peak = fixSpecialPos(peak,SGData,Amat)923 925 peaks.append(peak) 924 926 mags.append(x1[0]) -
trunk/GSASIIphsGUI.py
r721 r724 1434 1434 generalData = data['General'] 1435 1435 SGData = generalData['SGData'] 1436 dlg = SymOpDialog(G2frame,SGData,True )1436 dlg = SymOpDialog(G2frame,SGData,True,True) 1437 1437 try: 1438 1438 if dlg.ShowModal() == wx.ID_OK: … … 1447 1447 XYZ = -XYZ 1448 1448 XYZ = XYZ+cent+Cell 1449 if Force: 1450 XYZ = G2spc.MoveToUnitCell(XYZ) 1449 1451 if New: 1450 1452 atom = copy.copy(atomData[ind]) … … 1970 1972 generalData = data['General'] 1971 1973 SGData = generalData['SGData'] 1972 dlg = SymOpDialog(G2frame,SGData,False )1974 dlg = SymOpDialog(G2frame,SGData,False,True) 1973 1975 try: 1974 1976 if dlg.ShowModal() == wx.ID_OK: … … 1983 1985 XYZ = -XYZ 1984 1986 XYZ = XYZ+cent+Cell 1987 if Force: 1988 XYZ = G2spc.MoveToUnitCell(XYZ) 1985 1989 if noDuplicate(XYZ,atomData): 1986 1990 atom = copy.copy(atomData[ind]) … … 2015 2019 generalData = data['General'] 2016 2020 SGData = generalData['SGData'] 2017 dlg = SymOpDialog(G2frame,SGData,False )2021 dlg = SymOpDialog(G2frame,SGData,False,True) 2018 2022 try: 2019 2023 if dlg.ShowModal() == wx.ID_OK: … … 2028 2032 XYZ = -XYZ 2029 2033 XYZ = XYZ+cent+Cell 2034 if Force: 2035 XYZ = G2spc.MoveToUnitCell(XYZ) 2030 2036 atom = atomData[ind] 2031 2037 atom[cx:cx+3] = XYZ -
trunk/help/Fit Peaks.htm
r676 r724 23 23 <o:Author>Von Dreele</o:Author> 24 24 <o:LastAuthor>Von Dreele</o:LastAuthor> 25 <o:Revision>1 6</o:Revision>26 <o:TotalTime>2 75</o:TotalTime>25 <o:Revision>18</o:Revision> 26 <o:TotalTime>293</o:TotalTime> 27 27 <o:Created>2012-05-05T16:28:00Z</o:Created> 28 <o:LastSaved>2012-0 7-03T19:35:00Z</o:LastSaved>28 <o:LastSaved>2012-08-21T14:48:00Z</o:LastSaved> 29 29 <o:Pages>9</o:Pages> 30 <o:Words>1 831</o:Words>31 <o:Characters>10 439</o:Characters>30 <o:Words>1902</o:Words> 31 <o:Characters>10843</o:Characters> 32 32 <o:Company>Argonne National Laboratory</o:Company> 33 <o:Lines> 86</o:Lines>34 <o:Paragraphs>2 4</o:Paragraphs>35 <o:CharactersWithSpaces>12 246</o:CharactersWithSpaces>33 <o:Lines>90</o:Lines> 34 <o:Paragraphs>25</o:Paragraphs> 35 <o:CharactersWithSpaces>12720</o:CharactersWithSpaces> 36 36 <o:Version>14.00</o:Version> 37 37 </o:DocumentProperties> … … 599 599 mso-font-kerning:14.0pt;} 600 600 a:link, span.MsoHyperlink 601 {mso-style-priority:99; 601 {mso-style-noshow:yes; 602 mso-style-priority:99; 602 603 color:blue; 603 604 text-decoration:underline; … … 1414 1415 style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>2.<span 1415 1416 style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Now 1416 add refinement of the peak positions. This can be done by clicking on all the 1417 refinement flags for the individual peaks or it is possible to set them all at 1418 t he same time using this recipe: </p>1417 add refinement of the peak positions. This can be done by clicking on all the refinement 1418 flags for the individual peaks or it is possible to set them all at the same 1419 time using this recipe: </p> 1419 1420 1420 1421 <p class=MsoListParagraphCxSpMiddle style='margin-left:1.0in;mso-add-space: … … 1429 1430 style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>b.<span 1430 1431 style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span 1431 class=GramE> double-click</span> on the refine label above the peak position1432 class=GramE>single-click</span> on the refine label above the peak position 1432 1433 check-boxes. The entire column of checkboxes is highlighted in blue. Press the <b 1433 1434 style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif"; … … 1438 1439 minor-latin'>n</span></b> would turn them off).</p> 1439 1440 1440 <p class=MsoNormal><span style='mso-spacerun:yes'> </span>Next, repeat the 1441 refinement using the <b style='mso-bidi-font-weight:normal'><span 1442 style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin; 1443 mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'>Peak 1444 Fitting/LSQ <span class=SpellE>PeakFit</span></span></b> menu item in the <b 1445 style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif"; 1446 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font: 1447 minor-latin'>Peak List</span></b> window.</p> 1448 1449 <p class=MsoNormal><span style='mso-spacerun:yes'> </span>Now, select peak 1450 widths for refinement. This can be done by refining sigma (Gaussian width) 1451 and/or gamma (Lorentzian width) for individual peaks, but here we can constrain 1452 the peaks to follow an instrumental broadening equation. Select the <b 1453 style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif"; 1454 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font: 1455 minor-latin'>Instrumental Parameters</span></b> item in the data tree. This 1456 opens a window for peak profile terms</p> 1457 1458 <p class=MsoNormal><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape 1441 <p class=MsoNormal style='margin-left:.5in'>Next, repeat the refinement using 1442 the <b style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif"; 1443 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font: 1444 minor-latin'>Peak Fitting/LSQ <span class=SpellE>PeakFit</span></span></b> menu 1445 item in the <b style='mso-bidi-font-weight:normal'><span style='font-family: 1446 "Calibri","sans-serif";mso-ascii-theme-font:minor-latin;mso-hansi-theme-font: 1447 minor-latin;mso-bidi-theme-font:minor-latin'>Peak List</span></b> window.</p> 1448 1449 <p class=MsoNormal style='margin-left:.5in'><span 1450 style='mso-spacerun:yes'> </span>Now, select peak widths for refinement. <span 1451 style='mso-fareast-font-family:"Times New Roman"'>This can be performed in 2 1452 different ways. Method 1: refine sigma (Gaussian width) and/or 1453 gamma (Lorentzian width) for individual peaks. To do this, click the 1454 refinement flags for sigma and/or gamma in the Peak List window. 1455 Method 2: preferably, the LS refinement of peak 1456 widths can be constrained to follow an instrumental broadening 1457 equation as described below. Note - one cannot refine ALL peak widths 1458 using both individual sigma & gamma values AND instrumental 1459 broadening terms at the same time.<b style='mso-bidi-font-weight:normal'> </b><o:p></o:p></span></p> 1460 1461 <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: 1462 "Times New Roman";mso-bidi-font-weight:bold'>To constrain refined peak widths 1463 to an instrumental broadening equation, first<b> s</b></span>elect the <b 1464 style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif"; 1465 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font: 1466 minor-latin'>Instrumental Parameters</span></b> item in the data tree. <span 1467 class=GramE>This opens a window for peak profile terms<b> </b><span 1468 style='mso-bidi-font-weight:bold'>and also create</span></span><span 1469 style='mso-bidi-font-weight:bold'> a new plot window showing the 1470 instrument profile resolution curve.</span></p> 1471 1472 <p class=MsoNormal style='margin-left:.5in'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape 1459 1473 id="Picture_x0020_10" o:spid="_x0000_i1037" type="#_x0000_t75" style='width:422.25pt; 1460 1474 height:154.5pt;visibility:visible;mso-wrap-style:square'> … … 1516 1530 normal'><span style='font-family:"Calibri","sans-serif";mso-ascii-theme-font: 1517 1531 minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'>Index 1518 Peak List</span></b> item in the data tree. In the initially empty window created1519 by this action, use menu item <b style='mso-bidi-font-weight:normal'><span1532 Peak List</span></b> item in the data tree. In the initially empty window 1533 created by this action, use menu item <b style='mso-bidi-font-weight:normal'><span 1520 1534 style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin; 1521 1535 mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'>Index Peaks … … 1603 1617 <h2><span class=GramE>Step 8.</span> Select/Refine Cell</h2> 1604 1618 1605 <p class=MsoNormal>Select the cell with M20 ~ 2900 with a = 4.1568 Å. This indexes1606 all peaks with almost a perfect fit to the peak positions (compare dashed red 1607 lines to solid blue ones). Import the cell information using the <b1619 <p class=MsoNormal>Select the cell with M20 ~ 2900 with a = 4.1568 Å. This 1620 indexes all peaks with almost a perfect fit to the peak positions (compare 1621 dashed red lines to solid blue ones). Import the cell information using the <b 1608 1622 style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif"; 1609 1623 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font: … … 1661 1675 class=GramE>do the menu item</span> <b style='mso-bidi-font-weight:normal'><span 1662 1676 style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin; 1663 mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'>File/Close project</span></b> 1664 in the <b style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif"; 1665 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font: 1666 minor-latin'>GSAS-II data tree </span></b>window. You will be asked if you want 1667 it saved; if <span class=GramE><b style='mso-bidi-font-weight:normal'><span 1668 style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin; 1669 mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'>Yes</span></b></span> 1670 then all the peak fitting/indexing & cell refinement results will be saved 1671 to the <b style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif"; 1677 mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'>File/Close 1678 project</span></b> in the <b style='mso-bidi-font-weight:normal'><span 1679 style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin; 1680 mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'>GSAS-II data 1681 tree </span></b>window. You will be asked if you want it saved; if <span 1682 class=GramE><b style='mso-bidi-font-weight:normal'><span style='font-family: 1683 "Calibri","sans-serif";mso-ascii-theme-font:minor-latin;mso-hansi-theme-font: 1684 minor-latin;mso-bidi-theme-font:minor-latin'>Yes</span></b></span> then all the 1685 peak fitting/indexing & cell refinement results will be saved to the <b 1686 style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif"; 1672 1687 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font: 1673 1688 minor-latin'>LaB6.gpx</span></b> file. If <b style='mso-bidi-font-weight:normal'><span … … 1718 1733 <p class=MsoNormal>Pick all peaks you can see between the limits (including the 1719 1734 small ones). Note some peaks have shoulders most notably at 5.07, 6.04, 1720 7.81deg. I found 28 peaks (there were a few very weak ones I skipped they 1721 mightbe from a second phase? Well see later).</p>1735 7.81deg. I found 28 peaks (there were a few very weak ones I skipped they might 1736 be from a second phase? Well see later).</p> 1722 1737 1723 1738 <p class=MsoNormal><!--[if gte vml 1]><v:shape id="Picture_x0020_19" o:spid="_x0000_s1026" … … 1791 1806 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font: 1792 1807 minor-latin'>Unit Cells List</span></b> window. Progress will be much slower 1793 and suitable results will be slow in coming so be patient. Watch the console 1794 window; the right answer will have an obviously large M20 (~630) and a volume 1795 of ~594Å<sup>3</sup> (10<sup>th</sup> column of console display). Once this is 1796 seen (it may take more than one try to get this) you can stop the indexing 1797 search by pressing <b style='mso-bidi-font-weight:normal'><span 1798 style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin; 1799 mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'>Cancel</span></b> 1800 on the progress bar window. It may take more than one press to fully stop it. 1801 My result was </p> 1808 and suitable results will be slow in coming so be patient. Watch the console window; 1809 the right answer will have an obviously large M20 (~630) and a volume of ~594Å<sup>3</sup> 1810 (10<sup>th</sup> column of console display). Once this is seen (it may take 1811 more than one try to get this) you can stop the indexing search by pressing <b 1812 style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif"; 1813 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font: 1814 minor-latin'>Cancel</span></b> on the progress bar window. It may take more 1815 than one press to fully stop it. My result was </p> 1802 1816 1803 1817 <p class=MsoNormal><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape … … 1821 1835 <p class=MsoNormal>Although the weak peak at 2<span style='font-family:Symbol; 1822 1836 mso-char-type:symbol;mso-symbol-font-family:Symbol'><span style='mso-char-type: 1823 symbol;mso-symbol-font-family:Symbol'>Q</span></span>~7.3 has a shoulder that wasnt1824 indexed. I presume that is a contaminant. By sliding the cursor over the index 1825 lines without any visible peak you can see that the missing ones are (010, 100, 1826 001, 110, 030, 111, 20-1, 10-2, 041, 050, 21-2, 23-1, 22-2, 141, 201,102, 15-1,1827 112, & 24-1). Many of these are accidental but the 0k0; k≠2n and h0l; 1828 h+l≠2n ones characterize the space group P2<sub>1</sub>/n. Armed with 1829 this information you can <b style='mso-bidi-font-weight:normal'><span1837 symbol;mso-symbol-font-family:Symbol'>Q</span></span>~7.3 has a shoulder that 1838 wasnt indexed. I presume that is a contaminant. By sliding the cursor over the 1839 index lines without any visible peak you can see that the missing ones are 1840 (010, 100, 001, 110, 030, 111, 20-1, 10-2, 041, 050, 21-2, 23-1, 22-2, 141, 1841 201,102, 15-1, 112, & 24-1). Many of these are accidental but the 0k0; k≠2n 1842 and h0l; h+l≠2n ones characterize the space group P2<sub>1</sub>/n. Armed 1843 with this information you can <b style='mso-bidi-font-weight:normal'><span 1830 1844 style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin; 1831 1845 mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'>Make new
Note: See TracChangeset
for help on using the changeset viewer.