示例#1
0
 def OnNewMenu(self, event):
     ElList = []
     for Elem in self.Elems:
         ElList.append(Elem[0])
     PE = G2elemGUI.PickElements(self, ElList)
     if PE.ShowModal() == wx.ID_OK:
         Elem = PE.Elem
     PE.Destroy()
     if Elem:
         for El in Elem:
             ElemSym = El.strip().upper()
             if ElemSym not in ElList:
                 atomData = G2elem.GetAtomInfo(ElemSym.capitalize())
                 FormFactors = G2elem.GetFormFactorCoeff(ElemSym)
                 for FormFac in FormFactors:
                     FormSym = FormFac['Symbol'].strip()
                     if FormSym == ElemSym:
                         Z = FormFac['Z']  #At. No.
                         N = 1.  #no atoms / formula unit
                         Orbs = G2elem.GetXsectionCoeff(ElemSym)
                         Elem = [ElemSym, Z, N, FormFac, Orbs, atomData]
                 self.Elems.append(Elem)
         self.Delete.Enable(True)
         self.panel.Destroy()
         self.DrawPanel()
         self.NewFPPlot = True
         self.SetWaveEnergy(self.Wave)
示例#2
0
    def OnPickElement(self, Parms):

        PE = G2elG.PickElement(self.testFFPanel, oneOnly=True)
        if PE.ShowModal() == wx.ID_OK:
            self.xrayFFs = G2el.GetFormFactorCoeff(PE.Elem)
            self.Elem = PE.Elem
            self.atmInfo = G2el.GetAtomInfo(PE.Elem)
            self.magFFs = G2el.GetMagFormFacCoeff(PE.Elem)
        PE.Destroy()
        self.MakePlot()