Changeset be36447 in sasview


Ignore:
Timestamp:
Feb 27, 2017 9:58:22 AM (2 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:
27ba79c
Parents:
cb05bfd
Message:

Set dxl & dxw values when sending data to fitting and small cleanup of redundant code. Check if model is set before evalDistribution.

Location:
src/sas
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/data_util/qsmearing.py

    rd3911e3 rbe36447  
    108108        q_calc = self.resolution.q_calc 
    109109        iq_calc = numpy.empty_like(q_calc) 
    110         if start > 0: 
     110        if start > 0 and self.model is not None: 
    111111            iq_calc[:start] = self.model.evalDistribution(q_calc[:start]) 
    112         if end+1 < len(q_calc): 
     112        if end+1 < len(q_calc) and self.model is not None: 
    113113            iq_calc[end+1:] = self.model.evalDistribution(q_calc[end+1:]) 
    114114        iq_calc[start:end+1] = iq_in[first_bin:last_bin+1] 
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    r3d55219 rbe36447  
    164164        On_select_data 
    165165        """ 
    166         if event is None and self.dataSource.GetCount() > 0: 
    167             data = self.dataSource.GetClientData(0) 
    168             self.set_data(data) 
     166        pos = 0 
     167        if event is not None: 
     168            pos = self.dataSource.GetSelection() 
    169169        elif self.dataSource.GetCount() > 0: 
    170             pos = self.dataSource.GetSelection() 
    171170            data = self.dataSource.GetClientData(pos) 
    172171            self.set_data(data) 
     
    256255        self.Bind(wx.EVT_RADIOBUTTON, self.onWeighting, 
    257256                  id=self.dI_idata.GetId()) 
    258         self.dI_didata.SetValue(True) 
     257        self.dI_noweight.SetValue(True) 
    259258        # add 4 types of weighting to the sizer 
    260259        sizer_weighting.Add(self.dI_noweight, 0, wx.LEFT, 10) 
     
    266265        sizer_weighting.Add(self.dI_idata) 
    267266        sizer_weighting.Add((10, 10)) 
    268         self.dI_noweight.Enable(False) 
     267        self.dI_noweight.Enable(True) 
    269268        self.dI_didata.Enable(False) 
    270269        self.dI_sqrdata.Enable(False) 
     
    16271626        elif data.dxl is not None or data.dxw is not None: 
    16281627            self.smear_type = "Slit" 
    1629             if data.dxl is not None and not numpy.all(data.dxl, 0): 
     1628            if data.dxl is not None and numpy.all(data.dxl, 0): 
    16301629                self.dq_l = data.dxl[0] 
    1631             if data.dxw is not None and not numpy.all(data.dxw, 0): 
     1630            if data.dxw is not None and numpy.all(data.dxw, 0): 
    16321631                self.dq_r = data.dxw[0] 
    16331632        # return self.smear_type,self.dq_l,self.dq_r 
Note: See TracChangeset for help on using the changeset viewer.