Changeset 3295


Ignore:
Timestamp:
Feb 22, 2018 11:01:07 AM (5 years ago)
Author:
vondreele
Message:

remove superfluous calls to SpcGroup? after SGData has been defined
add 3rd row magnetic form factors
add contour plots for projections of mustrain, size, % 3D pole distribution
improve quality of these surfaces

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIElem.py

    r3191 r3295  
    380380    nt = -nfb[:,np.newaxis]*SQ
    381381    MMF = np.sum(mfa[:,np.newaxis]*np.exp(mt)[:],axis=0)+El['mfc']
     382    MMF0 = np.sum(mfa)+El['mfc']
    382383    NMF = np.sum(nfa[:,np.newaxis]*np.exp(nt)[:],axis=0)+El['nfc']
    383     return MMF+(2.0/El['gfac']-1.0)*NMF
     384    NMF0 = np.sum(nfa)+El['nfc']
     385    MF0 = MMF0+(2.0/El['gfac']-1.0)*NMF0
     386    return (MMF+(2.0/El['gfac']-1.0)*NMF)/MF0
    384387       
    385388def BlenResCW(Els,BLtables,wave):
  • trunk/GSASIIphsGUI.py

    r3291 r3295  
    24992499                ci = colLabels.index('I/A')
    25002500                ID = atomData[r][ci+8]
     2501                SGData = generalData['SGData']
    25012502                if Atoms.GetColLabelValue(c) in ['x','y','z']:
    25022503                    ci = colLabels.index('x')
     
    25062507                    SScol = colLabels.index('site sym')
    25072508                    Mulcol = colLabels.index('mult')
    2508                     E,SGData = G2spc.SpcGroup(generalData['SGData']['SpGrp'])
    25092509                    Sytsym,Mult = G2spc.SytSym(XYZ,SGData)[:2]
    25102510                    atomData[r][SScol] = Sytsym
     
    25562556                    ci = colLabels.index('I/A')
    25572557                    atomData[r][c] = atomData[r][c].replace(rbAtmDict.get(atomData[r][ci+8],''),'')
     2558                elif Atoms.GetColLabelValue(c) in ['Mx','My','Mz']:
     2559                    value = atomData[r][c]
     2560                    cx = colLabels.index('x')
     2561                    SpnFlp = generalData['SGData']['SpnFlp']
     2562                    SytSym,Mul,Nop,dupDir = G2spc.SytSym(atomData[r][cx:cx+3],SGData)
     2563                    CSI = G2spc.GetCSpqinel(SytSym,SpnFlp,dupDir)
     2564                    iM = CSI[0][c-colLabels.index('Mx')]
     2565                    for i in range(3):
     2566                        if iM == CSI[0][i]:
     2567                            atomData[r][i+colLabels.index('Mx')] = value*CSI[1][i]
    25582568                if 'Atoms' in data['Drawing']:
    25592569                    ci = colLabels.index('I/A')
     
    27202730                    if not SGData['SGGray']:
    27212731                        CSI = G2spc.GetCSpqinel(SytSym,SpnFlp,dupDir)
    2722 #                    print (SytSym,Nop,SpnFlp[Nop],CSI,dupDir)
     2732                    print (SytSym,Nop,SpnFlp[Nop],CSI,dupDir)
    27232733                    for i in range(3):
    27242734                        ci = i+colM
     
    27282738                            Atoms.SetCellStyle(row,ci,WHITE,False)
    27292739                            Atoms.SetCellTextColour(row,ci,BLACK)
    2730                            
    27312740                if 'X' in rbExcl:
    27322741                    for c in range(0,colX+3):
     
    28372846        generalData = data['General']
    28382847        atId = ran.randint(0,sys.maxsize)
    2839         E,SGData = G2spc.SpcGroup(generalData['SGData']['SpGrp'])
     2848        SGData = generalData['SGData']
    28402849        Sytsym,Mult = G2spc.SytSym([x,y,z],SGData)[:2]
    28412850        if generalData['Type'] == 'macromolecular':
     
    30863095        atomData = data['Atoms']
    30873096        generalData = data['General']
    3088         E,SGData = G2spc.SpcGroup(generalData['SGData']['SpGrp'])
     3097        SGData = generalData['SGData']
    30893098        Sytsym,Mult = G2spc.SytSym([x,y,z],SGData)[:2]
    30903099        atId = ran.randint(0,sys.maxsize)
     
    31783187        atomData = data['Atoms']
    31793188        generalData = data['General']
     3189        ifMag = False
    31803190        colLabels = [Atoms.GetColLabelValue(c) for c in range(Atoms.GetNumberCols())]
    31813191        ci = colLabels.index('I/A')
     
    31833193        if generalData['Type'] == 'magnetic':
    31843194            choices += ['Mx','My','Mz',]
     3195            ifMag = True
    31853196        dlg = wx.SingleChoiceDialog(G2frame,'Select','Atom parameter',choices)
    31863197        parm = ''
     
    31913202        dlg.Destroy()
    31923203        if parm in ['Type']:
    3193             dlg = G2elemGUI.PickElement(G2frame)
     3204            dlg = G2elemGUI.PickElement(G2frame,ifMag=ifMag)
    31943205            if dlg.ShowModal() == wx.ID_OK:
    31953206                if dlg.Elem not in ['None']:
  • trunk/GSASIIplot.py

    r3290 r3295  
    39643964    G2frame.G2plotNB.status.SetStatusText('',1)
    39653965   
    3966     PHI = np.linspace(0.,360.,30,True)
    3967     PSI = np.linspace(0.,180.,30,True)
     3966    PHI = np.linspace(0.,360.,40,True)
     3967    PSI = np.linspace(0.,180.,40,True)
    39683968    X = np.outer(npcosd(PHI),npsind(PSI))
    39693969    Y = np.outer(npsind(PHI),npsind(PSI))
     
    40394039            xyzlim = np.array([Plot.get_xlim3d(),Plot.get_ylim3d(),Plot.get_zlim3d()]).T
    40404040            XYZlim = [min(xyzlim[0]),max(xyzlim[1])]
     4041            Plot.contour(X,Y,Z,10,zdir='x',offset=XYZlim[0])
     4042            Plot.contour(X,Y,Z,10,zdir='y',offset=XYZlim[1])
     4043            Plot.contour(X,Y,Z,10,zdir='z',offset=XYZlim[0])
    40414044            Plot.set_xlim3d(XYZlim)
    40424045            Plot.set_ylim3d(XYZlim)
     
    43054308                xyzlim = np.array([Plot.get_xlim3d(),Plot.get_ylim3d(),Plot.get_zlim3d()]).T
    43064309                XYZlim = [min(xyzlim[0]),max(xyzlim[1])]
     4310                Plot.contour(X,Y,Z,10,zdir='x',offset=XYZlim[0])
     4311                Plot.contour(X,Y,Z,10,zdir='y',offset=XYZlim[1])
     4312                Plot.contour(X,Y,Z,10,zdir='z',offset=XYZlim[0])
    43074313                Plot.set_xlim3d(XYZlim)
    43084314                Plot.set_ylim3d(XYZlim)
  • trunk/GSASIIspc.py

    r3293 r3295  
    178178                moregen.append(1)
    179179    SGData['SGGen'] += moregen
    180 #    GSASIIpath.IPyBreak()
    181180    if SGData['SGLaue'] in '-1':
    182181        SGData['SGSys'] = SysSym[0]
     
    542541    LaueSym = ('-1','2/m','mmm','4/m','4/mmm','3R','3mR','3','3m1','31m','6/m','6/mmm','m3','m3m')
    543542    LattSym = ('P','A','B','C','I','F','R')
    544     UniqSym = ('','','a','b','c','',)
    545543   
    546544    '''
     
    17201718    Idup = []
    17211719    Cell = []
     1720    inv = int(SGData['SGInv']+1)
     1721    icen = SGData['SGCen']
     1722    if SGData['SGFixed']:
     1723        inv = 1
    17221724    X = np.array(XYZ)
    17231725    if Move:
    17241726        X = MoveToUnitCell(X)[0]
    1725     for ic,cen in enumerate(SGData['SGCen']):
     1727    for ic,cen in enumerate(icen):
    17261728        C = np.array(cen)
    1727         for invers in range(int(SGData['SGInv']+1)):
     1729        for invers in range(inv):
    17281730            for io,[M,T] in enumerate(SGData['SGOps']):
    17291731                idup = ((io+1)+100*ic)*(1-2*invers)
     
    20922094    "returns Mxyz terms, multipliers, GUI flags"
    20932095    CSI = [[1,2,3],[1.0,1.0,1.0]]
     2096    if '-1' in siteSym and SpnFlp[len(SpnFlp)//2] < 0:
     2097        return [[0,0,0],[0.,0.,0.]]
    20942098    for opr in dupDir:
    2095         if '-1' in siteSym and SpnFlp[len(SpnFlp)//2] < 0:
    2096             return [[0,0,0],[0.,0.,0.]]
    20972099        indx = GetNXUPQsym(opr)
    20982100        if SpnFlp[dupDir[opr]] > 0.:
     
    21002102        else:
    21012103            csi = CSxinel[indx[3]]  #Q
     2104        print(opr,SpnFlp[dupDir[opr]],indx,csi,CSI)
    21022105        if not len(csi):
    21032106            return [[0,0,0],[0.,0.,0.]]
     
    28472850    Ndup = 0
    28482851    dupDir = {}
     2852    inv = SGData['SGInv']+1
     2853    icen = SGData['SGCen']
     2854    if SGData['SGFixed']:       #already in list of operators
     2855        inv = 1
    28492856    Xeqv = GenAtom(XYZ,SGData,True)
    28502857    IRT = PackRot(SGData['SGOps'])
    28512858    L = -1
    2852     for ic,cen in enumerate(SGData['SGCen']):
    2853         for invers in range(int(SGData['SGInv']+1)):
     2859    for ic,cen in enumerate(icen):
     2860        for invers in range(int(inv)):
    28542861            for io,ops in enumerate(SGData['SGOps']):
    28552862                irtx = (1-2*invers)*IRT[io]
  • trunk/atmdata.py

    r3289 r3295  
    2424           <j0> & <j2> coeff. from Intl. Tables for Cryst, Vol. C
    2525           5-d <j0> & <j2> from Kobayashi K, Nagao T, Ito M.
    26            Acta Crystallogr A68, 589-94 (2012)
     26           Acta Crystallogr A67, 473-480 (2011)
    2727
    2828           Neutron anomalous coeff (LS) from fitting Lynn & Seeger, At. Data & Nuc. Data Tables, 44, 191-207(1990)
Note: See TracChangeset for help on using the changeset viewer.