Changeset 7caf3e5 in sasview for src/sas/sasgui


Ignore:
Timestamp:
Feb 24, 2017 9:39:00 AM (7 years ago)
Author:
GitHub <noreply@…>
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:
c221349
Parents:
2ffe241 (diff), cb05bfd (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.
git-author:
Paul Kienzle <pkienzle@…> (02/24/17 09:39:00)
git-committer:
GitHub <noreply@…> (02/24/17 09:39:00)
Message:

Merge branch 'master' into sesans41

Location:
src/sas/sasgui
Files:
4 edited

Legend:

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

    ra6fccd7 r3d55219  
    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 not None \ 
     1944                        and numpy.any(self.data.err_data): 
     1945                    di_flag = True 
     1946                if self.data.dqx_data is not None \ 
     1947                        and numpy.any(self.data.dqx_data): 
     1948                    dq_flag = True 
    19511949            else: 
    19521950                self.slit_smearer.Enable(True) 
    19531951                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() 
     1952                if self.data.dy is not None and numpy.any(self.data.dy): 
     1953                    di_flag = True 
     1954                if self.data.dx is not None and numpy.any(self.data.dx): 
     1955                    dq_flag = True 
     1956                elif self.data.dxl is not None and numpy.any(self.data.dxl): 
     1957                    dq_flag = True 
     1958 
     1959            if dq_flag: 
     1960                self.enable_smearer.Enable(True) 
     1961                self.enable_smearer.SetValue(True) 
     1962                self.disable_smearer.SetValue(False) 
     1963            else: 
     1964                self.enable_smearer.Disable() 
     1965                self.disable_smearer.Enable(True) 
     1966                self.disable_smearer.SetValue(True) 
     1967 
     1968            if di_flag: 
     1969                self.dI_didata.Enable(True) 
     1970                self.dI_didata.SetValue(True) 
     1971                self.weightbt_string = self.dI_didata.GetLabelText() 
     1972            else: 
     1973                self.dI_didata.Enable(False) 
     1974                self.dI_noweight.SetValue(True) 
     1975                self.weightbt_string = self.dI_noweight.GetLabelText() 
     1976 
    19651977            # Enable weighting radio buttons 
    19661978            self.dI_noweight.Enable(True) 
     
    20042016            self.EditMask_title.Disable() 
    20052017 
     2018        self.onSmear(event=None) 
    20062019        self.on_set_focus(None) 
    20072020        self.Refresh() 
  • src/sas/sasgui/guiframe/dataFitting.py

    r345e7e4 r68adf86  
    1717    """ 
    1818    """ 
    19     def __init__(self, x=None, y=None, dx=None, dy=None): 
     19 
     20    def __init__(self, x=None, y=None, dx=None, dy=None, lam=None, dlam=None, isSesans=False): 
    2021        """ 
    2122        """ 
     
    2425        if y is None: 
    2526            y = [] 
    26         PlotData1D.__init__(self, x, y, dx, dy) 
    27         LoadData1D.__init__(self, x, y, dx, dy) 
     27        self.isSesans = isSesans 
     28        PlotData1D.__init__(self, x, y, dx, dy, lam, dlam) 
     29        LoadData1D.__init__(self, x, y, dx, dy, lam, dlam, isSesans) 
     30 
    2831        self.id = None 
    2932        self.list_group_id = [] 
     
    3235        self.path = None 
    3336        self.xtransform = None 
     37        if self.isSesans: 
     38            self.xtransform = "x" 
    3439        self.ytransform = None 
     40        if self.isSesans: 
     41            self.ytransform = "y" 
    3542        self.title = "" 
    3643        self.scale = None 
     
    6875        # First, check the data compatibility 
    6976        dy, dy_other = self._validity_check(other) 
    70         result = Data1D(x=[], y=[], dx=None, dy=None) 
     77        result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=None) 
    7178        result.clone_without_data(length=len(self.x), clone=self) 
    7279        result.copy_from_datainfo(data1d=self) 
     
    115122        # First, check the data compatibility 
    116123        self._validity_check_union(other) 
    117         result = Data1D(x=[], y=[], dx=None, dy=None) 
     124        result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=None) 
    118125        tot_length = len(self.x) + len(other.x) 
    119126        result = self.clone_without_data(length=tot_length, clone=result) 
     127        if self.dlam == None or other.dlam is None: 
     128            result.dlam = None 
     129        else: 
     130            result.dlam = numpy.zeros(tot_length) 
    120131        if self.dy == None or other.dy is None: 
    121132            result.dy = None 
     
    141152        result.y = numpy.append(self.y, other.y) 
    142153        result.y = result.y[ind] 
     154        result.lam = numpy.append(self.lam, other.lam) 
     155        result.lam = result.lam[ind] 
     156        if result.dlam != None: 
     157            result.dlam = numpy.append(self.dlam, other.dlam) 
     158            result.dlam = result.dlam[ind] 
    143159        if result.dy != None: 
    144160            result.dy = numpy.append(self.dy, other.dy) 
     
    260276        # First, check the data compatibility 
    261277        self._validity_check_union(other) 
    262         result = Data1D(x=[], y=[], dx=None, dy=None) 
     278        result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=[]) 
    263279        tot_length = len(self.x)+len(other.x) 
    264280        result.clone_without_data(length=tot_length, clone=self) 
     281        if self.dlam == None or other.dlam is None: 
     282            result.dlam = None 
     283        else: 
     284            result.dlam = numpy.zeros(tot_length) 
    265285        if self.dy == None or other.dy is None: 
    266286            result.dy = None 
     
    285305        result.y = numpy.append(self.y, other.y) 
    286306        result.y = result.y[ind] 
     307        result.lam = numpy.append(self.lam, other.lam) 
     308        result.lam = result.lam[ind] 
    287309        if result.dy != None: 
    288310            result.dy = numpy.append(self.dy, other.dy) 
  • src/sas/sasgui/guiframe/data_manager.py

    r345e7e4 r2ffe241  
    6161         
    6262        if issubclass(Data2D, data.__class__): 
    63             new_plot = Data2D(image=None, err_image=None)  
    64         else:  
    65             new_plot = Data1D(x=[], y=[], dx=None, dy=None) 
    66             
     63            new_plot = Data2D(image=None, err_image=None) # For now, isSesans for 2D data is always false 
     64        else: 
     65            new_plot = Data1D(x=[], y=[], dx=None, dy=None, lam=None, dlam=None, isSesans=data.isSesans) 
     66 
     67 
     68        #elif data.meta_data['loader'] == 'SESANS': 
     69        #    new_plot = Data1D(x=[], y=[], dx=None, dy=None, lam=None, dlam=None, isSesans=True) 
     70        #else: 
     71        #    new_plot = Data1D(x=[], y=[], dx=None, dy=None, lam=None, dlam=None) #SESANS check??? 
     72 
    6773        new_plot.copy_from_datainfo(data) 
    6874        data.clone_without_data(clone=new_plot) 
  • src/sas/sasgui/plottools/plottables.py

    r345e7e4 ra9f579c  
    10231023    """ 
    10241024 
    1025     def __init__(self, x, y, dx=None, dy=None): 
     1025    def __init__(self, x, y, dx=None, dy=None, lam=None, dlam=None): 
    10261026        """ 
    10271027        Draw points specified by x[i],y[i] in the current color/symbol. 
     
    10371037        self.x = x 
    10381038        self.y = y 
     1039        self.lam = lam 
    10391040        self.dx = dx 
    10401041        self.dy = dy 
     1042        self.dlam = dlam 
    10411043        self.source = None 
    10421044        self.detector = None 
Note: See TracChangeset for help on using the changeset viewer.