Changeset 4735 for trunk


Ignore:
Timestamp:
Jan 7, 2021 11:21:15 AM (2 years ago)
Author:
vondreele
Message:

reduce printed precision of bon valence sum from 3 to 2.
connect +/- keys to z-step in structure plots; can be repeated. Updates view point & status line.
correct status line for n/p atom selection on structure plots; now correctly follows atom selection.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r4720 r4735  
    81678167        return Bonds
    81688168   
     8169    def SetCursorStatus(newxy,contours=False):
     8170        View = GL.glGetIntegerv(GL.GL_VIEWPORT)
     8171        Tx,Ty,Tz = drawingData['viewPoint'][0]
     8172        tx,ty,tz = GLU.gluProject(Tx,Ty,Tz)
     8173        Cx,Cy,Cz = GLU.gluUnProject(newxy[0],View[3]-newxy[1],tz)
     8174        rho = G2mth.getRho([Cx,Cy,Cz],mapData)
     8175        if contours:
     8176            contlevels = contourSet.get_array()
     8177            contstr = str(contlevels).strip('[]')
     8178            G2frame.G2plotNB.status.SetStatusText('Cursor position: %.4f, %.4f, %.4f; density: %.4f, contours at: %s'%(Cx,Cy,Cz,rho,contstr),1)
     8179        else:
     8180            G2frame.G2plotNB.status.SetStatusText('Cursor position: %.4f, %.4f, %.4f; density: %.4f'%(Cx,Cy,Cz,rho),1)
     8181   
    81698182    def OnKeyBox(event):
    81708183        mode = cb.GetValue()
     
    82658278            drawingData['viewPoint'] = [np.array([Tx,Ty,Tz]),pI]
    82668279            SetViewPointText(drawingData['viewPoint'][0])
    8267             if ct: G2frame.G2plotNB.status.SetStatusText('View point at atom '+atoms[pI[0]][ct-1]+txt,1)
     8280            if ct: G2frame.G2plotNB.status.SetStatusText('View point at atom '+atoms[pI[1]][ct-1]+txt,1)
    82688281            NPkey = True
    82698282           
     
    83908403                    Draw('key down')                   
    83918404                else:
    8392                     pass
     8405                    if key in ['=','-']:    #meaning '+','-'
     8406                        if key == '=':      #'+'
     8407                            Zstep = drawingData['Zstep']
     8408                        else:
     8409                            Zstep = -drawingData['Zstep']
     8410                        VP = np.inner(Amat,np.array(drawingData['viewPoint'][0]))
     8411                        VD = np.inner(Amat,np.array(drawingData['viewDir']))
     8412                        VD /= np.sqrt(np.sum(VD**2))
     8413                        VP += Zstep*VD
     8414                        VP = np.inner(Bmat,VP)
     8415                        drawingData['viewPoint'][0] = VP
     8416                        SetViewPointText(VP)                           
     8417                        Draw('key down')
     8418                        newxy = event.GetPosition()
     8419                        SetCursorStatus(newxy,drawingData.get('showSlice',False) in [1,3])                       
    83938420           
    83948421    def GetTruePosition(xy,Add=False):
     
    84948521                Draw('move')
    84958522        elif drawingData.get('showSlice',False):
    8496             View = GL.glGetIntegerv(GL.GL_VIEWPORT)
    8497             Tx,Ty,Tz = drawingData['viewPoint'][0]
    8498             tx,ty,tz = GLU.gluProject(Tx,Ty,Tz)
    8499             Cx,Cy,Cz = GLU.gluUnProject(newxy[0],View[3]-newxy[1],tz)
    8500             rho = G2mth.getRho([Cx,Cy,Cz],mapData)
    8501             if drawingData.get('showSlice',False) in [1,3]:
    8502                 contlevels = contourSet.get_array()
    8503                 contstr = str(contlevels).strip('[]')
    8504                 G2frame.G2plotNB.status.SetStatusText('Cursor position: %.4f, %.4f, %.4f; density: %.4f, contours at: %s'%(Cx,Cy,Cz,rho,contstr),1)
    8505             else:
    8506                 G2frame.G2plotNB.status.SetStatusText('Cursor position: %.4f, %.4f, %.4f; density: %.4f'%(Cx,Cy,Cz,rho),1)
     8523            SetCursorStatus(newxy,drawingData.get('showSlice',False) in [1,3])
    85078524       
    85088525    def OnMouseWheel(event):
     
    91899206    def distances2Atoms(x,y,z,atomsExpandRadius,atomsdistRadius,Amat,matRot):
    91909207        # find and display atoms within atomsExpandRadius A
     9208        vdWRadii = generalData['vdWRadii']
    91919209        vdwScale = drawingData['vdwScale']
    91929210        ballScale = drawingData['ballScale']
     
    96909708    choice = [' save as/key:','jpeg','tiff','bmp','c: center on 1/2,1/2,1/2']
    96919709    if mapData['MapType']:
    9692         choice += ['k: contour plot switch',]
    9693         choice += ['s: map slice colors',]
     9710        choice += ['k: contour plot switch','s: map slice colors',]
    96949711    if mapData.get('Flip',False):
    96959712        choice += ['u: roll up','d: roll down','l: roll left','r: roll right']
     
    96989715    if generalData['Modulated'] and len(drawAtoms):
    96999716        choice += ['+: increase tau','-: decrease tau','0: set tau = 0']
     9717    else:
     9718        choice += ['+: pos z-step','-: neg z-step',]
    97009719
    97019720    Tx,Ty,Tz = drawingData['viewPoint'][0]
  • trunk/GSASIIstrMain.py

    r4723 r4735  
    10551055            MyPrint(80*'*')
    10561056            for BV in BVox:
    1057                 pvline += ' %s: %.3f  '%(BV,BVS[BV])
     1057                pvline += ' %s: %.2f  '%(BV,BVS[BV])
    10581058            MyPrint(pvline)
    10591059
Note: See TracChangeset for help on using the changeset viewer.