Changeset 4032 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Jun 19, 2019 4:13:00 PM (3 years ago)
Author:
vondreele
Message:

fix 'Resolution' in old gpx to 'GridStep?'
fix to bad logical operator in MakeFrameMask?
apply polarization pixel by pixel in integration; then put back on for azm=0 for powder diffraction
remove a wasted busycursor
add Xlines & Ylines to masks to mask whole row/columns of pixels (not quite complete)
make picktype = None for unknown picks ('?' causes crash)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r4021 r4032  
    65316531        Page.figure.suptitle('Left-click to create an arc mask',color='r',fontweight='bold')
    65326532        Page.canvas.draw()
     6533    elif G2frame.MaskKey == 'x':
     6534        new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('2D Powder Image','mpl',newImage=False)
     6535        Page.figure.suptitle('Left-click to create an x-line mask',color='r',fontweight='bold')
     6536        Page.canvas.draw()
     6537    elif G2frame.MaskKey == 'y':
     6538        new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('2D Powder Image','mpl',newImage=False)
     6539        Page.figure.suptitle('Left-click to create an y-line mask',color='r',fontweight='bold')
     6540        Page.canvas.draw()
    65336541    elif G2frame.MaskKey == 'r':
    65346542        new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('2D Powder Image','mpl',newImage=False)
     
    67466754                Page.canvas.draw()
    67476755                return
    6748             elif event.key in ['l','p','f','a','r']:
     6756            elif event.key in ['l','p','f','a','r','x','y']:
    67496757                G2frame.MaskKey = event.key
    67506758                OnStartMask(G2frame)
     
    69226930                pickType = pick.itemType
    69236931            except:
    6924                 pickType = '?'
     6932                pickType = None
    69256933            if pickType == "Spot":
    69266934                itemNum = G2frame.itemPicked.itemNumber
     
    70597067                pickType = pick.itemType
    70607068            except: # should not happen anymore
    7061                 pickType = '?'
     7069                pickType = None
    70627070            if pickType == 'Spot':
    70637071                pl = [pick,]
     
    71987206                wx.CallAfter(PlotImage,G2frame,newImage=True)
    71997207                return
    7200             elif G2frame.MaskKey =='p' or G2frame.MaskKey =='f':
     7208            elif G2frame.MaskKey in ['p','f']:
    72017209                if G2frame.MaskKey =='p':
    72027210                    polygon = Masks['Polygons'][-1]
     
    72327240                    #G2imG.UpdateMasks(G2frame,Masks)
    72337241                    return
     7242            elif G2frame.MaskKey in ['x','y']:
     7243                Xpix,Ypix = int(Xpos*scalex),int(Ypos*scaley)
     7244                if G2frame.MaskKey == 'y':
     7245                    Masks['Ylines'].append(Xpix)
     7246                else:
     7247                    Masks['Xlines'].append(Ypix)
     7248                G2imG.UpdateMasks(G2frame,Masks)
     7249                wx.CallAfter(PlotImage,G2frame,newImage=True)
     7250                return
    72347251            G2imG.UpdateMasks(G2frame,Masks)
    72357252            wx.CallAfter(PlotImage,G2frame,newImage=False)
     
    73787395        elif G2frame.GPXtree.GetItemText(G2frame.PickId) in ['Masks',]:
    73797396            Page.Choice = [' key press','a: arc mask','r: ring mask',
     7397                'x: x line mask','y: y line mask',
    73807398                'p: polygon mask','f: frame mask',
    73817399                't: add spot mask at mouse position',
     
    74147432            Imin,Imax = Data['range'][1]
    74157433            MA = ma.masked_greater(ma.masked_less(G2frame.ImageZ,Zlim[0]),Zlim[1])
     7434           
    74167435            MaskA = ma.getmaskarray(MA)
    74177436            A = G2img.ImageCompress(MA,imScale)
Note: See TracChangeset for help on using the changeset viewer.