Changeset 1150 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Nov 24, 2013 9:08:18 PM (9 years ago)
Author:
toby
Message:

Catch phase w/o histogram error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r1147 r1150  
    16391639        if 'ISODISTORT' not in data:
    16401640            raise Exception,"Should not happen: 'ISODISTORT' not in data"
     1641        if len(data.get('Histograms',[])) == 0:
     1642            G2frame.ErrorDialog(
     1643                'No data',
     1644                'Sorry, this computation requires that a histogram first be added to the phase'
     1645                )
     1646            return
    16411647        def _onClose(event):
    16421648            dlg.EndModal(wx.ID_CANCEL)
     
    16521658            v = Ilbl[Ilbl.rfind('_')+1:]
    16531659            pval = ISO['ParentStructure'][albl][['dx','dy','dz'].index(v)]
    1654             cval = parmDict.get(var)[0]
     1660            if var in parmDict:
     1661                cval = parmDict[var][0]
     1662            else:
     1663                G2frame.ErrorDialog('Atom not found',"No value found for parameter "+str(var))
     1664                return
    16551665            deltaList.append(cval-pval)
    16561666        modeVals = np.inner(ISO['Var2ModeMatrix'],deltaList)
Note: See TracChangeset for help on using the changeset viewer.