Changeset 3325


Ignore:
Timestamp:
Mar 29, 2018 9:53:57 AM (4 years ago)
Author:
vondreele
Message:

add importer for Bruker image FORMAT 100 files
fix AAprobability plots - proper response from cursor position
reformat residue rigid body display to show list of names & picked item rather than show all at once - faster display

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIconstrGUI.py

    r3317 r3325  
    13131313            'RBIds':{'Vector':[],'Residue':[]}})       #empty/bad dict - fill it
    13141314           
    1315     global resList
     1315    global resList,rbId
    13161316    Indx = {}
    13171317    resList = []
     
    15271527            print ('Rigid body UNKRB added')
    15281528        text.close()
    1529         UpdateResidueRB()
     1529        UpdateResidueRB(rbId)
    15301530       
    15311531    def FindNeighbors(Orig,XYZ,atTypes,atNames,AtInfo):
     
    15671567                       
    15681568    def OnDefineTorsSeq(event):
    1569         rbKeys = list(data['Residue'].keys())
    1570         rbKeys.remove('AtInfo')
    1571         rbNames = [data['Residue'][k]['RBname'] for k in rbKeys]
    1572         rbIds = dict(zip(rbNames,rbKeys))
    1573         rbNames.sort()
    1574         rbId = 0
    1575         if len(rbNames) == 0:
    1576             print ('There are no rigid bodies defined')
    1577             G2frame.ErrorDialog('No rigid bodies','There are no rigid bodies defined',
    1578                                 parent=G2frame)
    1579             return
    1580         elif len(rbNames) > 1:
    1581             dlg = wx.SingleChoiceDialog(G2frame,'Select rigid body for torsion sequence','Torsion sequence',rbNames)
    1582             if dlg.ShowModal() == wx.ID_OK:
    1583                 sel = dlg.GetSelection()
    1584                 rbId = rbIds[rbNames[sel]]
    1585                 rbData = data['Residue'][rbId]
    1586             else:
    1587                 rbData = []
    1588             dlg.Destroy()
    1589         else:
    1590             rbId = rbIds[rbNames[0]]
    1591             rbData = data['Residue'][rbId]
     1569        global rbId
     1570        rbData = data['Residue'][rbId]
    15921571        if not len(rbData):
    15931572            return
     
    16141593            rbData['rbSeq'].append([Orig,Piv,0.0,Riding])           
    16151594        dlg.Destroy()
    1616         UpdateResidueRB()
     1595        UpdateResidueRB(rbId)
    16171596
    16181597    def UpdateVectorRB(Scroll=0):
     
    18291808        VectorRB.Scroll(0,Scroll)
    18301809       
    1831     def UpdateResidueRB():
     1810    def UpdateResidueRB(rbId=0):
    18321811        AtInfo = data['Residue']['AtInfo']
    18331812        refChoice = {}
     
    18391818                Obj = event.GetEventObject()
    18401819                rbData['RBname'] = Obj.GetValue()
     1820                wx.CallAfter(UpdateResidueRB,rbId)
    18411821               
    18421822            def OnDelRB(event):
     
    18641844                    rbData['rbXYZ'] = newXYZ
    18651845                G2plt.PlotRigidBody(G2frame,'Residue',AtInfo,rbData,plotDefaults)
    1866                 wx.CallAfter(UpdateResidueRB)
     1846                wx.CallAfter(UpdateResidueRB,rbId)
    18671847                   
    18681848            def OnPlotRB(event):
     
    19881968                for col in range(5):
    19891969                    vecGrid.SetCellStyle(row,col,VERY_LIGHT_GREY,True)
    1990 #            vecGrid.SetScrollRate(0,0)
    19911970            vecGrid.AutoSizeColumns(False)
    19921971            vecSizer = wx.BoxSizer()
     
    20452024                rbId,Seq = Indx[Obj.GetId()]
    20462025                data['Residue'][rbId]['rbSeq'].remove(Seq)       
    2047                 wx.CallAfter(UpdateResidueRB)
     2026                wx.CallAfter(UpdateResidueRB,rbId)
    20482027           
    20492028            seqSizer = wx.FlexGridSizer(0,5,2,2)
     
    21152094            for i in range(3):
    21162095                refChoice[rbId][i].append(rbRef[i])
    2117                 refChoice[rbId][i].sort()     
    2118            
    2119         ResidueRBDisplay.DestroyChildren()
     2096                refChoice[rbId][i].sort()
     2097               
     2098        def OnSelect(event):
     2099            global rbId
     2100            rbname = rbchoice[select.GetSelection()]
     2101            rbId = RBnames[rbname]
     2102            wx.CallAfter(UpdateResidueRB,rbId)
     2103           
     2104           
     2105        if ResidueRBDisplay.GetSizer(): ResidueRBDisplay.GetSizer().Clear(True)
    21202106        ResidueRBSizer = wx.BoxSizer(wx.VERTICAL)
    2121         for rbId in data['RBIds']['Residue']:
     2107        ResidueRBSizer.Add(wx.StaticText(ResidueRBDisplay,label=' Select residue to view:'),0)
     2108        RBnames = {}
     2109        for rbid in data['RBIds']['Residue']:
     2110            RBnames.update({data['Residue'][rbid]['RBname']:rbid,})
     2111        rbchoice = RBnames.keys()
     2112        rbchoice.sort()
     2113        select = wx.ListBox(ResidueRBDisplay,choices=rbchoice,style=wx.LB_SINGLE,size=(-1,120))
     2114        select.Bind(wx.EVT_LISTBOX,OnSelect)
     2115        ResidueRBSizer.Add(select,0)
     2116        if rbId:
    21222117            rbData = data['Residue'][rbId]
    2123             if len(rbData['rbXYZ']) < 3:    #patch - skip around bad RBs with too few atoms
    2124                 continue
    21252118            FillRefChoice(rbId,rbData)
    21262119            ResidueRBSizer.Add(rbNameSizer(rbId,rbData),0)
     
    21372130            if rbData['rbSeq']:
    21382131                ResidueRBSizer.Add(slideSizer,)
    2139             ResidueRBSizer.Add(wx.StaticText(ResidueRBDisplay,-1,70*'-'))
    21402132
    21412133        ResidueRBSizer.Add((5,25),)
  • trunk/GSASIIphsGUI.py

    r3317 r3325  
    35703570        print ('NB: this calc. matches errat.f result')
    35713571        print ('Plot 2 is Protein validation based on erratv2.cpp; by D. Obukhov & T. Yeates (2002)')
    3572         print ('Ref: Colovos, C. & Yates, T.O. Protein Science 2, 1511-1519 (1991).')
    35733572        print ('Residue error scores >11.5 for 5% & >17.2 for 1% likelihood of being correct')
    35743573        print ('NB: this calc. gives a close approximate to original erratv2 result')
  • trunk/GSASIIplot.py

    r3324 r3325  
    40564056    def OnMotion(event):
    40574057        xpos,ypos = event.xdata,event.ydata
    4058         if xpos:
    4059             xylim = Page.xylim                                        #avoid out of frame mouse position
    4060             xpos = xpos*(xylim[0][1]-xylim[0][0])+xylim[0][0]
    4061             xpos = int(xpos+.5)
     4058        if xpos > 1.:
    40624059            if 0 <= xpos < len(resNames):
    4063                 resName = resNames[xpos]
     4060                resName = resNames[int(xpos+.5)-1]
    40644061            else:
    40654062                resName = ''
    4066             if 0.55 <= ypos <= 1.00:
    4067                 ypos = (ypos-.55)/0.45*xylim[1][1]
    4068             elif 0. <= ypos <= 0.45:
    4069                 ypos = ypos/0.45*xylim[2][1]
    4070             else:
    4071                 ypos = 0.0
    40724063            Page.canvas.SetCursor(wx.CROSS_CURSOR)
    40734064            try:
Note: See TracChangeset for help on using the changeset viewer.