Changeset 85 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Jun 11, 2010 1:37:21 PM (12 years ago)
Author:
vondreel
Message:

threshold masks operational
add index peak list load/reload menu & remove delete key method
plotting of threshold masks
remove "U" in image open command; implement reading of MAR CCD tif images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r82 r85  
    288288                LimitId = G2gd.GetPatternTreeItemId(self,self.PatternId, 'Limits')
    289289                data = self.PatternTree.GetItemPyData(LimitId)
    290                 print 'limits',xpos
     290#                print 'limits',xpos
    291291                data[1][lineNo] = xpos
    292292                self.PatternTree.SetItemPyData(LimitId,data)
     
    296296                PeakId = G2gd.GetPatternTreeItemId(self,self.PatternId, 'Peak List')
    297297                data = self.PatternTree.GetItemPyData(PeakId)
    298                 print 'peaks',xpos
     298#                print 'peaks',xpos
    299299                data[lineNo-2][0] = xpos
    300300                self.PatternTree.SetItemPyData(PeakId,data)
     
    563563def PlotImage(self,newPlot=False):
    564564    from matplotlib.patches import Ellipse,Arc
     565    import numpy.ma as ma
    565566
    566567    def OnImMotion(event):
     
    593594                xpix = xpos*scalex
    594595                ypix = ypos*scaley
     596                Int = 0
    595597                if (0 <= xpix <= size) and (0 <= ypix <= size):
    596                     Page.canvas.SetToolTipString('%6d'%(self.ImageZ[ypix][xpix]))
     598                    Int = self.ImageZ[ypix][xpix]
     599#                    Page.canvas.SetToolTipString('%4x'%((ypix*2048+xpix)*2+4096))
    597600                tth,azm,dsp = G2img.GetTthAzmDsp(xpos,ypos,Data)
    598601                Q = 2.*math.pi/dsp
    599602                self.G2plotNB.status.SetFields(\
    600                     ['Detector 2-th =%9.2fdeg, dsp =%9.3fA, Q = %6.3fA-1, azm = %7.2fdeg'%(tth,dsp,Q,azm),''])
     603                    ['Detector 2-th =%9.2fdeg, dsp =%9.3fA, Q = %6.3fA-1, azm = %7.2fdeg, I = %6d'%(tth,dsp,Q,azm,Int),''])
    601604
    602605    def OnImPlotKeyPress(event):
     
    706709    Data = self.PatternTree.GetItemPyData(
    707710        G2gd.GetPatternTreeItemId(self,self.Image, 'Image Controls'))
    708     try:
    709         Masks = self.PatternTree.GetItemPyData(
    710             G2gd.GetPatternTreeItemId(self,self.Image, 'Masks'))
    711     except TypeError:       #missing Masks
    712         Masks = {}
     711    Masks = self.PatternTree.GetItemPyData(
     712        G2gd.GetPatternTreeItemId(self,self.Image, 'Masks'))
    713713    imScale = 1
    714714    if len(self.ImageZ) > 1024:
     
    727727    Plot.set_ylabel('Image y-axis, mm',fontsize=12)
    728728    #need "applyMask" routine here
    729     A = G2img.ImageCompress(self.ImageZ,imScale)
     729    Zlim = Masks['Thresholds'][1]
     730    MA = ma.masked_greater(ma.masked_less(self.ImageZ,Zlim[0]),Zlim[1])
     731    MaskA = ma.getmaskarray(MA)
     732    A = G2img.ImageCompress(MA,imScale)
     733    AM = G2img.ImageCompress(MaskA,imScale)
     734   
     735    ImgM = Plot.imshow(AM,aspect='equal',cmap='Reds',
     736        interpolation='nearest',vmin=0,vmax=2,extent=[0,Xmax,Xmax,0])
    730737    Img = Plot.imshow(A,aspect='equal',cmap=acolor,
    731738        interpolation='nearest',vmin=Imin,vmax=Imax,extent=[0,Xmax,Xmax,0])
Note: See TracChangeset for help on using the changeset viewer.