Changeset 1815


Ignore:
Timestamp:
Apr 28, 2015 11:06:58 AM (7 years ago)
Author:
vondreele
Message:

revise MovePatternTreeToGrid? to have PickId? set near top & not in if/elif blocks
fix plot problem - not able to move difference curve.
put test on negative diag terms in G-matrix in "right" place

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r1814 r1815  
    37503750       
    37513751    G2frame.dataFrame.Raise()           
    3752     G2frame.PickId = 0
     3752    G2frame.PickId = item
    37533753    G2frame.PickIdText = None
    37543754    parentID = G2frame.root
     
    37593759    if G2frame.PatternTree.GetItemParent(item) == G2frame.root:
    37603760        G2frame.PatternId = item
    3761         G2frame.PickId = item
     3761#        G2frame.PickId = item
    37623762        if G2frame.PatternTree.GetItemText(item) == 'Notebook':
    37633763            SetDataMenuBar(G2frame,G2frame.dataFrame.DataNotebookMenu)
     
    38373837                value='Select one phase to see its parameters')           
    38383838    elif 'I(Q)' in G2frame.PatternTree.GetItemText(item):
    3839         G2frame.PickId = item
     3839#        G2frame.PickId = item
    38403840        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    38413841        data = G2frame.PatternTree.GetItemPyData(GetPatternTreeItemId(G2frame,G2frame.PatternId,'PDF Controls'))
     
    38433843        G2plt.PlotISFG(G2frame,type='I(Q)',newPlot=True)
    38443844    elif 'S(Q)' in G2frame.PatternTree.GetItemText(item):
    3845         G2frame.PickId = item
     3845#        G2frame.PickId = item
    38463846        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    38473847        data = G2frame.PatternTree.GetItemPyData(GetPatternTreeItemId(G2frame,G2frame.PatternId,'PDF Controls'))
     
    38493849        G2plt.PlotISFG(G2frame,type='S(Q)',newPlot=True)
    38503850    elif 'F(Q)' in G2frame.PatternTree.GetItemText(item):
    3851         G2frame.PickId = item
     3851#        G2frame.PickId = item
    38523852        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    38533853        data = G2frame.PatternTree.GetItemPyData(GetPatternTreeItemId(G2frame,G2frame.PatternId,'PDF Controls'))
     
    38553855        G2plt.PlotISFG(G2frame,type='F(Q)',newPlot=True)
    38563856    elif 'G(R)' in G2frame.PatternTree.GetItemText(item):
    3857         G2frame.PickId = item
     3857#        G2frame.PickId = item
    38583858        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    38593859        data = G2frame.PatternTree.GetItemPyData(GetPatternTreeItemId(G2frame,G2frame.PatternId,'PDF Controls'))
     
    38613861        G2plt.PlotISFG(G2frame,type='G(R)',newPlot=True)           
    38623862    elif G2frame.PatternTree.GetItemText(parentID) == 'Phases':
    3863         G2frame.PickId = item
     3863#        G2frame.PickId = item
    38643864        data = G2frame.PatternTree.GetItemPyData(item)
    38653865        G2phG.UpdatePhaseData(G2frame,item,data,oldPage)
     
    38673867        SetDataMenuBar(G2frame,G2frame.dataFrame.DataCommentsMenu)
    38683868        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    3869         G2frame.PickId = item
     3869#        G2frame.PickId = item
    38703870        data = G2frame.PatternTree.GetItemPyData(item)
    38713871        UpdateComments(G2frame,data)
    38723872    elif G2frame.PatternTree.GetItemText(item) == 'Image Controls':
    38733873        G2frame.dataFrame.SetTitle('Image Controls')
    3874         G2frame.PickId = item
     3874#        G2frame.PickId = item
    38753875        G2frame.Image = G2frame.PatternTree.GetItemParent(item)
    38763876        masks = G2frame.PatternTree.GetItemPyData(
     
    38813881    elif G2frame.PatternTree.GetItemText(item) == 'Masks':
    38823882        G2frame.dataFrame.SetTitle('Masks')
    3883         G2frame.PickId = item
     3883#        G2frame.PickId = item
    38843884        G2frame.Image = G2frame.PatternTree.GetItemParent(item)
    38853885        data = G2frame.PatternTree.GetItemPyData(item)
     
    38883888    elif G2frame.PatternTree.GetItemText(item) == 'Stress/Strain':
    38893889        G2frame.dataFrame.SetTitle('Stress/Strain')
    3890         G2frame.PickId = item
     3890#        G2frame.PickId = item
    38913891        G2frame.Image = G2frame.PatternTree.GetItemParent(item)
    38923892        data = G2frame.PatternTree.GetItemPyData(item)
     
    38973897        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    38983898        for i in G2frame.ExportPDF: i.Enable(True)
    3899         G2frame.PickId = item
     3899#        G2frame.PickId = item
    39003900        data = G2frame.PatternTree.GetItemPyData(item)
    39013901        G2pdG.UpdatePDFGrid(G2frame,data)
     
    39073907        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    39083908        for i in G2frame.ExportPeakList: i.Enable(True)
    3909         G2frame.PickId = item
     3909#        G2frame.PickId = item
    39103910        data = G2frame.PatternTree.GetItemPyData(item)
    39113911#patch
     
    39183918    elif G2frame.PatternTree.GetItemText(item) == 'Background':
    39193919        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    3920         G2frame.PickId = item
     3920#        G2frame.PickId = item
    39213921        data = G2frame.PatternTree.GetItemPyData(item)
    39223922        G2pdG.UpdateBackground(G2frame,data)
     
    39253925        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    39263926        datatype = G2frame.PatternTree.GetItemText(G2frame.PatternId)[:4]
    3927         G2frame.PickId = item
     3927#        G2frame.PickId = item
    39283928        data = G2frame.PatternTree.GetItemPyData(item)
    39293929        G2pdG.UpdateLimitsGrid(G2frame,data,datatype)
     
    39313931    elif G2frame.PatternTree.GetItemText(item) == 'Instrument Parameters':
    39323932        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    3933         G2frame.PickId = item
     3933#        G2frame.PickId = item
    39343934        data = G2frame.PatternTree.GetItemPyData(item)[0]
    39353935        G2pdG.UpdateInstrumentGrid(G2frame,data)
     
    39383938    elif G2frame.PatternTree.GetItemText(item) == 'Models':
    39393939        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    3940         G2frame.PickId = item
     3940#        G2frame.PickId = item
    39413941        data = G2frame.PatternTree.GetItemPyData(item)
    39423942        G2pdG.UpdateModelsGrid(G2frame,data)
     
    39463946    elif G2frame.PatternTree.GetItemText(item) == 'Substances':
    39473947        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    3948         G2frame.PickId = item
     3948#        G2frame.PickId = item
    39493949        data = G2frame.PatternTree.GetItemPyData(item)
    39503950        G2pdG.UpdateSubstanceGrid(G2frame,data)
    39513951    elif G2frame.PatternTree.GetItemText(item) == 'Sample Parameters':
    39523952        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    3953         G2frame.PickId = item
     3953#        G2frame.PickId = item
    39543954        data = G2frame.PatternTree.GetItemPyData(item)
    39553955        datatype = G2frame.PatternTree.GetItemPyData(G2frame.PatternId)[2][:4]
     
    39673967        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    39683968        for i in G2frame.ExportPeakList: i.Enable(True)
    3969         G2frame.PickId = item
     3969#        G2frame.PickId = item
    39703970        data = G2frame.PatternTree.GetItemPyData(item)
    39713971#patch
     
    39813981    elif G2frame.PatternTree.GetItemText(item) == 'Unit Cells List':
    39823982        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    3983         G2frame.PickId = item
     3983#        G2frame.PickId = item
    39843984        data = G2frame.PatternTree.GetItemPyData(item)
    39853985        if not data:
     
    40024002    elif G2frame.PatternTree.GetItemText(item) == 'Reflection Lists':   #powder reflections
    40034003        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    4004         G2frame.PickId = item
     4004#        G2frame.PickId = item
    40054005        data = G2frame.PatternTree.GetItemPyData(item)
    40064006        G2frame.RefList = ''
     
    40104010        G2plt.PlotPatterns(G2frame)
    40114011    elif G2frame.PatternTree.GetItemText(item) == 'Reflection List':    #HKLF reflections
     4012#        G2frame.PickId = item
    40124013        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
    40134014        name = G2frame.PatternTree.GetItemText(G2frame.PatternId)
  • trunk/GSASIIplot.py

    r1806 r1815  
    12411241            data = G2frame.PatternTree.GetItemPyData(PickId)
    12421242            ypos = event.ydata
     1243            Pattern[0]['delOffset'] = -ypos/Ymax
    12431244            G2frame.itemPicked = None
    12441245            G2frame.PatternTree.SetItemPyData(PickId,data)
  • trunk/GSASIIstrIO.py

    r1813 r1815  
    13181318    except KeyError:
    13191319        sigA = [0,0,0,0,0,0]
    1320     if np.any(np.diag(G2lat.A2Gmat(A,False))) < 0.:
    1321         raise G2obj.G2Exception('Negative g-tensor')
    13221320    return A,sigA
    13231321       
  • trunk/GSASIIstrMath.py

    r1813 r1815  
    3939twopi = 2.0*np.pi
    4040twopisq = 2.0*np.pi**2
    41 
    42 class UserAbort(BaseException):
    43     def __init__(self,line):
    44         self.line = line
    45        
    4641
    4742################################################################################
     
    20041999        A = [parmDict[pfx+'A%d'%(i)]+Dij[i] for i in range(6)]
    20052000        G,g = G2lat.A2Gmat(A)       #recip & real metric tensors
     2001        if np.any(np.diag(G)<0.):
     2002            raise G2obj.G2Exception('invalid metric tensor \n cell/Dij refinement not advised')
    20062003        GA,GB = G2lat.Gmat2AB(G)    #Orthogonalization matricies
    20072004        Vst = np.sqrt(nl.det(G))    #V*
Note: See TracChangeset for help on using the changeset viewer.