Changeset 2135 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Jan 22, 2016 2:38:54 PM (7 years ago)
Author:
vondreele
Message:

more fixes to peak exports to get correct FWHM
refactor Merge GUI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r2132 r2135  
    771771        for i,ref in enumerate(hklRef):
    772772            h,k,l = ref[:3]
    773             X,Y,Z = gluProject(h,k,l,Model,Proj,View)
    774             XY = [int(X),int(Y)]
    775             if np.allclose(xy,XY,atol=10) and Z < Zmax:
    776                 Zmax = Z
     773            try:
     774                X,Y,Z = gluProject(h,k,l,Model,Proj,View)
     775                XY = [int(X),int(Y)]
     776                if np.allclose(xy,XY,atol=10) and Z < Zmax:
     777                    Zmax = Z
     778                    return [int(h),int(k),int(l)]
     779            except ValueError:
    777780                return [int(h),int(k),int(l)]
     781               
    778782                       
    779783    def SetTranslation(newxy):
     
    905909        glDisable(GL_COLOR_MATERIAL)
    906910       
    907     def RenderUnitVectors(x,y,z):
     911    def RenderUnitVectors(x,y,z,labxyz=['','','']):
    908912        xyz = np.array([x,y,z])
    909913        glEnable(GL_COLOR_MATERIAL)
     
    918922            glVertex3fv(line[1])
    919923        glEnd()
     924        glRotate(180,1,0,0)             #fix to flip about x-axis
     925        for ix,txt in enumerate(labxyz):
     926            if txt:
     927                pos = uEdges[ix][1]
     928                glTranslate(pos[0],-1.5*pos[1],-pos[2])
     929                text = gltext.TextElement(text=txt,font=Font)
     930                text.draw_text(scale=0.05)
     931                glTranslate(-pos[0],1.5*pos[1],pos[2])
    920932        glPopMatrix()
    921933        glColor4ubv([0,0,0,0])
     
    984996        else:
    985997            RenderUnitVectors(x,y,z)
    986         RenderUnitVectors(0,0,0)
     998        RenderUnitVectors(0,0,0,labxyz=['h','k','l'])
    987999        RenderDots(HKL,RC)
    9881000        time0 = time.time()
Note: See TracChangeset for help on using the changeset viewer.