Changeset 4660


Ignore:
Timestamp:
Nov 23, 2020 5:37:49 PM (11 months ago)
Author:
vondreele
Message:

Add atom site fraction calculator for 2 atom shared sites

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIElemGUI.py

    r4203 r4660  
    5454        if self.multiple:
    5555            b = wx.Button(self,wx.ID_CLOSE,
    56                           pos=wx.Point(16.5*self.butWid+25,7.75*24+24),
    57                           label="Done")
     56                pos=wx.Point(16.5*self.butWid+25,7.75*24+24),label="Done")
    5857            b.Bind(wx.EVT_BUTTON, self.OnClose)
    5958
  • trunk/GSASIIdataGUI.py

    r4659 r4660  
    61766176            'wxID_ATOMSPDISAGL', 'wxID_ISODISP', 'wxID_ADDHATOM', 'wxID_UPDATEHATOM',
    61776177            'wxID_ATOMSROTATE', 'wxID_ATOMSDENSITY','wxID_ATOMSBNDANGLHIST',
    6178             'wxID_ATOMSSETALL', 'wxID_ATOMSSETSEL',)
     6178            'wxID_ATOMSSETALL', 'wxID_ATOMSSETSEL','wxID_ATOMFRACSPLIT',)
    61796179        self.AtomsMenu = wx.MenuBar()
    61806180        self.PrefillDataMenu(self.AtomsMenu)
     
    62136213        self.AtomCompute.Append(G2G.wxID_ATOMSPDISAGL,'Save Distances && Angles','Compute distances & angles for selected atoms')
    62146214        self.AtomCompute.Append(G2G.wxID_ATOMSBNDANGLHIST,'Histogram Bonds && Angles','Histogram bonds & angles for selected atoms')
     6215        self.AtomCompute.Append(G2G.wxID_ATOMFRACSPLIT,'Apportion atom frac','2 atom type site fraction apportion')
    62156216        self.AtomCompute.Append(G2G.wxID_ATOMSDENSITY,'Density','Compute density for current phase')
    62166217        self.AtomCompute.ISOcalc = self.AtomCompute.Append(G2G.wxID_ISODISP,'ISODISTORT mode values',
  • trunk/GSASIIphsGUI.py

    r4659 r4660  
    42464246            print ("select one or more rows of atoms")
    42474247            G2frame.ErrorDialog('Select atom',"select one or more rows of atoms then redo")
     4248           
     4249    def OnFracSplit(event):
     4250        'Split atom frac accordintg to atom type & refined site fraction'   
     4251        cx,ct,cs,ci = getAtomPtrs(data)     
     4252        indx = getAtomSelections(Atoms,ct-1)
     4253        if indx:
     4254            atomData = data['Atoms']
     4255            colLabels = [Atoms.GetColLabelValue(c) for c in range(Atoms.GetNumberCols())]
     4256            PE = G2elemGUI.PickElement(G2frame,oneOnly=True)
     4257            if PE.ShowModal() == wx.ID_OK:
     4258                Atype2 = PE.Elem.strip()
     4259                AtomInfo2 = G2elem.GetAtomInfo(Atype2)
     4260                Z2 = AtomInfo2['Z']
     4261                B2 = AtomInfo2['Isotopes']['Nat. Abund.']['SL'][0]
     4262            PE.Destroy()
     4263            for ind in indx:
     4264                Aname1 = atomData[ind][ct-1]
     4265                Atype1 = G2elem.FixValence(atomData[ind][ct])
     4266                Afrac = atomData[ind][cx+3]
     4267                AtomInfo1 = G2elem.GetAtomInfo(Atype1)
     4268                if Atype1 == Atype2:
     4269                    print('ERROR - 2nd atom type must be different from selected atom')
     4270                    continue
     4271                Z1 = AtomInfo1['Z']
     4272                B1 = AtomInfo1['Isotopes']['Nat. Abund.']['SL'][0]
     4273                frac1 = (Z1*Afrac-Z2)/(Z1-Z2)
     4274                bfrac1 = (B1*Afrac-B2)/(B1-B2)
     4275                print(' For %s: X-ray based %s site fraction = %.3f, %s site fraction = %.3f'%(Aname1,Atype1,frac1,Atype2,(1.-frac1)))
     4276                print('        neutron based %s site fraction = %.3f, %s site fraction = %.3f\n'%(Atype1,bfrac1,Atype2,(1.-bfrac1)))
    42484277                       
    42494278    def OnValidProtein(event):
     
    1263512664        G2frame.Bind(wx.EVT_MENU, OnDistAnglePrt, id=G2G.wxID_ATOMSPDISAGL)
    1263612665        G2frame.Bind(wx.EVT_MENU, OnDistAngleHist, id=G2G.wxID_ATOMSBNDANGLHIST)
     12666        G2frame.Bind(wx.EVT_MENU, OnFracSplit, id=G2G.wxID_ATOMFRACSPLIT)
    1263712667        G2frame.Bind(wx.EVT_MENU, OnDensity, id=G2G.wxID_ATOMSDENSITY)
    1263812668        G2frame.Bind(wx.EVT_MENU, OnIsoDistortCalc, id=G2G.wxID_ISODISP)
Note: See TracChangeset for help on using the changeset viewer.