Changeset 03137f1 in sasview for src/sas/sasgui/perspectives


Ignore:
Timestamp:
Feb 21, 2017 2:22:47 PM (7 years ago)
Author:
krzywon
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
3d55219
Parents:
2510b9b
Message:

Default dQ is now None. dQ from data is selected automatically if dta has dQ smearing. #844

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    ra6fccd7 r03137f1  
    362362        self.Bind(wx.EVT_RADIOBUTTON, self.onSlitSmear, 
    363363                  id=self.slit_smearer.GetId()) 
    364         self.enable_smearer.SetValue(True) 
     364        self.disable_smearer.SetValue(True) 
    365365 
    366366        sizer_smearer.Add(self.disable_smearer, 0, wx.LEFT, 10) 
     
    19341934 
    19351935            # more disables for 2D 
     1936            di_flag = False 
     1937            dq_flag = False 
    19361938            if self.data.__class__.__name__ == "Data2D" or \ 
    19371939                        self.enable2D: 
     
    19391941                self.pinhole_smearer.Enable(True) 
    19401942                self.default_mask = copy.deepcopy(self.data.mask) 
    1941                 if self.data.err_data is None or\ 
    1942                         numpy.all(err == 1 for err in self.data.err_data) or \ 
    1943                         not numpy.any(self.data.err_data): 
    1944                     self.dI_didata.Enable(False) 
    1945                     self.dI_noweight.SetValue(True) 
    1946                     self.weightbt_string = self.dI_noweight.GetLabelText() 
    1947                 else: 
    1948                     self.dI_didata.Enable(True) 
    1949                     self.dI_didata.SetValue(True) 
    1950                     self.weightbt_string = self.dI_didata.GetLabelText() 
     1943                if self.data.err_data is None \ 
     1944                        or numpy.all(err == 1 for err in self.data.err_data) \ 
     1945                        or not numpy.any(self.data.err_data): 
     1946                    di_flag = True 
     1947                if self.data.dqx is None \ 
     1948                        or numpy.all(err == 1 for err in self.data.dqx) \ 
     1949                        or not numpy.any(self.data.dqx): 
     1950                    dq_flag = True 
    19511951            else: 
    19521952                self.slit_smearer.Enable(True) 
    19531953                self.pinhole_smearer.Enable(True) 
    1954  
    1955                 if self.data.dy is None or\ 
    1956                      numpy.all(self.data.dy == 1) or\ 
    1957                      not numpy.any(self.data.dy): 
    1958                     self.dI_didata.Enable(False) 
    1959                     self.dI_noweight.SetValue(True) 
    1960                     self.weightbt_string = self.dI_noweight.GetLabelText() 
    1961                 else: 
    1962                     self.dI_didata.Enable(True) 
    1963                     self.dI_didata.SetValue(True) 
    1964                     self.weightbt_string = self.dI_didata.GetLabelText() 
     1954                if self.data.dy is None \ 
     1955                        or numpy.all(self.data.dy == 1) \ 
     1956                        or not numpy.any(self.data.dy): 
     1957                    di_flag = True 
     1958                if self.data.dx is None \ 
     1959                        or numpy.all(self.data.dx == 1) \ 
     1960                        or not numpy.any(self.data.dx): 
     1961                    dq_flag = True 
     1962 
     1963            if dq_flag: 
     1964                self.enable_smearer.Disable() 
     1965                self.disable_smearer.Enable(True) 
     1966                self.disable_smearer.SetValue(True) 
     1967            else: 
     1968                self.enable_smearer.Enable(True) 
     1969                self.enable_smearer.SetValue(True) 
     1970                self.disable_smearer.SetValue(False) 
     1971            self.onSmear(event=None) 
     1972 
     1973            if di_flag: 
     1974                self.dI_didata.Enable(False) 
     1975                self.dI_noweight.SetValue(True) 
     1976                self.weightbt_string = self.dI_noweight.GetLabelText() 
     1977            else: 
     1978                self.dI_didata.Enable(True) 
     1979                self.dI_didata.SetValue(True) 
     1980                self.weightbt_string = self.dI_didata.GetLabelText() 
     1981 
    19651982            # Enable weighting radio buttons 
    19661983            self.dI_noweight.Enable(True) 
Note: See TracChangeset for help on using the changeset viewer.