Changeset 1493 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
Sep 11, 2014 4:35:59 PM (8 years ago)
Author:
vondreele
Message:

set move=True for GenAtom? call for FillUnitCell?
show bin width in calibration plot - also label items
add check if nothing refined in calibrate
fix crash at end of refinement for reflections with bad widths
fix testDeriv to show constrained variables
fix SCExtinction for constrained extinction coef

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r1475 r1493  
    956956           
    957957    def OnCalibrate(event):
     958        Pattern = G2frame.PatternTree.GetItemPyData(G2frame.PatternId)
     959        xye = ma.array(ma.getdata(Pattern[1]))
     960        cw = np.diff(xye[0])
    958961        IndexPeaks = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Index Peak List'))
    959962        if not len(IndexPeaks[0]):
     
    967970            G2frame.ErrorDialog('Can not calibrate','Index Peak List not indexed')
    968971            return           
    969         G2pwd.DoCalibInst(IndexPeaks,data)
    970         UpdateInstrumentGrid(G2frame,data)
    971         XY = []
    972         Sigs = []
    973         for ip,peak in enumerate(IndexPeaks[0]):
    974             if peak[2] and peak[3]:
    975                 XY.append([peak[8],peak[0]])
    976                 Sigs.append(IndexPeaks[1][ip])
    977         if len(XY):
    978             XY = np.array(XY)
    979             G2plt.PlotCalib(G2frame,data,XY,Sigs,newPlot=True)
     972        if G2pwd.DoCalibInst(IndexPeaks,data):
     973            UpdateInstrumentGrid(G2frame,data)
     974            XY = []
     975            Sigs = []
     976            for ip,peak in enumerate(IndexPeaks[0]):
     977                if peak[2] and peak[3]:
     978                    binwid = cw[np.searchsorted(xye[0],peak[0])]
     979                    XY.append([peak[8],peak[0],binwid])
     980                    Sigs.append(IndexPeaks[1][ip])
     981            if len(XY):
     982                XY = np.array(XY)
     983                G2plt.PlotCalib(G2frame,data,XY,Sigs,newPlot=True)
     984        else:
     985            G2frame.ErrorDialog('Can not calibrate','Nothing selected for refinement')
     986           
    980987
    981988    def OnLoad(event):
Note: See TracChangeset for help on using the changeset viewer.