Changeset 134


Ignore:
Timestamp:
Jul 27, 2010 6:01:58 PM (11 years ago)
Author:
vondreel
Message:

modify image intensity sliders

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimgGUI.py

    r124 r134  
    3434       
    3535    def OnMaxSlider(event):
    36         logDeltZero = math.sqrt(data['range'][0][1]-data['range'][0][0])
    37         imax = int(maxSel.GetValue())*logDeltZero/100.
     36        sqrtDeltZero = math.sqrt(data['range'][0][1]-data['range'][0][0])
     37        imax = int(maxSel.GetValue())*sqrtDeltZero/100.
    3838        data['range'][1][1] = imax**2+data['range'][0][0]
    3939        data['range'][1][0] = min(data['range'][1][1]-1,data['range'][1][0])
     40        DeltOne = data['range'][1][1]-data['range'][0][0]
     41        minSel.SetValue(int(100*(data['range'][1][0]-data['range'][0][0])/DeltOne))
    4042        G2plt.PlotExposedImage(self,event=event)
    4143       
     
    4345        DeltOne = data['range'][1][1]-data['range'][0][0]
    4446        imin = int(minSel.GetValue())*DeltOne/100.
    45         data['range'][1][0] = min(data['range'][1][1]-1,imin+data['range'][0][0])
     47        data['range'][1][0] = min(data['range'][1][1]-1,imin)+data['range'][0][0]
    4648        G2plt.PlotExposedImage(self,event=event)
    4749       
     
    212214                                    G2gd.GetPatternTreeItemId(self,self.Image, 'Masks'),Masks)                               
    213215                            self.Integrate = G2img.ImageIntegrate(image,Data,Masks)
    214                             G2plt.PlotIntegration(self,newPlot=True,event=event)
     216#                            G2plt.PlotIntegration(self,newPlot=True,event=event)
    215217                            self.dataFrame.ImageEdit.Enable(id=G2gd.wxID_SAVEINTG,enable=True)
    216218                            G2IO.SaveIntegration(self,Id,Data)
     
    283285    maxSizer = wx.FlexGridSizer(2,2,0,5)
    284286    maxSizer.AddGrowableCol(1,1)
    285     logDeltZero = math.log(data['range'][0][1]-data['range'][0][0])
     287    sqrtDeltZero = math.sqrt(data['range'][0][1]-data['range'][0][0])
    286288    DeltOne = data['range'][1][1]-data['range'][0][0]
    287     logDeltOne = math.sqrt(DeltOne)
     289    sqrtDeltOne = math.sqrt(DeltOne)
    288290    maxSizer.Add(wx.StaticText(parent=self.dataDisplay,label=' Max intensity'),0,
    289291        wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)
    290292    maxSel = wx.Slider(parent=self.dataDisplay,style=wx.SL_HORIZONTAL,
    291         value=int(100*logDeltOne/logDeltZero))
     293        value=int(100*sqrtDeltOne/sqrtDeltZero))
    292294    maxSizer.Add(maxSel,1,wx.EXPAND|wx.RIGHT)
    293295    maxSel.Bind(wx.EVT_SLIDER, OnMaxSlider)   
     
    295297        wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)
    296298    minSel = wx.Slider(parent=self.dataDisplay,style=wx.SL_HORIZONTAL,
    297         value=int(100*data['range'][1][0]/DeltOne))
     299        value=int(100*(data['range'][1][0]-data['range'][0][0])/DeltOne))
    298300    maxSizer.Add(minSel,1,wx.EXPAND|wx.RIGHT)
    299301    minSel.Bind(wx.EVT_SLIDER, OnMinSlider)
Note: See TracChangeset for help on using the changeset viewer.