Changeset 4809


Ignore:
Timestamp:
Feb 10, 2021 3:49:46 PM (2 years ago)
Author:
toby
Message:

display more Residue rigid body info; better docs

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIconstrGUI.py

    r4805 r4809  
    32923292                    Indx[stripH.GetId()] = rbid
    32933293                    nameSizer.Add(stripH,0,WACV)
     3294            nameSizer.Add(wx.StaticText(ResidueRBDisplay,-1,'  body type #'+
     3295                                        str(data['RBIds']['Residue'].index(rbid))),0,WACV)
    32943296            return nameSizer
    32953297           
  • trunk/GSASIIdataGUI.py

    r4806 r4809  
    85288528    mainSizer.Add((5,5),)
    85298529    wtSizer = wx.BoxSizer(wx.HORIZONTAL)
    8530     wtSizer.Add(G2G.HelpButton(G2frame.dataWindow,helpIndex=G2frame.dataWindow.helpKey))
    85318530    wtSizer.Add(wx.StaticText(G2frame.dataWindow,-1,' Weight factor: '),0,WACV)
    85328531    wtSizer.Add(G2G.ValidatedTxtCtrl(G2frame.dataWindow,data[0],'wtFactor',nDig=(10,3),xmin=1.e-9),0,WACV)
     
    85398538#        comp.Bind(wx.EVT_COMBOBOX, OnCompression)
    85408539#        wtSizer.Add(comp,0,WACV)
    8541 
    8542     mainSizer.Add(wtSizer)
     8540    wtSizer.Add((-1,-1),1,wx.EXPAND)
     8541    wtSizer.Add(G2G.HelpButton(G2frame.dataWindow,helpIndex=G2frame.dataWindow.helpKey))
     8542    mainSizer.Add(wtSizer,0,wx.EXPAND)
    85438543    wtSizer = wx.BoxSizer(wx.HORIZONTAL)
    85448544    wtSizer.Add(wx.StaticText(G2frame.dataWindow,-1,' Histogram label: '),0,WACV)
  • trunk/GSASIIobj.py

    r4680 r4809  
    454454
    455455
     456Phase Information
     457--------------------
     458
     459.. index::
     460   single: Phase information record description
     461
     462Phase information is placed in one of the following keys:
     463
     464.. tabularcolumns:: |l|p{4.5in}|
     465
     466==========  ==============================================================
     467  key         explanation
     468==========  ==============================================================
     469General       Overall information about a phase
     470Histograms    Information about each histogram linked to the
     471              current phase as well as parameters that
     472              are defined for each histogram and phase
     473              (such as sample peak widths and preferred
     474              orientation parameters.
     475Atoms         Contains a list of atoms, as described in the
     476              :ref:`Atom Records <Atoms_table>` description.
     477Drawing       Parameters that determine how the phase is
     478              displayed, including a list of atoms to be
     479              included, as described in the
     480              :ref:`Drawing Atom Records <Drawing_atoms_table>`
     481              description
     482MCSA          Monte-Carlo simulated annealing parameters
     483pId           The index of each phase in the project, numbered
     484              starting at 0
     485ranId         An int value with a unique value for each phase
     486RBModels      A list of dicts with parameters for each
     487              rigid body inserted into the current phase,
     488              as defined in the
     489              :ref:`Rigid Body Insertions <Rigid_Body_Insertions>`.
     490              Note that the rigid bodies are defined as
     491              :ref:`Rigid Body Objects <RBData_table>`
     492RMC           PDF modeling parameters
     493Pawley ref    Pawley refinement parameters
     494
     495==========  ==============================================================
     496
    456497.. _Atoms_table:
    457498
     
    460501   single: Data object descriptions; Atoms record
    461502
     503--------------------
    462504Atom Records
    463 ------------
     505--------------------
    464506
    465507If ``phasedict`` points to the phase information in the data tree, then
     
    500542   single: Data object descriptions; Drawing atoms record
    501543
     544----------------------------
    502545Drawing Atom Records
    503 --------------------
     546----------------------------
    504547
    505548If ``phasedict`` points to the phase information in the data tree, then
     
    531574cs+5...cs+11        (6 floats) U11, U22, U33, U12, U13, U23
    532575ci                  (int) unique atom identifier; matches source atom Id in Atom Records
     576==============   ===================================================================================
     577
     578.. _Rigid_Body_Insertions:
     579
     580----------------------------
     581Rigid Body Insertions
     582----------------------------
     583
     584If ``phasedict`` points to the phase information in the data tree, then
     585rigid body information is contained in list(s) in
     586``phasedict['RBModels']['Residue']`` and/or ``phasedict['RBModels']['Vector']``
     587for each rigid body inserted into the current phase.
     588
     589.. tabularcolumns:: |l|p{4.5in}|
     590
     591==============   ===================================================================================
     592key              explanation
     593==============   ===================================================================================
     594fixOrig           Should the origin be fixed (when editing, not the refinement flag)
     595Ids               Ids for assignment of atoms in the rigid body
     596numChain          Chain number for macromolecular fits
     597Orient            Orientation of the RB as a quaternion and a refinement flag (' ', 'A' or 'AV')
     598OrientVec         Orientation of the RB expressed as a vector and azimuthal rotation angle
     599Orig              Origin of the RB in fractional coordinates and refinement flag (bool)
     600RBId              References the unique ID of a rigid body in the
     601                  :ref:`Rigid Body Objects <RBData_table>`
     602RBname            The name for the rigid body (str)
     603ThermalMotion     The thermal motion description for the rigid body, which includes a choice for
     604                  the model and can include TLS parameters or an overall Uiso value.
     605Torsions          Defines the torsion angle and refinement flag for each torsion defined in
     606                  the :ref:`Rigid Body Object <RBData_table>`
    533607==============   ===================================================================================
    534608
     
    17131787            lbl = ShortPhaseNames.get(l[0],'phase?')
    17141788            if 'RB' in l[2]:    #rigid body parm
    1715                 s = "Res #"+str(l[3])+" body #"+str(l[4])+" in "+str(lbl)
     1789                s = "RB body #"+str(l[3])+" (type "+str(l[4])+") in "+str(lbl) + ','
    17161790            else: #modulation parm
    17171791                s = 'Atom %s wave %s in %s'%(LookupAtomLabel(l[0],l[3])[0],l[4],lbl)
  • trunk/GSASIIphsGUI.py

    r4803 r4809  
    8989acosd = lambda x: 180.*np.arccos(x)/np.pi
    9090atan2d = lambda x,y: 180.*np.arctan2(y,x)/np.pi
     91
     92# previous rigid body selections
     93prevResId = None
     94prevVecId = None
    9195
    9296if '2' in platform.python_version_tuple()[0]:
     
    98069810        Note that the page is a ScrolledWindow, not a Grid
    98079811        '''
     9812        resVarLookup = []
    98089813        def OnThermSel(event):       #needs to be seen by VecRbSizer!
    98099814            Obj = event.GetEventObject()
     
    99559960            return rbSizer
    99569961                         
    9957         def ResrbSizer(RBObj):
    9958            
     9962        def ResrbSizer(RBObj,resIndx):
     9963            '''Displays details for selected rigid body'''
    99599964            def OnTorsionRef(event):
    99609965                Obj = event.GetEventObject()
     
    1000510010                topLine.Add(wx.StaticText(RigidBodies,-1,
    1000610011                    '   Rigid body {} axis is aligned along oriention vector'.format(lbl)),0,WACV)
     10012            varname = str(data['pId'])+'::RBRxxx:'+resVarLookup[resIndx]
     10013            topLine.Add(wx.StaticText(RigidBodies,-1,
     10014                    '  (variables '+varname+')'),0,WACV)
    1000710015            resrbSizer.Add(topLine)
    1000810016            resrbSizer.Add(LocationSizer(RBObj,'Residue'))
     
    1007310081       
    1007410082        def OnVecSelect(event):
    10075             rbId = select.GetSelection()
    10076             wx.CallLater(100,RepaintRBInfo,'Vector',rbId)
     10083            global prevVecId
     10084            prevVecId = select.GetSelection()
     10085            wx.CallLater(100,RepaintRBInfo,'Vector',prevVecId)
    1007710086           
    1007810087        def OnResSelect(event):
    10079             rbId = resSelect.GetSelection()
    10080             wx.CallLater(100,RepaintRBInfo,'Residue',rbId)
     10088            global prevResId
     10089            prevResId = resSelect.GetSelection()
     10090            wx.CallLater(100,RepaintRBInfo,'Residue',prevResId)
    1008110091           
    10082         def RepaintRBInfo(rbType,rbId,Scroll=0):
     10092        def RepaintRBInfo(rbType,rbIndx,Scroll=0):
    1008310093            oldFocus = wx.Window.FindFocus()
    1008410094            if 'phoenix' in wx.version():
     
    1008710097                G2frame.bottomSizer.DeleteWindows()
    1008810098            Indx.clear()
    10089             rbObj = data['RBModels'][rbType][rbId]
     10099            rbObj = data['RBModels'][rbType][rbIndx]
    1009010100            data['Drawing']['viewPoint'][0] = rbObj['Orig'][0]
    1009110101            Quad = rbObj['Orient'][0]
    1009210102            data['Drawing']['Quaternion'] = G2mth.invQ(Quad)
    10093             G2frame.bottomSizer =  ResrbSizer(rbObj)
     10103            G2frame.bottomSizer =  ResrbSizer(rbObj,rbIndx)
    1009410104            mainSizer.Add(G2frame.bottomSizer)
    1009510105            mainSizer.Layout()
     
    1013210142            mainSizer.Add((5,5),0)
    1013310143            RBnames = []
    10134             for RBObj in data['RBModels']['Residue']:
    10135                 RBnames.append(RBObj['RBname']+RBObj['numChain'])
    10136             if resId is None:
     10144            resVarLookup = []
     10145            for irb,RBObj in enumerate(data['RBModels']['Residue']):
     10146                name = RBObj['RBname']+RBObj['numChain']
     10147                RBnames.append(name)
     10148                jrb = RBData['RBIds']['Residue'].index(RBObj['RBId'])
     10149                resVarLookup.append(str(irb)+':'+str(jrb)) # var name suffix following G2strMath.ApplyRBModels()
     10150            if prevResId is not None:
     10151                resId = prevResId
     10152            try:
     10153                rbName = RBnames[resId]
     10154            except TypeError:
    1013710155                resId = 0
    10138             rbName = RBnames[resId]
     10156                rbName = RBnames[resId]
    1013910157            rbObj = data['RBModels']['Residue'][resId]
    1014010158            data['Drawing']['viewPoint'][0] = rbObj['Orig'][0]
     
    1014610164            mainSizer.Add(resSelect,0)
    1014710165            G2frame.bottomSizer = wx.BoxSizer(wx.VERTICAL)
    10148             G2frame.bottomSizer.Add(ResrbSizer(rbObj))
     10166            G2frame.bottomSizer.Add(ResrbSizer(rbObj,resId))
    1014910167            mainSizer.Add(G2frame.bottomSizer)
    1015010168            G2plt.PlotStructure(G2frame,data)
     
    1015810176            for RBObj in data['RBModels']['Vector']:
    1015910177                RBnames.append(RBObj['RBname'])
    10160             if vecId is None:
     10178            if prevVecId is not None:
     10179                vecId = prevVecId
     10180            try:
     10181                rbName = RBnames[vecId]
     10182            except TypeError:
    1016110183                vecId = 0
    10162             rbName = RBnames[vecId]
     10184                rbName = RBnames[vecId]
    1016310185            rbObj = data['RBModels']['Vector'][vecId]
    1016410186            data['Drawing']['viewPoint'][0] = rbObj['Orig'][0]
Note: See TracChangeset for help on using the changeset viewer.