Changeset 674


Ignore:
Timestamp:
Jul 3, 2012 10:21:10 AM (11 years ago)
Author:
vondreele
Message:

move peaksunique math to GSASIImath.py
fix geo correction in image integration Now cos(2th)2

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r661 r674  
    730730        else:
    731731            H1 = LRazm
    732         H0[0] /= npcosd(H2[:-1])
     732        H0[0] /= npcosd(H2[:-1])**2
    733733        Nup += 1
    734734        dlg.Update(Nup)
  • trunk/GSASIImath.py

    r673 r674  
    863863        rho = np.roll(np.roll(np.roll(rho,-rMI[2],axis=2),-rMI[1],axis=1),-rMI[0],axis=0)
    864864    return np.array(peaks),np.array([mags,]).T
     865
     866def PeaksUnique(data,Ind):
     867    generalData = data['General']
     868    cell = generalData['Cell'][1:7]
     869    Amat,Bmat = G2lat.cell2AB(generalData['Cell'][1:7])
     870    A = G2lat.cell2A(cell)
     871    SGData = generalData['SGData']
     872    mapPeaks = data['Map Peaks']
     873    for ind in Ind:
     874        XYZ = np.array(mapPeaks[ind][1:])                       
     875        Equiv = G2spc.GenAtom(XYZ,SGData,Move=True)[1:]     #remove self
     876        for equiv in Equiv:                                 #special position fixer
     877                Dx = XYZ-np.array(equiv[0])
     878                dist = np.sqrt(np.sum(np.inner(Amat,Dx)**2,axis=0))
     879                if dist < 0.5:
     880                    print equiv[0],Dx,dist
     881                    mapPeaks[ind][1:] -= Dx/2.
  • trunk/GSASIIphsGUI.py

    r663 r674  
    37493749               
    37503750    def OnPeaksUnique(event):
    3751         generalData = data['General']
    3752         cell = generalData['Cell'][1:7]
    3753         Amat,Bmat = G2lat.cell2AB(generalData['Cell'][1:7])
    3754         A = G2lat.cell2A(cell)
    3755         SGData = generalData['SGData']
    37563751        if 'Map Peaks' in data:
    37573752            mapPeaks = data['Map Peaks']
    37583753            Ind = MapPeaks.GetSelectedRows()
    3759             for ind in Ind:
    3760                 XYZ = np.array(mapPeaks[ind][1:])                       
    3761                 Equiv = G2spc.GenAtom(XYZ,SGData,Move=True)[1:]     #remove self
    3762                 for equiv in Equiv:                                 #special position fixer
    3763                         Dx = XYZ-np.array(equiv[0])
    3764                         dist = np.sqrt(np.sum(np.inner(Amat,Dx)**2,axis=0))
    3765                         if dist < 0.5:
    3766                             print equiv[0],Dx,dist
    3767                             mapPeaks[ind][1:] -= Dx/2.
    3768         FillMapPeaksGrid()
    3769         G2plt.PlotStructure(G2frame,data)
     3754            if Ind:
     3755                G2mth.PeaksUnique(data,Ind)
     3756                FillMapPeaksGrid()
     3757                G2plt.PlotStructure(G2frame,data)
    37703758   
    37713759    def OnFourierMaps(event):
Note: See TracChangeset for help on using the changeset viewer.