Changeset 1589


Ignore:
Timestamp:
Dec 1, 2014 12:39:26 PM (9 years ago)
Author:
toby
Message:

2 bugs: import phase w/invalid element; prevent 3 overlapped buttons for H in Periodic table

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ElementTable.py

    r1399 r1589  
    2121ElTable = [
    2222    (["H","H-1","D","D-1","T","T-1"],0,0, "Hydrogen",    White,           0.0000,(255,255,255)),
    23     (["D","D-1"],                  0,0, "Deuterium",   White,           0.0000,(255,255,255)),
    24     (["T","T-1"],                  0,0, "Tritium",     White,           0.0000,(255,255,255)),
     23    (["D","D-1"],                  -1,-1, "Deuterium",   White,           0.0000,(255,255,255)),
     24    (["T","T-1"],                  -1,-1, "Tritium",     White,           0.0000,(255,255,255)),
    2525    (["He",],                     17,0, "Helium",      Noblecolor,      0.0000,(217,255,255)),
    2626    (["Li","Li+1"],                0,1, "Lithium",     Alkcolor,        0.0004,(204,128,255)),
  • trunk/GSASIIElem.py

    r1453 r1589  
    161161    AtomInfo = {}
    162162    ElS = getElSym(El)
     163    if El not in atmdata.XrayFF:
     164        if ElS not in atmdata.XrayFF:
     165            print('Atom type '+El+' not found, using UNK')
     166            return # not sure what this element should be!
     167        print('Atom type '+El+' not found, using '+ElS)
     168        El = ElS
    163169    AtomInfo.update(dict(zip(['Drad','Arad','Vdrad','Hbrad'],atmdata.AtmSize[ElS])))
    164170    AtomInfo['Symbol'] = El
  • trunk/GSASIIElemGUI.py

    r1208 r1589  
    3838        i=0
    3939        for E in ET.ElTable:
     40            if E[1] < 0: continue
    4041            if self.oneOnly:
    4142                color=E[4]
  • trunk/GSASIIphsGUI.py

    r1581 r1589  
    142142        generalData['Color'] = []
    143143        generalData['Mydir'] = G2frame.dirname
     144        badList = {}
    144145        for atom in atomData:
    145146            atom[ct] = atom[ct].lower().capitalize()              #force to standard form
     
    148149            elif atom[ct] != 'UNK':
    149150                Info = G2elem.GetAtomInfo(atom[ct])
     151                if not Info:
     152                    if atom[ct] not in badList:
     153                        badList[atom[ct]] = 0
     154                    badList[atom[ct]] += 1
     155                    atom[ct] = 'UNK'
     156                    continue
     157                atom[ct] = Info['Symbol'] # N.B. symbol might be changed by GetAtomInfo
    150158                generalData['AtomTypes'].append(atom[ct])
    151159                generalData['Z'] = Info['Z']
     
    161169                generalData['NoAtoms'][atom[ct]] = atom[cs-1]*float(atom[cs+1])
    162170                generalData['Color'].append(Info['Color'])
     171        if badList:
     172            msg = 'Warning: element symbol(s) not found:'
     173            for key in badList:
     174                msg += '\n\t' + key
     175                if badList[key] > 1:
     176                    msg += ' (' + str(badList[key]) + ' times)'
     177            wx.MessageBox(msg,caption='Element symbol error')
    163178        F000X = 0.
    164179        F000N = 0.
Note: See TracChangeset for help on using the changeset viewer.