Changeset 3362


Ignore:
Timestamp:
Apr 27, 2018 4:23:53 PM (5 years ago)
Author:
vondreele
Message:

fix azimuth offset problems with linescan
add sqrt & log (scanline) options

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r3358 r3362  
    475475    numChans = data['outChannels']
    476476    LUtth = np.array(data['IOtth'],dtype=np.float)
    477     azm = data['linescan'][1]
     477    azm = data['linescan'][1]-data['azmthOff']
    478478    Tx = np.array([tth for tth in np.linspace(LUtth[0],LUtth[1],numChans+1)])
    479479    Ty = np.zeros_like(Tx)
     
    489489    Ty = image[xpix,ypix]
    490490    Tx = ma.array(Tx,mask=Xpix.mask+Ypix.mask).compressed()
    491     return Tx,Ty
     491    return [Tx,Ty]
    492492
    493493def EdgeFinder(image,data):
  • trunk/GSASIIplot.py

    r3361 r3362  
    57555755            elif event.key in ['y',]:
    57565756                Data['invert_y'] = not Data['invert_y']
     5757            elif event.key in ['s',] and Data['linescan'][0]:
     5758                G2frame.logPlot = False
     5759                G2frame.plotStyle['sqrtPlot'] = not G2frame.plotStyle['sqrtPlot']
     5760            elif event.key in ['n',] and Data['linescan'][0]:
     5761                G2frame.plotStyle['sqrtPlot'] = False
     5762                G2frame.logPlot = not G2frame.logPlot
    57575763            else:
    57585764                return
     
    58355841                xy = G2img.GetLineScan(G2frame.ImageZ,Data)
    58365842                Plot1.cla()
     5843                if G2frame.logPlot:
     5844                    xy[1] = np.log(xy[1])
     5845                elif G2frame.plotStyle['sqrtPlot']:
     5846                    xy[1] = np.sqrt(xy[1])
    58375847                Plot1.plot(xy[0],xy[1])
    58385848                Plot1.set_xlim(Data['IOtth'])
     
    62776287        Plot1.set_ylabel('Intensity',fontsize=12)
    62786288        xy = G2img.GetLineScan(G2frame.ImageZ,Data)
     6289        if G2frame.logPlot:
     6290            xy[1] = np.log(xy[1])
     6291            Plot1.set_ylabel('log(Intensity)',fontsize=12)
     6292        elif G2frame.plotStyle['sqrtPlot']:
     6293            Plot1.set_ylabel(r'$\sqrt{Intensity}$',fontsize=12)
     6294            xy[1] = np.sqrt(xy[1])
    62796295        Plot1.plot(xy[0],xy[1])
    62806296        Plot1.set_xlim(Data['IOtth'])
     
    62976313    try:
    62986314        if G2frame.GPXtree.GetItemText(G2frame.PickId) in ['Image Controls',]:
    6299             Page.Choice = (' key press','c: set beam center','d: set dmin','x: flip x','y: flip y',)
    6300 #            if G2frame.logPlot:
    6301 #                Page.Choice[1] = 'l: log(I) off'
     6315            Page.Choice = [' key press','c: set beam center','d: set dmin','x: flip x','y: flip y',]
     6316            if Data.get('linescan',[False,0.])[0]:
     6317                Page.Choice += ['s: toggle sqrt plot line scan','n: toggle log plot line scan']
    63026318            Page.keyPress = OnImPlotKeyPress
    63036319        elif G2frame.GPXtree.GetItemText(G2frame.PickId) in ['Masks',]:
     
    63906406                Plot.plot([arcxI[ind],arcxO[ind]],[arcyI[ind],arcyO[ind]],color='k',dashes=(5,5))
    63916407        if 'linescan' in Data and Data['linescan'][0]:
    6392             azm = Data['linescan'][1]
     6408            azm = Data['linescan'][1]-Data['azmthOff']
    63936409            IOtth = [0.1,60.]
    63946410            wave = Data['wavelength']
Note: See TracChangeset for help on using the changeset viewer.