Changeset 2183 for trunk/GSASIIimgGUI.py


Ignore:
Timestamp:
Mar 24, 2016 9:58:40 AM (7 years ago)
Author:
vondreele
Message:

fix General - atomic wt. now updated on isotope change
add new Stacking fault option to make sequence of DIFFaX runs varying one variable - under development
fix problem in G2image & G2imageGUI where change in FlatBkg?, Background or Dark didn't change thresholds or image plot limits - these are now set to new image limits.
Some of these used tricky changes to sizer values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimgGUI.py

    r2179 r2183  
    814814    def BackSizer():
    815815       
     816        def ResetThresholds():
     817            Imin = max(0.,np.min(G2frame.ImageZ))
     818            Imax = np.max(G2frame.ImageZ)
     819            data['range'] = [(Imin,Imax),[Imin,Imax]]
     820            masks['Thresholds'] = [(Imin,Imax),[Imin,Imax]]
     821            MaxSizer.GetChildren()[2].Window.SetValue(str(int(Imax)))   #tricky
     822            MaxSizer.GetChildren()[5].Window.SetValue(str(int(Imin)))   #tricky
     823       
    816824        def OnBackImage(event):
    817825            data['background image'][0] = backImage.GetValue()
    818826            G2frame.ImageZ = GetImageZ(G2frame,data)
     827            ResetThresholds()
    819828            G2plt.PlotExposedImage(G2frame,event=event)
    820829           
     
    822831            data['dark image'][0] = darkImage.GetValue()
    823832            G2frame.ImageZ = GetImageZ(G2frame,data)
     833            ResetThresholds()
    824834            G2plt.PlotExposedImage(G2frame,event=event)
    825835           
     
    833843            flatbkg.SetValue("%.0f"%(data['Flat Bkg']))   
    834844            G2frame.ImageZ += (oldFlat-data['Flat Bkg'])
     845            ResetThresholds()
    835846            G2plt.PlotExposedImage(G2frame,event=event)
    836847
     
    843854            backMult.SetValue("%.3f" % (data['background image'][1]))          #reset in case of error
    844855            G2frame.ImageZ = GetImageZ(G2frame,data)
     856            ResetThresholds()
    845857            G2plt.PlotExposedImage(G2frame,event=event)
    846858       
     
    853865            darkMult.SetValue("%.3f" % (data['dark image'][1]))          #reset in case of error
    854866            G2frame.ImageZ = GetImageZ(G2frame,data)
     867            ResetThresholds()
    855868            G2plt.PlotExposedImage(G2frame,event=event)
    856869       
     
    11081121    mainSizer.Add((5,10),0)   
    11091122    mainSizer.Add(ComboSizer(),0,wx.ALIGN_LEFT)
    1110     mainSizer.Add((5,5),0)           
    1111     mainSizer.Add(MaxSizer(),0,wx.ALIGN_LEFT|wx.EXPAND)
     1123    mainSizer.Add((5,5),0)
     1124    MaxSizer = MaxSizer()               #keep this so it can be changed in BackSizer   
     1125    mainSizer.Add(MaxSizer,0,wx.ALIGN_LEFT|wx.EXPAND)
    11121126   
    11131127    mainSizer.Add((5,5),0)
Note: See TracChangeset for help on using the changeset viewer.