Changeset 663


Ignore:
Timestamp:
Jun 30, 2012 12:01:02 PM (10 years ago)
Author:
vondreele
Message:

fix too close peak rejection

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r661 r663  
    766766        return True
    767767       
    768     def noDuplicate(xyz,peaks,incre):
    769         if True in [np.allclose(xyz*incre,peak*incre,atol=2.0) for peak in peaks]:
     768    def noDuplicate(xyz,peaks,Amat):
     769        if True in [np.allclose(np.inner(Amat,xyz),np.inner(Amat,peak),atol=1.0) for peak in peaks]:
     770            print ' Peak',xyz,' <1A from another peak'
    770771            return False
    771772        return True
     
    811812    phaseName = generalData['Name']
    812813    SGData = generalData['SGData']
    813     cell = generalData['Cell'][1:8]       
    814     A = G2lat.cell2A(cell[:6])
     814    Amat,Bmat = G2lat.cell2AB(generalData['Cell'][1:7])
     815#    cell = generalData['Cell'][1:8]       
     816#    A = G2lat.cell2A(cell[:6])
    815817    drawingData = data['Drawing']
    816818    peaks = []
     
    851853        else:
    852854            if keepDup:
    853                 if noDuplicate(peak,peaks,incre):
     855                if noDuplicate(peak,peaks,Amat):
    854856                    peaks.append(peak)
    855857                    mags.append(x1[0])
  • trunk/GSASIIphsGUI.py

    r661 r663  
    38373837        finally:
    38383838            pgbar.Destroy()
    3839 
    3840 
    3841 #        wx.BeginBusyCursor()
    3842 #        try:
    3843 #            peaks,mags = G2mth.SearchMap(data,keepDup=True)
    3844 #        finally:
    3845 #            wx.EndBusyCursor()
    38463839        sortIdx = np.argsort(mags.flatten())
    38473840        if len(peaks):
    3848             data['Map Peaks'] = np.concatenate((mags,peaks),axis=1)
    3849            
    3850 #            print ' Map search peaks found:'
    3851 #            print '  No.    Mag.      x        y        z'
    3852 #            for j,i in enumerate(sortIdx[::-1]):
    3853 #                print ' %3d %8.3f %8.5f %8.5f %8.5f'%(j,mags[i],peaks[i][0],peaks[i][1],peaks[i][2])
     3841            data['Map Peaks'] = np.concatenate((mags,peaks),axis=1)           
    38543842            print ' Map search finished, time = %.2fs'%(time.time()-time0)
    38553843        Page = G2frame.dataDisplay.FindPage('Map peaks')
Note: See TracChangeset for help on using the changeset viewer.