Changeset b324aa9 in sasview for sansview


Ignore:
Timestamp:
Feb 26, 2010 5:15:24 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
4d6cce0
Parents:
3562fbc
Message:

remove invariant

Location:
sansview/perspectives/fitting
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/basepage.py

    rfcd8887d rb324aa9  
    457457                    if path is None: 
    458458                        self.disp_cb_dict[p].SetValue(False) 
     459                        self.noDisper_rbox.SetValue(True) 
    459460                        return 
    460461                    try: 
  • sansview/perspectives/fitting/fitpage.py

    rfcd8887d rb324aa9  
    551551                            self.orientation_params_disp.append([None,name3, Tct2 
    552552                                                     ,None,None, None, None,None]) 
    553         """ 
    554         #Display units text on panel 
    555         for item in self.model.dispersion.keys():  
    556             name = item +".width"   
    557         """ 
     553        
     554 
    558555        self.state.disp_cb_dict = copy.deepcopy(self.disp_cb_dict)   
    559556           
     
    570567        wx.PostEvent(self.parent, StatusEvent(status=\ 
    571568                        " Selected Distribution: Gaussian"))    
    572         ix =0  
    573         iy +=1  
    574  
     569        #Fill the list of fittable parameters 
     570        self.select_all_param(event=None) 
     571         
    575572        self.Layout() 
    576573 
     
    12231220                            item[0].SetValue(True) 
    12241221                            self.param_toFit.append(item ) 
    1225                 if len(self.fittable_param)>0: 
    1226                     for item in self.fittable_param: 
    1227                         if self.data.__class__.__name__=="Data2D": 
     1222                #if len(self.fittable_param)>0: 
     1223                for item in self.fittable_param: 
     1224                    if self.data.__class__.__name__=="Data2D": 
     1225                        item[0].SetValue(True) 
     1226                        self.param_toFit.append(item ) 
     1227                    else: 
     1228                        ## for 1D all parameters except orientation 
     1229                        if not item in self.orientation_params_disp: 
    12281230                            item[0].SetValue(True) 
    12291231                            self.param_toFit.append(item ) 
    1230                         else: 
    1231                             ## for 1D all parameters except orientation 
    1232                             if not item in self.orientation_params_disp: 
    1233                                 item[0].SetValue(True) 
    1234                                 self.param_toFit.append(item ) 
    12351232            else: 
    12361233                for item in self.parameters: 
     
    12411238            
    12421239        self.save_current_state_fit()   
     1240        
    12431241        if event !=None: 
    12441242            #self._undo.Enable(True) 
     
    13411339        iy = 0 
    13421340        ix = 0 
    1343         self.cb1 = wx.CheckBox(self, -1,"Select all", (10, 10)) 
     1341        select_text = "Uncheck all to fix" 
     1342        self.cb1 = wx.CheckBox(self, -1,str(select_text), (10, 10)) 
    13441343        wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.select_all_param) 
    1345         self.cb1.SetValue(False) 
     1344        self.cb1.SetValue(True) 
    13461345         
    13471346        sizer.Add(self.cb1,(iy, ix),(1,1),\ 
     
    13861385                ## add parameters name with checkbox for selecting to fit 
    13871386                cb = wx.CheckBox(self, -1, item ) 
    1388                 cb.SetValue(False) 
     1387                cb.SetValue(True) 
    13891388                wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param) 
    13901389                sizer.Add( cb,( iy, ix),(1,1), 
     
    15161515                    sizer.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    15171516                    ctl3.Hide() 
    1518                     #if self.data.__class__.__name__ =="Data2D": 
    1519                     #    ctl3.Show(True) 
    1520                       
    1521                     #else: 
    1522                     #    ctl3.Hide() 
    1523                  
     1517                  
    15241518                    ix += 1 
    15251519                    ctl4 = self.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER, 
     
    15601554            if self.model.details.has_key(item): 
    15611555                self.text2_4.Show() 
    1562  
    1563         #self.state.cb1 = self.cb1.GetValue()         
    1564         #self._copy_parameters_state(self.orientation_params, 
    1565         #                             self.state.orientation_params) 
    1566         #self._copy_parameters_state(self.orientation_params_disp, 
    1567         #                             self.state.orientation_params_disp) 
    1568         #self._copy_parameters_state(self.parameters, self.state.parameters) 
    1569         #self._copy_parameters_state(self.fittable_param, self.state.fittable_param) 
    1570         #self._copy_parameters_state(self.fixed_param, self.state.fixed_param) 
    1571   
     1556        #Fill the list of fittable parameters 
     1557        self.select_all_param(event=None) 
     1558 
    15721559        self.save_current_state_fit() 
    15731560        boxsizer1.Add(sizer) 
  • sansview/perspectives/fitting/fitting.py

    r25f766a rb324aa9  
    185185        fit_option = "Select data for fitting" 
    186186        fit_hint =  "Dialog with fitting parameters " 
    187         invariant_option = "Compute Invariant" 
    188         invariant_hint =  "A dialog will appears for further computation" 
     187        
    189188        for item in graph.plottables: 
    190189            if item.__class__.__name__ is "Data2D": 
     
    205204                                if item.is_data: 
    206205                                    return [[fit_option, fit_hint, 
    207                                               self._onSelect], 
    208                                             [invariant_option,  
    209                                     invariant_hint, self._compute_invariant]] 
     206                                              self._onSelect]] 
    210207                                else: 
    211208                                    return []  
    212209                            else: 
    213                                return [[fit_option, fit_hint, self._onSelect], 
    214                                        [invariant_option,  
    215                                         invariant_hint, self._compute_invariant]] 
     210                               return [[fit_option, fit_hint, self._onSelect]] 
    216211        return []    
    217212 
     
    524519            and panel_name to find the slicer 's panel concerned. 
    525520        """ 
    526          
    527521        for item in self.parent.panels: 
    528522            if self.parent.panels[item].window_caption.startswith(event.panel_name): 
     
    530524                 
    531525        self.parent._mgr.Update() 
    532                 
    533     def _compute_invariant(self, event):     
    534         """ 
    535             Open the invariant panel to invariant computation 
    536         """ 
    537         self.panel = event.GetEventObject() 
    538         Plugin.on_perspective(self,event=event) 
    539         for plottable in self.panel.graph.plottables: 
    540             if plottable.name == self.panel.graph.selected_plottable: 
    541                 data = self.copy_data(item= plottable, dy=plottable.dy) 
    542                 
    543                 from invariant_panel import InvariantWindow 
    544                 frame = InvariantWindow(base=self.parent, data=plottable, graph=self.panel.graph)    
    545                 frame.Show(True) 
     526    
    546527               
    547528    def _closed_fitpage(self, event):    
     
    665646                ## before sending them to the fit engine 
    666647                if len(self.err_dy)>0: 
     648                    dy = item.dy 
    667649                    if item.name in  self.err_dy.iterkeys(): 
    668                         dy= self.err_dy[item.name] 
    669                         data= self.copy_data(item, dy) 
    670                         data.is_data= item.is_data 
    671                     else: 
    672                         data= self.copy_data(item, item.dy) 
    673                         data.is_data= item.is_data 
    674                          
    675                         
     650                        dy = self.err_dy[item.name] 
     651                    data = self.copy_data(item, dy) 
     652                    data.is_data= item.is_data 
     653                 
    676654                else: 
    677655                    if item.dy==None: 
     
    11431121            their errors of y coordinates for 1Data hide and show error 
    11441122        """ 
    1145         self.err_dy= event.err_dy 
     1123        self.err_dy = event.err_dy 
    11461124         
    11471125          
Note: See TracChangeset for help on using the changeset viewer.