Changeset 367a31c in sasview for src/sas/sasgui


Ignore:
Timestamp:
Aug 17, 2017 10:15:57 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
6300dfe
Parents:
140159c (diff), a06ee7e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ticket-869

Location:
src/sas/sasgui
Files:
1 added
1 deleted
11 edited
1 moved

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py

    r7432acb r3e5648b  
    361361                if self.slicer.__class__.__name__ != "BoxSum": 
    362362                    wx_id = ids.next() 
    363                     slicerpop.Append(wx_id, '&Edit Slicer Parameters') 
     363                    name = '&Edit Slicer Parameters and Batch Slicing' 
     364                    slicerpop.Append(wx_id, name) 
    364365                    wx.EVT_MENU(self, wx_id, self._onEditSlicer) 
    365366            slicerpop.AppendSeparator() 
     
    532533 
    533534        """ 
    534         ## Clear current slicer 
     535        # Clear current slicer 
    535536        if self.slicer is not None: 
    536537            self.slicer.clear() 
    537         ## Create a new slicer 
     538        # Create a new slicer 
    538539        self.slicer_z += 1 
    539540        self.slicer = slicer(self, self.subplot, zorder=self.slicer_z) 
    540541        self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax) 
    541542        self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax) 
    542         ## Draw slicer 
     543        # Draw slicer 
    543544        self.update() 
    544545        self.slicer.update() 
     
    572573        npt = math.floor(npt) 
    573574        from sas.sascalc.dataloader.manipulations import CircularAverage 
    574         ## compute the maximum radius of data2D 
     575        # compute the maximum radius of data2D 
    575576        self.qmax = max(math.fabs(self.data2D.xmax), 
    576577                        math.fabs(self.data2D.xmin)) 
     
    578579                        math.fabs(self.data2D.ymin)) 
    579580        self.radius = math.sqrt(math.pow(self.qmax, 2) + math.pow(self.ymax, 2)) 
    580         ##Compute beam width 
     581        # Compute beam width 
    581582        bin_width = (self.qmax + self.qmax) / npt 
    582         ## Create data1D circular average of data2D 
     583        # Create data1D circular average of data2D 
    583584        Circle = CircularAverage(r_min=0, r_max=self.radius, 
    584585                                 bin_width=bin_width) 
     
    599600        new_plot.name = "Circ avg " + self.data2D.name 
    600601        new_plot.source = self.data2D.source 
    601         #new_plot.info = self.data2D.info 
     602        # new_plot.info = self.data2D.info 
    602603        new_plot.interactive = True 
    603604        new_plot.detector = self.data2D.detector 
    604605 
    605         ## If the data file does not tell us what the axes are, just assume... 
     606        # If the data file does not tell us what the axes are, just assume... 
    606607        new_plot.xaxis("\\rm{Q}", "A^{-1}") 
    607608        if hasattr(self.data2D, "scale") and \ 
     
    615616        new_plot.id = "Circ avg " + self.data2D.name 
    616617        new_plot.is_data = True 
    617         self.parent.update_theory(data_id=self.data2D.id, \ 
    618                                        theory=new_plot) 
     618        self.parent.update_theory(data_id=self.data2D.id, theory=new_plot) 
    619619        wx.PostEvent(self.parent, 
    620620                     NewPlotEvent(plot=new_plot, title=new_plot.name)) 
     
    630630        """ 
    631631        if self.slicer is not None: 
    632             from SlicerParameters import SlicerParameterPanel 
     632            from parameters_panel_slicer import SlicerParameterPanel 
    633633            dialog = SlicerParameterPanel(self, -1, "Slicer Parameters") 
    634634            dialog.set_slicer(self.slicer.__class__.__name__, 
     
    668668        params = self.slicer.get_params() 
    669669        ## Create a new panel to display results of summation of Data2D 
    670         from slicerpanel import SlicerPanel 
     670        from parameters_panel_boxsum import SlicerPanel 
    671671        win = MDIFrame(self.parent, None, 'None', (100, 200)) 
    672672        new_panel = SlicerPanel(parent=win, id=-1, 
     
    758758        if default_name.count('.') > 0: 
    759759            default_name = default_name.split('.')[0] 
    760         #default_name += "_out" 
    761760        if self.parent is not None: 
    762761            self.parent.show_data2d(data, default_name) 
    763762 
    764763    def modifyGraphAppearance(self, e): 
    765         self.graphApp = graphAppearance(self, 'Modify graph appearance', legend=False) 
     764        self.graphApp = graphAppearance(self, 'Modify graph appearance', 
     765                                        legend=False) 
    766766        self.graphApp.setDefaults(self.grid_on, self.legend_on, 
    767767                                  self.xaxis_label, self.yaxis_label, 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/SectorSlicer.py

    r7432acb r8de66b6  
    3737        ## Absolute value of the Angle between the middle line and any side line 
    3838        self.phi = math.pi / 12 
     39        # Binning base for log/lin binning 
     40        self.bin_base = 0 
    3941        ## Middle line 
    4042        self.main_line = LineInteractor(self, self.base.subplot, color='blue', 
     
    151153        phimin = -self.left_line.phi + self.main_line.theta 
    152154        phimax = self.left_line.phi + self.main_line.theta 
     155        bin_base = self.bin_base 
    153156        if nbins is None: 
    154157            nbins = 20 
    155158        sect = SectorQ(r_min=0.0, r_max=radius, 
    156159                       phi_min=phimin + math.pi, 
    157                        phi_max=phimax + math.pi, nbins=nbins) 
     160                       phi_max=phimax + math.pi, nbins=nbins, base=bin_base) 
    158161 
    159162        sector = sect(self.base.data2D) 
     
    239242        params["Delta_Phi [deg]"] = math.fabs(self.left_line.phi * 180 / math.pi) 
    240243        params["nbins"] = self.nbins 
     244        params["binning base"] = self.bin_base 
    241245        return params 
    242246 
     
    252256        phi = math.fabs(params["Delta_Phi [deg]"] * math.pi / 180) 
    253257        self.nbins = int(params["nbins"]) 
     258        self.bin_base = params["binning base"] 
    254259        self.main_line.theta = main 
    255260        ## Reset the slicer parameters 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_boxsum.py

    r7432acb r37d461c  
    11import wx 
    22import wx.lib.newevent 
    3 #from copy import deepcopy 
     3from parameters_panel_slicer import SlicerParameterPanel 
    44from sas.sasgui.guiframe.utils import format_number 
    5 from sas.sasgui.guiframe.events import SlicerParameterEvent 
    6 from sas.sasgui.guiframe.events import EVT_SLICER_PARS 
    7 from sas.sasgui.guiframe.events import EVT_SLICER 
     5from sas.sasgui.guiframe.panel_base import PanelBase 
     6from sas.sasgui.guiframe.events import (SlicerParameterEvent, EVT_SLICER_PARS, 
     7                                        EVT_SLICER) 
    88 
    9 from sas.sasgui.guiframe.panel_base import PanelBase 
    109 
    1110class SlicerPanel(wx.Panel, PanelBase): 
     
    1312    Panel class to show the slicer parameters 
    1413    """ 
    15     #TODO: show units 
    16     #TODO: order parameters properly 
    17     ## Internal name for the AUI manager 
     14    # Internal name for the AUI manager 
    1815    window_name = "Slicer panel" 
    19     ## Title to appear on top of the window 
     16    # Title to appear on top of the window 
    2017    window_caption = "Slicer Panel" 
    2118    CENTER_PANE = False 
     
    2522        wx.Panel.__init__(self, parent, id, *args, **kwargs) 
    2623        PanelBase.__init__(self) 
    27         ## Initialization of the class 
     24        # Initialization of the class 
    2825        self.base = base 
    2926        if params is None: 
     
    4441        else: 
    4542            self.set_slicer(type, params) 
    46         ## Bindings 
    47         self.parent.Bind(EVT_SLICER, self.onEVT_SLICER) 
    48         self.parent.Bind(EVT_SLICER_PARS, self.onParamChange) 
    49  
    50     def onEVT_SLICER(self, event): 
    51         """ 
    52         Process EVT_SLICER events 
    53         When the slicer changes, update the panel 
    54  
    55         :param event: EVT_SLICER event 
    56  
    57         """ 
    58         event.Skip() 
    59         if event.obj_class is None: 
    60             self.set_slicer(None, None) 
    61         else: 
    62             self.set_slicer(event.type, event.params) 
     43        # Bindings 
     44        self.parent.Bind(EVT_SLICER, SlicerParameterPanel.on_evt_slicer) 
     45        self.parent.Bind(EVT_SLICER_PARS, SlicerParameterPanel.on_param_change) 
    6346 
    6447    def set_slicer(self, type, params): 
     
    8467            keys.sort() 
    8568            for item in keys: 
    86                 if not item.lower() in ["num_points", "avg", "avg_error", "sum", "sum_error"]: 
     69                if not item.lower() in ["num_points", "avg", "avg_error", "sum", 
     70                                        "sum_error"]: 
    8771                    n += 1 
    8872                    text = wx.StaticText(self, -1, item, style=wx.ALIGN_LEFT) 
    8973                    self.bck.Add(text, (n - 1, 0), 
    90                                  flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15) 
     74                                 flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 
     75                                 border=15) 
    9176                    ctl = wx.TextCtrl(self, -1, size=(80, 20), 
    9277                                      style=wx.TE_PROCESS_ENTER) 
     
    9580                    ctl.SetToolTipString(hint_msg) 
    9681                    ctl.SetValue(str(format_number(params[item]))) 
    97                     self.Bind(wx.EVT_TEXT_ENTER, self.onTextEnter) 
    98                     ctl.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 
    99                     ctl.Bind(wx.EVT_KILL_FOCUS, self.onTextEnter) 
     82                    self.Bind(wx.EVT_TEXT_ENTER, self.on_text_enter) 
     83                    ctl.Bind(wx.EVT_SET_FOCUS, self.on_set_focus) 
     84                    ctl.Bind(wx.EVT_KILL_FOCUS, self.on_text_enter) 
    10085                    self.parameters.append([item, ctl]) 
    101                     self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, border=0) 
     86                    self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, 
     87                                 border=0) 
    10288            for item in keys: 
    103                 if  item.lower() in ["num_points", "avg", "avg_error", "sum", "sum_error"]: 
     89                if item.lower() in ["num_points", "avg", "avg_error", "sum", 
     90                                    "sum_error"]: 
    10491                    n += 1 
    105                     text = wx.StaticText(self, -1, item + ": ", style=wx.ALIGN_LEFT) 
    106                     self.bck.Add(text, (n - 1, 0), flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 
     92                    text = wx.StaticText(self, -1, item + ": ", 
     93                                         style=wx.ALIGN_LEFT) 
     94                    self.bck.Add(text, (n - 1, 0), 
     95                                 flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 
    10796                                 border=15) 
    10897                    ctl = wx.StaticText(self, -1, 
     
    11099                                        style=wx.ALIGN_LEFT) 
    111100                    ctl.SetToolTipString("Result %s" % item) 
    112                     self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, border=0) 
     101                    self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, 
     102                                 border=0) 
    113103        self.bck.Layout() 
    114104        self.Layout() 
    115         psizer = self.parent.GetSizer() 
    116         if psizer is not None: 
    117             psizer.Layout() 
     105        p_sizer = self.parent.GetSizer() 
     106        if p_sizer is not None: 
     107            p_sizer.Layout() 
    118108 
    119     def onSetFocus(self, evt): 
     109    def on_set_focus(self, evt): 
    120110        """ 
    121111        Highlight the txtcrtl 
     
    126116        # Select the whole control, after this event resolves 
    127117        wx.CallAfter(widget.SetSelection, -1, -1) 
    128         return 
    129118 
    130     def onParamChange(self, evt): 
    131         """ 
    132         Receive and event and reset the text field contained in self.parameters 
    133  
    134         """ 
    135         evt.Skip() 
    136         for item in self.parameters: 
    137             if item[0] in evt.params: 
    138                 item[1].SetValue(format_number(evt.params[item[0]])) 
    139                 item[1].Refresh() 
    140  
    141     def onTextEnter(self, evt): 
     119    def on_text_enter(self, evt): 
    142120        """ 
    143121        Parameters have changed 
     
    149127            try: 
    150128                params[item[0]] = float(item[1].GetValue()) 
    151                 item[1].SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)) 
     129                item[1].SetBackgroundColour(wx.SystemSettings_GetColour( 
     130                    wx.SYS_COLOUR_WINDOW)) 
    152131                item[1].Refresh() 
    153132            except: 
     
    155134                item[1].SetBackgroundColour("pink") 
    156135                item[1].Refresh() 
    157  
    158         if has_error == False: 
     136        if not has_error: 
    159137            # Post parameter event 
    160             ## base is guiframe is this case 
     138            # base is guiframe is this case 
    161139            event = SlicerParameterEvent(type=self.type, params=params) 
    162140            wx.PostEvent(self.base, event) 
     
    166144        On Close Event 
    167145        """ 
    168         ID = self.uid 
    169         self.parent.delete_panel(ID) 
     146        uid = self.uid 
     147        self.parent.delete_panel(uid) 
    170148        self.frame.Destroy() 
  • src/sas/sasgui/perspectives/calculator/model_editor.py

    ra1b8fee r07ec714  
    643643        self.name_hsizer = None 
    644644        self.name_tcl = None 
     645        self.overwrite_cb = None 
    645646        self.desc_sizer = None 
    646647        self.desc_tcl = None 
     
    657658        self.warning = "" 
    658659        #This does not seem to be used anywhere so commenting out for now 
    659         #    -- PDB 2/26/17  
     660        #    -- PDB 2/26/17 
    660661        #self._description = "New Plugin Model" 
    661662        self.function_tcl = None 
     
    689690        #title name [string] 
    690691        name_txt = wx.StaticText(self, -1, 'Function Name : ') 
    691         overwrite_cb = wx.CheckBox(self, -1, "Overwrite existing plugin model of this name?", (10, 10)) 
    692         overwrite_cb.SetValue(False) 
    693         overwrite_cb.SetToolTipString("Overwrite it if already exists?") 
    694         wx.EVT_CHECKBOX(self, overwrite_cb.GetId(), self.on_over_cb) 
     692        self.overwrite_cb = wx.CheckBox(self, -1, "Overwrite existing plugin model of this name?", (10, 10)) 
     693        self.overwrite_cb.SetValue(False) 
     694        self.overwrite_cb.SetToolTipString("Overwrite it if already exists?") 
     695        wx.EVT_CHECKBOX(self, self.overwrite_cb.GetId(), self.on_over_cb) 
    695696        self.name_tcl = wx.TextCtrl(self, -1, size=(PANEL_WIDTH * 3 / 5, -1)) 
    696697        self.name_tcl.Bind(wx.EVT_TEXT_ENTER, self.on_change_name) 
     
    700701        self.name_tcl.SetToolTipString(hint_name) 
    701702        self.name_hsizer.AddMany([(self.name_tcl, 0, wx.LEFT | wx.TOP, 0), 
    702                                   (overwrite_cb, 0, wx.LEFT, 20)]) 
     703                                  (self.overwrite_cb, 0, wx.LEFT, 20)]) 
    703704        self.name_sizer.AddMany([(name_txt, 0, wx.LEFT | wx.TOP, 10), 
    704705                                 (self.name_hsizer, 0, 
     
    740741        self.param_sizer.AddMany([(param_txt, 0, wx.LEFT, 10), 
    741742                                  (self.param_tcl, 1, wx.EXPAND | wx.ALL, 10)]) 
    742          
     743 
    743744        # Parameters with polydispersity 
    744745        pd_param_txt = wx.StaticText(self, -1, 'Fit Parameters requiring ' + \ 
     
    755756        self.pd_param_tcl.setDisplayLineNumbers(True) 
    756757        self.pd_param_tcl.SetToolTipString(pd_param_tip) 
    757          
     758 
    758759        self.param_sizer.AddMany([(pd_param_txt, 0, wx.LEFT, 10), 
    759760                                  (self.pd_param_tcl, 1, wx.EXPAND | wx.ALL, 10)]) 
     
    995996            info = 'Error' 
    996997            color = 'red' 
     998            self.overwrite_cb.SetValue(True) 
     999            self.overwrite_name = True 
    9971000        else: 
    9981001            self._notes = result 
     
    10301033        if has_scipy: 
    10311034            lines.insert(0, 'import scipy') 
    1032          
    1033         # Think about 2D later         
     1035 
     1036        # Think about 2D later 
    10341037        #self.is_2d = func_str.count("#self.ndim = 2") 
    10351038        #line_2d = '' 
    10361039        #if self.is_2d: 
    10371040        #    line_2d = CUSTOM_2D_TEMP.split('\n') 
    1038          
    1039         # Also think about test later         
     1041 
     1042        # Also think about test later 
    10401043        #line_test = TEST_TEMPLATE.split('\n') 
    10411044        #local_params = '' 
     
    10431046        spaces4  = ' '*4 
    10441047        spaces13 = ' '*13 
    1045         spaces16 = ' '*16      
     1048        spaces16 = ' '*16 
    10461049        param_names = []    # to store parameter names 
    10471050        has_scipy = func_str.count("scipy.") 
     
    10551058            out_f.write(line + '\n') 
    10561059            if line.count('#name'): 
    1057                 out_f.write('name = "%s" \n' % name)                
     1060                out_f.write('name = "%s" \n' % name) 
    10581061            elif line.count('#title'): 
    1059                 out_f.write('title = "User model for %s"\n' % name)                
     1062                out_f.write('title = "User model for %s"\n' % name) 
    10601063            elif line.count('#description'): 
    1061                 out_f.write('description = "%s"\n' % desc_str)                
     1064                out_f.write('description = "%s"\n' % desc_str) 
    10621065            elif line.count('#parameters'): 
    10631066                out_f.write('parameters = [ \n') 
     
    10651068                    p_line = param_line.lstrip().rstrip() 
    10661069                    if p_line: 
    1067                         pname, pvalue = self.get_param_helper(p_line) 
     1070                        pname, pvalue, desc = self.get_param_helper(p_line) 
    10681071                        param_names.append(pname) 
    1069                         out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], '', ''],\n" % (spaces16, pname, pvalue)) 
     1072                        out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], '', '%s'],\n" % (spaces16, pname, pvalue, desc)) 
    10701073                for param_line in pd_param_str.split('\n'): 
    10711074                    p_line = param_line.lstrip().rstrip() 
    10721075                    if p_line: 
    1073                         pname, pvalue = self.get_param_helper(p_line) 
     1076                        pname, pvalue, desc = self.get_param_helper(p_line) 
    10741077                        param_names.append(pname) 
    1075                         out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], 'volume', ''],\n" % (spaces16, pname, pvalue)) 
     1078                        out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], 'volume', '%s'],\n" % (spaces16, pname, pvalue, desc)) 
    10761079                out_f.write('%s]\n' % spaces13) 
    1077              
     1080 
    10781081        # No form_volume or ER available in simple model editor 
    10791082        out_f.write('def form_volume(*arg): \n') 
     
    10821085        out_f.write('def ER(*arg): \n') 
    10831086        out_f.write('    return 1.0 \n') 
    1084          
     1087 
    10851088        # function to compute 
    10861089        out_f.write('\n') 
     
    10911094        for func_line in func_str.split('\n'): 
    10921095            out_f.write('%s%s\n' % (spaces4, func_line)) 
    1093          
     1096 
    10941097        Iqxy_string = 'return Iq(numpy.sqrt(x**2+y**2) ' 
    1095              
     1098 
    10961099        out_f.write('\n') 
    10971100        out_f.write('def Iqxy(x, y ') 
     
    11131116        items = line.split(";") 
    11141117        for item in items: 
    1115             name = item.split("=")[0].lstrip().rstrip() 
     1118            name = item.split("=")[0].strip() 
     1119            description = "" 
    11161120            try: 
    1117                 value = item.split("=")[1].lstrip().rstrip() 
     1121                value = item.split("=")[1].strip() 
     1122                if value.count("#"): 
     1123                    # If line ends in a comment, remove it before parsing float 
     1124                    index = value.index("#") 
     1125                    description = value[(index + 1):].strip() 
     1126                    value = value[:value.index("#")].strip() 
    11181127                float(value) 
    1119             except: 
     1128            except ValueError: 
    11201129                value = 1.0 # default 
    11211130 
    1122         return name, value 
     1131        return name, value, description 
    11231132 
    11241133    def set_function_helper(self, line): 
     
    12041213import numpy 
    12051214 
    1206 #name  
     1215#name 
    12071216 
    12081217#title 
     
    12101219#description 
    12111220 
    1212 #parameters  
     1221#parameters 
    12131222 
    12141223""" 
  • src/sas/sasgui/perspectives/calculator/pyconsole.py

    r7432acb r4627657  
    3737    Iqxy = model.evalDistribution([qx, qy]) 
    3838 
    39     result = """ 
    40     Iq(%s) = %s 
    41     Iqxy(%s, %s) = %s 
    42     """%(q, Iq, qx, qy, Iqxy) 
     39    # check the model's unit tests run 
     40    from sasmodels.model_test import run_one 
     41    result = run_one(path) 
    4342 
    4443    return result 
     
    8988        ok = wx.Button(self, wx.ID_OK, "OK") 
    9089 
    91         # Mysterious constraint layouts from  
     90        # Mysterious constraint layouts from 
    9291        # https://www.wxpython.org/docs/api/wx.lib.layoutf.Layoutf-class.html 
    9392        lc = layoutf.Layoutf('t=t5#1;b=t5#2;l=l5#1;r=r5#1', (self,ok)) 
  • src/sas/sasgui/perspectives/fitting/basepage.py

    r140159c r367a31c  
    267267        if not hasattr(self, "model_view"): 
    268268            return 
    269         toggle_mode_on = self.model_view.IsEnabled() 
     269        toggle_mode_on = self.model_view.IsEnabled() or self.data is None 
    270270        if toggle_mode_on: 
    271271            if self.enable2D and not check_data_validity(self.data): 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    ra1b8fee r489f53a  
    257257        toks = os.path.splitext(label) 
    258258        path = os.path.join(models.find_plugins_dir(), toks[0]) 
     259        message = "Are you sure you want to delete the file {}?".format(path) 
     260        dlg = wx.MessageDialog(self.frame, message, '', wx.YES_NO | wx.ICON_QUESTION) 
     261        if not dlg.ShowModal() == wx.ID_YES: 
     262            return 
    259263        try: 
    260264            for ext in ['.py', '.pyc']: 
    261265                p_path = path + ext 
     266                if ext == '.pyc' and not os.path.isfile(path + ext): 
     267                    # If model is invalid, .pyc file may not exist as model has 
     268                    # never been compiled. Don't try and delete it 
     269                    continue 
    262270                os.remove(p_path) 
    263271            self.update_custom_combo() 
     
    361369                                   'Add a new model function') 
    362370        wx.EVT_MENU(owner, wx_id, self.make_new_model) 
    363          
     371 
    364372        wx_id = wx.NewId() 
    365373        self.edit_model_menu.Append(wx_id, 'Sum|Multi(p1, p2)', 
     
    383391          '(Re)Load all models present in user plugin_models folder') 
    384392        wx.EVT_MENU(owner, wx_id, self.load_plugin_models) 
    385                  
     393 
    386394    def set_edit_menu_helper(self, owner=None, menu=None): 
    387395        """ 
     
    17341742            @param unsmeared_error: data error, rescaled to unsmeared model 
    17351743        """ 
    1736         try: 
    1737             np.nan_to_num(y) 
    1738             new_plot = self.create_theory_1D(x, y, page_id, model, data, state, 
    1739                                              data_description=model.name, 
    1740                                              data_id=str(page_id) + " " + data.name) 
    1741             if unsmeared_model is not None: 
    1742                 self.create_theory_1D(x, unsmeared_model, page_id, model, data, state, 
    1743                                       data_description=model.name + " unsmeared", 
    1744                                       data_id=str(page_id) + " " + data.name + " unsmeared") 
    1745  
    1746                 if unsmeared_data is not None and unsmeared_error is not None: 
    1747                     self.create_theory_1D(x, unsmeared_data, page_id, model, data, state, 
    1748                                           data_description="Data unsmeared", 
    1749                                           data_id="Data  " + data.name + " unsmeared", 
    1750                                           dy=unsmeared_error) 
    1751             # Comment this out until we can get P*S models with correctly populated parameters 
    1752             #if sq_model is not None and pq_model is not None: 
    1753             #    self.create_theory_1D(x, sq_model, page_id, model, data, state, 
    1754             #                          data_description=model.name + " S(q)", 
    1755             #                          data_id=str(page_id) + " " + data.name + " S(q)") 
    1756             #    self.create_theory_1D(x, pq_model, page_id, model, data, state, 
    1757             #                          data_description=model.name + " P(q)", 
    1758             #                          data_id=str(page_id) + " " + data.name + " P(q)") 
    1759  
    1760             current_pg = self.fit_panel.get_page_by_id(page_id) 
    1761             title = new_plot.title 
    1762             batch_on = self.fit_panel.get_page_by_id(page_id).batch_on 
    1763             if not batch_on: 
    1764                 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 
    1765                                             title=str(title))) 
    1766             elif plot_result: 
    1767                 top_data_id = self.fit_panel.get_page_by_id(page_id).data.id 
    1768                 if data.id == top_data_id: 
    1769                     wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 
    1770                                             title=str(title))) 
    1771             caption = current_pg.window_caption 
    1772             self.page_finder[page_id].set_fit_tab_caption(caption=caption) 
    1773  
    1774             self.page_finder[page_id].set_theory_data(data=new_plot, 
     1744 
     1745        number_finite = np.count_nonzero(np.isfinite(y)) 
     1746        np.nan_to_num(y) 
     1747        new_plot = self.create_theory_1D(x, y, page_id, model, data, state, 
     1748                                         data_description=model.name, 
     1749                                         data_id=str(page_id) + " " + data.name) 
     1750        if unsmeared_model is not None: 
     1751            self.create_theory_1D(x, unsmeared_model, page_id, model, data, state, 
     1752                                  data_description=model.name + " unsmeared", 
     1753                                  data_id=str(page_id) + " " + data.name + " unsmeared") 
     1754 
     1755            if unsmeared_data is not None and unsmeared_error is not None: 
     1756                self.create_theory_1D(x, unsmeared_data, page_id, model, data, state, 
     1757                                      data_description="Data unsmeared", 
     1758                                      data_id="Data  " + data.name + " unsmeared", 
     1759                                      dy=unsmeared_error) 
     1760        # Comment this out until we can get P*S models with correctly populated parameters 
     1761        #if sq_model is not None and pq_model is not None: 
     1762        #    self.create_theory_1D(x, sq_model, page_id, model, data, state, 
     1763        #                          data_description=model.name + " S(q)", 
     1764        #                          data_id=str(page_id) + " " + data.name + " S(q)") 
     1765        #    self.create_theory_1D(x, pq_model, page_id, model, data, state, 
     1766        #                          data_description=model.name + " P(q)", 
     1767        #                          data_id=str(page_id) + " " + data.name + " P(q)") 
     1768 
     1769        current_pg = self.fit_panel.get_page_by_id(page_id) 
     1770        title = new_plot.title 
     1771        batch_on = self.fit_panel.get_page_by_id(page_id).batch_on 
     1772        if not batch_on: 
     1773            wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=str(title))) 
     1774        elif plot_result: 
     1775            top_data_id = self.fit_panel.get_page_by_id(page_id).data.id 
     1776            if data.id == top_data_id: 
     1777                wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=str(title))) 
     1778        caption = current_pg.window_caption 
     1779        self.page_finder[page_id].set_fit_tab_caption(caption=caption) 
     1780 
     1781        self.page_finder[page_id].set_theory_data(data=new_plot, 
    17751782                                                      fid=data.id) 
    1776             if toggle_mode_on: 
    1777                 wx.PostEvent(self.parent, 
    1778                              NewPlotEvent(group_id=str(page_id) + " Model2D", 
     1783        if toggle_mode_on: 
     1784            wx.PostEvent(self.parent, 
     1785                         NewPlotEvent(group_id=str(page_id) + " Model2D", 
    17791786                                          action="Hide")) 
    1780             else: 
    1781                 if update_chisqr: 
    1782                     wx.PostEvent(current_pg, 
    1783                                  Chi2UpdateEvent(output=self._cal_chisqr( 
     1787        else: 
     1788            if update_chisqr: 
     1789                wx.PostEvent(current_pg, 
     1790                             Chi2UpdateEvent(output=self._cal_chisqr( 
    17841791                                                                data=data, 
    17851792                                                                fid=fid, 
    17861793                                                                weight=weight, 
    1787                                                             page_id=page_id, 
    1788                                                             index=index))) 
    1789                 else: 
    1790                     self._plot_residuals(page_id=page_id, data=data, fid=fid, 
    1791                                          index=index, weight=weight) 
    1792  
     1794                                                                page_id=page_id, 
     1795                                                                index=index))) 
     1796            else: 
     1797                self._plot_residuals(page_id=page_id, data=data, fid=fid, 
     1798                                     index=index, weight=weight) 
     1799 
     1800        if not number_finite: 
     1801            logger.error("Using the present parameters the model does not return any finite value. ") 
     1802            msg = "Computing Error: Model did not return any finite value." 
     1803            wx.PostEvent(self.parent, StatusEvent(status = msg, info="error")) 
     1804        else: 
    17931805            msg = "Computation  completed!" 
     1806            if number_finite != y.size: 
     1807                msg += ' PROBLEM: For some Q values the model returns non finite intensities!' 
     1808                logger.error("For some Q values the model returns non finite intensities.") 
    17941809            wx.PostEvent(self.parent, StatusEvent(status=msg, type="stop")) 
    1795         except: 
    1796             raise 
    17971810 
    17981811    def _calc_exception(self, etype, value, tb): 
     
    18191832        that can be plot. 
    18201833        """ 
     1834        number_finite = np.count_nonzero(np.isfinite(image)) 
    18211835        np.nan_to_num(image) 
    18221836        new_plot = Data2D(image=image, err_image=data.err_data) 
     
    18771891                self._plot_residuals(page_id=page_id, data=data, fid=fid, 
    18781892                                      index=index, weight=weight) 
    1879         msg = "Computation  completed!" 
    1880         wx.PostEvent(self.parent, StatusEvent(status=msg, type="stop")) 
     1893 
     1894        if not number_finite: 
     1895            logger.error("Using the present parameters the model does not return any finite value. ") 
     1896            msg = "Computing Error: Model did not return any finite value." 
     1897            wx.PostEvent(self.parent, StatusEvent(status = msg, info="error")) 
     1898        else: 
     1899            msg = "Computation  completed!" 
     1900            if number_finite != image.size: 
     1901                msg += ' PROBLEM: For some Qx,Qy values the model returns non finite intensities!' 
     1902                logger.error("For some Qx,Qy values the model returns non finite intensities.") 
     1903            wx.PostEvent(self.parent, StatusEvent(status=msg, type="stop")) 
    18811904 
    18821905    def _draw_model2D(self, model, page_id, qmin, 
     
    19121935                ## and may be the cause of other noted instabilities 
    19131936                ## 
    1914                 ##    -PDB August 12, 2014  
     1937                ##    -PDB August 12, 2014 
    19151938                while self.calc_2D.isrunning(): 
    19161939                    time.sleep(0.1) 
     
    19541977            if (self.calc_1D is not None) and self.calc_1D.isrunning(): 
    19551978                self.calc_1D.stop() 
    1956                 ## stop just raises the flag -- the thread is supposed to  
     1979                ## stop just raises the flag -- the thread is supposed to 
    19571980                ## then kill itself but cannot.  Paul Kienzle came up with 
    19581981                ## this fix to prevent threads from stepping on each other 
     
    19661989                ## a request to stop the computation. 
    19671990                ## It seems thus that the whole thread approach used here 
    1968                 ## May need rethinking   
     1991                ## May need rethinking 
    19691992                ## 
    19701993                ##    -PDB August 12, 2014 
     
    21312154            residuals.dxw = None 
    21322155            residuals.ytransform = 'y' 
    2133             # For latter scale changes  
     2156            # For latter scale changes 
    21342157            residuals.xaxis('\\rm{Q} ', 'A^{-1}') 
    21352158            residuals.yaxis('\\rm{Residuals} ', 'normalized') 
  • src/sas/sasgui/perspectives/fitting/models.py

    ra1b8fee rb1c2011  
    156156    try: 
    157157        import compileall 
    158         compileall.compile_dir(dir=dir, ddir=dir, force=1, 
     158        compileall.compile_dir(dir=dir, ddir=dir, force=0, 
    159159                               quiet=report_problem) 
    160160    except: 
     
    163163 
    164164 
    165 def _findModels(dir): 
     165def _find_models(): 
    166166    """ 
    167167    Find custom models 
    168168    """ 
    169169    # List of plugin objects 
    170     dir = find_plugins_dir() 
     170    directory = find_plugins_dir() 
    171171    # Go through files in plug-in directory 
    172     if not os.path.isdir(dir): 
    173         msg = "SasView couldn't locate Model plugin folder %r." % dir 
     172    if not os.path.isdir(directory): 
     173        msg = "SasView couldn't locate Model plugin folder %r." % directory 
    174174        logger.warning(msg) 
    175175        return {} 
    176176 
    177     plugin_log("looking for models in: %s" % str(dir)) 
    178     #compile_file(dir)  #always recompile the folder plugin 
    179     logger.info("plugin model dir: %s" % str(dir)) 
     177    plugin_log("looking for models in: %s" % str(directory)) 
     178    # compile_file(directory)  #always recompile the folder plugin 
     179    logger.info("plugin model dir: %s" % str(directory)) 
    180180 
    181181    plugins = {} 
    182     for filename in os.listdir(dir): 
     182    for filename in os.listdir(directory): 
    183183        name, ext = os.path.splitext(filename) 
    184184        if ext == '.py' and not name == '__init__': 
    185             path = os.path.abspath(os.path.join(dir, filename)) 
     185            path = os.path.abspath(os.path.join(directory, filename)) 
    186186            try: 
    187187                model = load_custom_model(path) 
    188                 model.name = PLUGIN_NAME_BASE + model.name 
     188                if not model.name.count(PLUGIN_NAME_BASE): 
     189                    model.name = PLUGIN_NAME_BASE + model.name 
    189190                plugins[model.name] = model 
    190191            except Exception: 
     
    193194                plugin_log(msg) 
    194195                logger.warning("Failed to load plugin %r. See %s for details" 
    195                                 % (path, PLUGIN_LOG)) 
    196              
     196                               % (path, PLUGIN_LOG)) 
     197 
    197198    return plugins 
    198199 
     
    264265        temp = {} 
    265266        if self.is_changed(): 
    266             return  _findModels(dir) 
     267            return  _find_models() 
    267268        logger.info("plugin model : %s" % str(temp)) 
    268269        return temp 
     
    297298        for name, plug in self.stored_plugins.iteritems(): 
    298299            self.model_dictionary[name] = plug 
    299          
     300 
    300301        self._get_multifunc_models() 
    301302 
     
    339340        """ 
    340341        self.plugins = [] 
    341         new_plugins = _findModels(dir) 
     342        new_plugins = _find_models() 
    342343        for name, plug in  new_plugins.iteritems(): 
    343344            for stored_name, stored_plug in self.stored_plugins.iteritems(): 
  • src/sas/sasgui/perspectives/pr/inversion_panel.py

    r7432acb rcb62bd5  
    7070        self.rg_ctl = None 
    7171        self.iq0_ctl = None 
    72         self.bck_chk = None 
     72        self.bck_value = None 
     73        self.bck_est_ctl = None 
     74        self.bck_man_ctl = None 
     75        self.est_bck = True 
     76        self.bck_input = None 
    7377        self.bck_ctl = None 
    7478 
     
    312316        # Read the panel's parameters 
    313317        flag, alpha, dmax, nfunc, qmin, \ 
    314         qmax, height, width = self._read_pars() 
     318        qmax, height, width, bck = self._read_pars() 
    315319 
    316320        state.nfunc = nfunc 
     
    326330 
    327331        # Background evaluation checkbox 
    328         state.estimate_bck = self.bck_chk.IsChecked() 
     332        state.estimate_bck = self.est_bck 
     333        state.bck_value = bck 
    329334 
    330335        # Estimates 
     
    371376        self.plot_data.SetValue(str(state.file)) 
    372377 
    373         # Background evaluation checkbox 
    374         self.bck_chk.SetValue(state.estimate_bck) 
     378        # Background value 
     379        self.bck_est_ctl.SetValue(state.estimate_bck) 
     380        self.bck_man_ctl.SetValue(not state.estimate_bck) 
     381        if not state.estimate_bck: 
     382            self.bck_input.Enable() 
     383            self.bck_input.SetValue(str(state.bck_value)) 
     384        self.est_bck = state.estimate_bck 
     385        self.bck_value = state.bck_value 
    375386 
    376387        # Estimates 
     
    431442                       wx.EXPAND | wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, 15) 
    432443 
    433         self.bck_chk = wx.CheckBox(self, -1, "Estimate background level") 
    434         hint_msg = "Check box to let the fit estimate " 
    435         hint_msg += "the constant background level." 
    436         self.bck_chk.SetToolTipString(hint_msg) 
    437         self.bck_chk.Bind(wx.EVT_CHECKBOX, self._on_pars_changed) 
     444        radio_sizer = wx.GridBagSizer(5, 5) 
     445 
     446        self.bck_est_ctl = wx.RadioButton(self, -1, "Estimate background level", 
     447            name="estimate_bck", style=wx.RB_GROUP) 
     448        self.bck_man_ctl = wx.RadioButton(self, -1, "Input manual background level", 
     449            name="manual_bck") 
     450 
     451        self.bck_est_ctl.Bind(wx.EVT_RADIOBUTTON, self._on_bck_changed) 
     452        self.bck_man_ctl.Bind(wx.EVT_RADIOBUTTON, self._on_bck_changed) 
     453 
     454        radio_sizer.Add(self.bck_est_ctl, (0,0), (1,1), wx.LEFT | wx.EXPAND) 
     455        radio_sizer.Add(self.bck_man_ctl, (0,1), (1,1), wx.RIGHT | wx.EXPAND) 
     456 
    438457        iy += 1 
    439         pars_sizer.Add(self.bck_chk, (iy, 0), (1, 2), 
     458        pars_sizer.Add(radio_sizer, (iy, 0), (1, 2), 
    440459                       wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
     460 
     461        background_label = wx.StaticText(self, -1, "Background: ") 
     462        self.bck_input = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, 
     463            size=(60, 20), value="0.0") 
     464        self.bck_input.Disable() 
     465        self.bck_input.Bind(wx.EVT_TEXT, self._read_pars) 
     466        background_units = wx.StaticText(self, -1, "[A^(-1)]", size=(55, 20)) 
     467        iy += 1 
     468 
     469        background_sizer = wx.GridBagSizer(5, 5) 
     470 
     471        background_sizer.Add(background_label, (0, 0), (1,1), 
     472            wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 23) 
     473        background_sizer.Add(self.bck_input, (0, 1), (1,1), 
     474            wx.LEFT | wx.ADJUST_MINSIZE, 5) 
     475        background_sizer.Add(background_units, (0, 2), (1,1), 
     476            wx.LEFT | wx.ADJUST_MINSIZE, 5) 
     477        pars_sizer.Add(background_sizer, (iy, 0), (1, 2), 
     478            wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
     479 
    441480        boxsizer1.Add(pars_sizer, 0, wx.EXPAND) 
    442481        vbox.Add(boxsizer1, (iy_vb, 0), (1, 1), 
     
    764803        self._on_pars_changed() 
    765804 
     805    def _on_bck_changed(self, evt=None): 
     806        self.est_bck = self.bck_est_ctl.GetValue() 
     807        if self.est_bck: 
     808            self.bck_input.Disable() 
     809        else: 
     810            self.bck_input.Enable() 
     811 
    766812    def _on_pars_changed(self, evt=None): 
    767813        """ 
     
    770816        scenes. 
    771817        """ 
    772         flag, alpha, dmax, nfunc, qmin, qmax, height, width = self._read_pars() 
    773         has_bck = self.bck_chk.IsChecked() 
     818        flag, alpha, dmax, nfunc, qmin, qmax, height, width, bck = self._read_pars() 
    774819 
    775820        # If the pars are valid, estimate alpha 
     
    783828                                                      d_max=dmax, 
    784829                                                      q_min=qmin, q_max=qmax, 
    785                                                       bck=has_bck, 
     830                                                      est_bck=self.est_bck, 
     831                                                      bck_val=bck, 
    786832                                                      height=height, 
    787833                                                      width=width) 
     
    797843        height = 0 
    798844        width = 0 
     845        background = 0 
    799846        flag = True 
    800847        # Read slit height 
     
    890937            self.qmax_ctl.Refresh() 
    891938 
    892         return flag, alpha, dmax, nfunc, qmin, qmax, height, width 
     939        # Read background 
     940        if not self.est_bck: 
     941            try: 
     942                bck_str = self.bck_input.GetValue() 
     943                if len(bck_str.strip()) == 0: 
     944                    background = 0.0 
     945                else: 
     946                    background = float(bck_str) 
     947                    self.bck_input.SetBackgroundColour(wx.WHITE) 
     948            except ValueError: 
     949                background = 0.0 
     950                self.bck_input.SetBackgroundColour("pink") 
     951            self.bck_input.Refresh() 
     952 
     953        return flag, alpha, dmax, nfunc, qmin, qmax, height, width, background 
    893954 
    894955    def _on_explore(self, evt): 
     
    915976        # Push it to the manager 
    916977 
    917         flag, alpha, dmax, nfunc, qmin, qmax, height, width = self._read_pars() 
    918         has_bck = self.bck_chk.IsChecked() 
     978        flag, alpha, dmax, nfunc, qmin, qmax, height, width, bck = self._read_pars() 
    919979 
    920980        if flag: 
     
    928988                                                   d_max=dmax, 
    929989                                                   q_min=qmin, q_max=qmax, 
    930                                                    bck=has_bck, 
     990                                                   est_bck=self.est_bck, 
     991                                                   bck_val = bck, 
    931992                                                   height=height, 
    932993                                                   width=width) 
  • src/sas/sasgui/perspectives/pr/inversion_state.py

    r7432acb ra0e6b1b  
    3636           ["qmin", "qmin"], 
    3737           ["qmax", "qmax"], 
    38            ["estimate_bck", "estimate_bck"]] 
     38           ["estimate_bck", "estimate_bck"], 
     39           ["bck_value", "bck_value"]] 
    3940 
    4041## List of P(r) inversion outputs 
     
    6263        self.estimate_bck = False 
    6364        self.timestamp = time.time() 
     65        self.bck_value = 0.0 
    6466 
    6567        # Inversion parameters 
     
    109111        state += "Timestamp:    %s\n" % self.timestamp 
    110112        state += "Estimate bck: %s\n" % str(self.estimate_bck) 
     113        state += "Bck Value:    %s\n" % str(self.bck_value) 
    111114        state += "No. terms:    %s\n" % str(self.nfunc) 
    112115        state += "D_max:        %s\n" % str(self.d_max) 
     
    296299                            self.coefficients.append(float(c)) 
    297300                        except: 
    298                             # Bad data, skip. We will count the number of  
    299                             # coefficients at the very end and deal with  
     301                            # Bad data, skip. We will count the number of 
     302                            # coefficients at the very end and deal with 
    300303                            # inconsistencies then. 
    301304                            pass 
     
    329332                                cov_row.append(float(c)) 
    330333                            except: 
    331                                 # Bad data, skip. We will count the number of  
    332                                 # coefficients at the very end and deal with  
     334                                # Bad data, skip. We will count the number of 
     335                                # coefficients at the very end and deal with 
    333336                                # inconsistencies then. 
    334337                                pass 
     
    461464                tree = etree.parse(path, parser=etree.ETCompatXMLParser()) 
    462465                # Check the format version number 
    463                 # Specifying the namespace will take care of the file  
    464                 #format version  
     466                # Specifying the namespace will take care of the file 
     467                #format version 
    465468                root = tree.getroot() 
    466469 
  • src/sas/sasgui/perspectives/pr/media/pr_help.rst

    r1221196 r1abd19c  
    4949P(r) inversion requires that the background be perfectly subtracted.  This is 
    5050often difficult to do well and thus many data sets will include a background. 
    51 For those cases, the user should check the "estimate background" box and the 
    52 module will do its best to estimate it. 
     51For those cases, the user should check the "Estimate background level" option 
     52and the module will do its best to estimate it. If you know the background value 
     53for your data, select the "Input manual background level" option. Note that 
     54this value will be treated as having 0 error. 
    5355 
    5456The P(r) module is constantly computing in the background what the optimum 
  • src/sas/sasgui/perspectives/pr/pr.py

    ra1b8fee rcb62bd5  
    6868        self.q_min = None 
    6969        self.q_max = None 
    70         self.has_bck = False 
     70        self.est_bck = False 
     71        self.bck_val = 0 
    7172        self.slit_height = 0 
    7273        self.slit_width = 0 
     
    828829        self.control_panel.iq0 = pr.iq0(out) 
    829830        self.control_panel.bck = pr.background 
     831        self.control_panel.bck_input.SetValue("{:.2g}".format(pr.background)) 
    830832 
    831833        # Show I(q) fit 
     
    907909 
    908910    def setup_plot_inversion(self, alpha, nfunc, d_max, q_min=None, q_max=None, 
    909                              bck=False, height=0, width=0): 
     911                             est_bck=False, bck_val=0, height=0, width=0): 
    910912        """ 
    911913            Set up inversion from plotted data 
     
    916918        self.q_min = q_min 
    917919        self.q_max = q_max 
    918         self.has_bck = bck 
     920        self.est_bck = est_bck 
     921        self.bck_val = bck_val 
    919922        self.slit_height = height 
    920923        self.slit_width = width 
     
    930933    def estimate_plot_inversion(self, alpha, nfunc, d_max, 
    931934                                q_min=None, q_max=None, 
    932                                 bck=False, height=0, width=0): 
     935                                est_bck=False, bck_val=0, height=0, width=0): 
    933936        """ 
    934937            Estimate parameters from plotted data 
     
    939942        self.q_min = q_min 
    940943        self.q_max = q_max 
    941         self.has_bck = bck 
     944        self.est_bck = est_bck 
     945        self.bck_val = bck_val 
    942946        self.slit_height = height 
    943947        self.slit_width = width 
     
    973977        pr.x = self.current_plottable.x 
    974978        pr.y = self.current_plottable.y 
    975         pr.has_bck = self.has_bck 
     979        pr.est_bck = self.est_bck 
    976980        pr.slit_height = self.slit_height 
    977981        pr.slit_width = self.slit_width 
     982        pr.background = self.bck_val 
    978983 
    979984        # Keep track of the plot window title to ensure that 
     
    10191024        self.q_min = q_min 
    10201025        self.q_max = q_max 
    1021         self.has_bck = bck 
     1026        self.est_bck = bck 
    10221027        self.slit_height = height 
    10231028        self.slit_width = width 
     
    10421047        self.q_min = q_min 
    10431048        self.q_max = q_max 
    1044         self.has_bck = bck 
     1049        self.est_bck = bck 
    10451050        self.slit_height = height 
    10461051        self.slit_width = width 
     
    11151120            pr.y = y 
    11161121            pr.err = err 
    1117             pr.has_bck = self.has_bck 
     1122            pr.est_bck = self.est_bck 
    11181123            pr.slit_height = self.slit_height 
    11191124            pr.slit_width = self.slit_width 
Note: See TracChangeset for help on using the changeset viewer.