Changeset 2170 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Mar 14, 2016 9:13:28 AM (7 years ago)
Author:
vondreele
Message:

fix isotope problem for atyoms with no "Nat. Abund."
add scale & background to stacking simulation - still under development

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r2167 r2170  
    291291                generalData['vdWRadii'].append(Info['Vdrad'])
    292292                if atom[ct] in generalData['Isotope']:
     293                    if generalData['Isotope'][atom[ct]] not in generalData['Isotopes'][atom[ct]]:
     294                        isotope = generalData['Isotopes'][atom[ct]].keys()[-1]
     295                        generalData['Isotope'][atom[ct]] = isotope
    293296                    generalData['AtomMass'].append(Info['Isotopes'][generalData['Isotope'][atom[ct]]]['Mass'])
    294297                else:
    295298                    generalData['Isotope'][atom[ct]] = 'Nat. Abund.'
     299                    if 'Nat. Abund.' not in generalData['Isotopes'][atom[ct]]:
     300                        isotope = generalData['Isotopes'][atom[ct]].keys()[-1]
     301                        generalData['Isotope'][atom[ct]] = isotope
    296302                    generalData['AtomMass'].append(Info['Mass'])
    297303                generalData['NoAtoms'][atom[ct]] = atom[cs-1]*float(atom[cs+1])
     
    624630                item = Indx[Obj.GetId()]
    625631                isotope = Obj.GetValue()
    626                 generalData['Isotope'][item] = isotope
     632                data['General']['Isotope'][item] = isotope
    627633                indx = generalData['AtomTypes'].index(item)
    628634                data['General']['AtomMass'][indx] = generalData['Isotopes'][item][isotope]['Mass']
     
    677683                colorTxt.SetBackgroundColour(wx.Colour(R,G,B))
    678684                elemSizer.Add(colorTxt,0,WACV)
     685           
    679686            return elemSizer
    680687       
     
    28852892        PWDR = data['Histograms'][HistName]
    28862893        G2frame.PatternId = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,HistName)
    2887        
     2894        sample = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(
     2895            G2frame,G2frame.PatternId, 'Sample Parameters'))
     2896        scale = sample['Scale'][0]
     2897        background = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(
     2898            G2frame,G2frame.PatternId, 'Background'))       
    28882899        limits = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(
    28892900            G2frame,G2frame.PatternId, 'Limits'))[1]
     
    28932904            wx.MessageBox("Can't simulate neutron TOF patterns yet",caption='Data error',style=wx.ICON_EXCLAMATION)
    28942905            return           
    2895         profile = G2frame.PatternTree.GetItemPyData(G2frame.PatternId)[1]
    2896            
    2897         G2pwd.StackSim(data['Layers'],HistName,limits,inst,profile)
     2906        profile = G2frame.PatternTree.GetItemPyData(G2frame.PatternId)[1]           
     2907        G2pwd.StackSim(data['Layers'],HistName,scale,background,limits,inst,profile)
    28982908        G2plt.PlotPatterns(G2frame,plotType='PWDR')
    28992909       
Note: See TracChangeset for help on using the changeset viewer.