Changeset 3366


Ignore:
Timestamp:
Apr 30, 2018 12:36:18 PM (5 years ago)
Author:
vondreele
Message:

add linescan for expanded plot region

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r3365 r3366  
    56005600    G2frame.cid = None
    56015601    #Dsp = lambda tth,wave: wave/(2.*npsind(tth/2.))
    5602     global Data,Masks,StrSta,Plot1  # RVD: these are needed for multiple image controls/masks
     5602    global Data,Masks,StrSta,Plot1,Page  # RVD: these are needed for multiple image controls/masks
    56035603    colors=['b','g','r','c','m','k']
    56045604    Data = G2frame.GPXtree.GetItemPyData(
     
    58375837                pick.set_data([[arcxI[-1],arcxO[-1]],[arcyI[-1],arcyO[-1]]])
    58385838            elif 'linescan' in itemPicked:
     5839                xlim = Plot1.get_xlim()
    58395840                azm = Data['linescan'][1]-AzmthOff
    58405841                dspI = wave/(2.0*sind(0.1/2.0))
     
    58525853                np.seterr(invalid=olderr['invalid'])
    58535854                Plot1.plot(xy[0],xy[1])
    5854                 Plot1.set_xlim(Data['IOtth'])
     5855                Plot1.set_xlim(xlim)
    58555856                Plot1.set_xscale("linear")                                                 
    58565857                Plot1.set_title('Line scan at azm= %6.1f'%(azm+AzmthOff))
     
    60336034        '''Called when the mouse is released inside an image plot window
    60346035        '''
     6036        global Page
    60356037        try:
    60366038            treeItem = G2frame.GPXtree.GetItemText(G2frame.PickId)
    60376039        except TypeError:
    60386040            return
     6041        if Data['linescan']:
     6042            Page.xlim1 = Plot1.get_xlim()
    60396043        new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('2D Powder Image','mpl',newImage=False)
    60406044        if G2frame.cid is not None:         # if there is a drag connection, delete it
     
    63026306        np.seterr(invalid=olderr['invalid'])
    63036307        Plot1.plot(xy[0],xy[1])
    6304         Plot1.set_xlim(Data['IOtth'])
    6305         Plot1.set_xscale("linear")                                                 
    63066308    if newImage:
    63076309        G2frame.MaskKey = '' # subtitle will be removed, so turn off mode
     
    64136415                ind = np.searchsorted(Azm,cake)
    64146416                Plot.plot([arcxI[ind],arcxO[ind]],[arcyI[ind],arcyO[ind]],color='k',dashes=(5,5))
    6415         if 'linescan' in Data and Data['linescan'][0]:
     6417        if 'linescan' in Data and Data['linescan'][0] and G2frame.GPXtree.GetItemText(G2frame.PickId) in ['Image Controls',]:
    64166418            azm = Data['linescan'][1]-Data['azmthOff']
    64176419            IOtth = [0.1,60.]
     
    65196521        Plot.set_xlim(xlim)
    65206522        Plot.set_ylim(ylim)
     6523        if Data.get('linescan',[False,0.])[0]:
     6524            Plot1.set_xlim(Data['IOtth'])
    65216525        if Data['invert_x']:
    65226526            Plot.invert_xaxis()
     
    65276531            Plot.set_xlim(xylim[0])
    65286532            Plot.set_ylim(xylim[1])
     6533            if Data['linescan']:
     6534                try:
     6535                    Plot1.set_xlim(Page.xlim1)
     6536                except:
     6537                    pass
    65296538            xylim = []
    65306539            Page.toolbar.push_current()
Note: See TracChangeset for help on using the changeset viewer.