Changeset 1763 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Mar 25, 2015 5:25:15 PM (8 years ago)
Author:
vondreele
Message:

new item in imgGUI - Flat Bkg; subtracted from image on display & integration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r1761 r1763  
    33463346        Page.canvas.SetToolTipString('')
    33473347        sizexy = Data['size']
     3348        FlatBkg = Data.get('Flat Bkg',0.)
    33483349        if event.xdata and event.ydata and len(G2frame.ImageZ):                 #avoid out of frame errors
    33493350            Page.canvas.SetToolTipString('%8.2f %8.2fmm'%(event.xdata,event.ydata))
     
    33723373                Int = 0
    33733374                if (0 <= xpix <= sizexy[0]) and (0 <= ypix <= sizexy[1]):
    3374                     Int = G2frame.ImageZ[ypix][xpix]
     3375                    Int = G2frame.ImageZ[ypix][xpix]-int(FlatBkg)
    33753376                tth,azm,D,dsp = G2img.GetTthAzmDsp(xpos,ypos,Data)
    33763377                Q = 2.*math.pi/dsp
     
    34473448            return
    34483449        pixelSize = Data['pixelSize']
     3450        FlatBkg = Data.get('Flat Bkg',0.)
    34493451        scalex = 1000./pixelSize[0]
    34503452        scaley = 1000./pixelSize[1]
     
    34603462                    Xpix = Xpos*scalex
    34613463                    Ypix = Ypos*scaley
    3462                     xpos,ypos,I,J = G2img.ImageLocalMax(G2frame.ImageZ,pixLimit,Xpix,Ypix)
     3464                    xpos,ypos,I,J = G2img.ImageLocalMax(G2frame.ImageZ-FlatBkg,pixLimit,Xpix,Ypix)
    34633465                    if I and J:
    34643466                        xpos += .5                              #shift to pixel center
     
    35253527            StrSta['d-zero'].append({'Dset':dsp,'Dcalc':0.0,'pixLimit':10,'cutoff':0.5,
    35263528                'ImxyObs':[[],[]],'ImtaObs':[[],[]],'ImtaCalc':[[],[]],'Emat':[1.0,1.0,1.0]})
    3527             R,r = G2img.MakeStrStaRing(StrSta['d-zero'][-1],G2frame.ImageZ,Data)
     3529            R,r = G2img.MakeStrStaRing(StrSta['d-zero'][-1],G2frame.ImageZ-FlatBkg,Data)
    35283530            if not len(R):
    35293531                del StrSta['d-zero'][-1]
     
    37083710    #do threshold mask - "real" mask - others are just bondaries
    37093711    Zlim = Masks['Thresholds'][1]
     3712    FlatBkg = Data.get('Flat Bkg',0.0)
    37103713    wx.BeginBusyCursor()
    37113714    try:
     
    37153718            MA = ma.masked_greater(ma.masked_less(G2frame.ImageZ,Zlim[0]),Zlim[1])
    37163719            MaskA = ma.getmaskarray(MA)
    3717             A = G2img.ImageCompress(MA,imScale)
     3720            A = G2img.ImageCompress(MA,imScale)-FlatBkg
    37183721            AM = G2img.ImageCompress(MaskA,imScale)
    37193722            if G2frame.logPlot:
Note: See TracChangeset for help on using the changeset viewer.