Changeset 3572


Ignore:
Timestamp:
Aug 26, 2018 10:00:40 PM (3 years ago)
Author:
toby
Message:

fix minor FPA bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIfpaGUI.py

    r3571 r3572  
    7272'''Additional FPA dict entries used in :func:`MakeTopasFPASizer`
    7373needed for Bragg Brentano instruments with linear (1-D) PSD detectors.
     74'''
     75
     76Citation = '''MH Mendenhall, K Mullen && JP Cline. (2015) J. Res. of NIST 120, 223-251. doi:10.6028/jres.120.014.
    7477'''
    7578   
     
    158161                     Title='FPA peak', newPlot=True, lines=True)
    159162
    160     if FPdlg.GetSizer(): FPdlg.GetSizer().Clear(delete_windows=True)
     163    if FPdlg.GetSizer(): FPdlg.GetSizer().Clear(True)
    161164    numWave = parmDict['numWave']
    162165    if mode == 'BBpoint':
     
    464467        plswait.Show() # post "please wait"
    465468        wx.BeginBusyCursor()
    466         ints = NISTparms['emission']['emiss_intensities'][:]
    467         Lam1 = NISTparms['emission']['emiss_wavelengths'][ints.argmax()]*1e10
    468         if len(ints) > 1: # pick out most intense wavelengths
    469             ints[ints.argmax()] = -1
    470             Lam2 = NISTparms['emission']['emiss_wavelengths'][ints.argmax()]*1e10
     469        # pick out one or two most intense wavelengths
     470        ints = list(NISTparms['emission']['emiss_intensities'])
     471        Lam1 = NISTparms['emission']['emiss_wavelengths'][np.argmax(ints)]*1e10
     472        if len(ints) > 1:
     473            ints[np.argmax(ints)] = -1
     474            Lam2 = NISTparms['emission']['emiss_wavelengths'][np.argmax(ints)]*1e10
    471475        else:
    472476            Lam2 = None
     
    602606        SetButtonStatus()
    603607
    604     if dlg.GetSizer(): dlg.GetSizer().Clear(delete_windows=True)
     608    if dlg.GetSizer(): dlg.GetSizer().Clear(True)
    605609    MainSizer = wx.BoxSizer(wx.VERTICAL)
    606610    MainSizer.Add(wx.StaticText(dlg,wx.ID_ANY,
     
    641645    readBtn.Bind(wx.EVT_BUTTON,_onReadFPA)
    642646    MainSizer.Add(btnsizer, 0, wx.ALIGN_CENTER, 0)
    643     #MainSizer.Add((-1,5))
    644    
    645647    MainSizer.Add((-1,4),1,wx.EXPAND,1)
     648    txt = wx.StaticText(dlg,wx.ID_ANY,
     649                            'If you use this, please cite: '+Citation,
     650                            size=(350,-1))
     651    txt.Wrap(340)
     652    MainSizer.Add(txt,0,wx.ALIGN_CENTER)
    646653    btnsizer = wx.BoxSizer(wx.HORIZONTAL)
    647654    OKbtn = wx.Button(dlg, wx.ID_OK)
Note: See TracChangeset for help on using the changeset viewer.