Changeset b39debba in sasview for src/sas/sasgui/perspectives
- Timestamp:
- Jan 2, 2017 3:10:13 AM (8 years ago)
- Children:
- 25594ca
- Parents:
- 6c6aa83 (diff), c1681ea (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. - Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
r06a4306 r505706a 1041 1041 disp_model = POLYDISPERSITY_MODELS['array']() 1042 1042 if hasattr(state, "values") and \ 1043 self.disp_cb_dict[item].GetValue() is True:1043 self.disp_cb_dict[item].GetValue(): 1044 1044 if len(state.values) > 0: 1045 1045 self.values = state.values … … 1541 1541 index_data = ((self.qmin_x <= self.data.x) & 1542 1542 (self.data.x <= self.qmax_x)) 1543 val = self.data.x[index_data is True] 1544 val = len(val) if isinstance(val, list) else 1 1545 self.Npts_fit.SetValue(str(val)) 1546 1543 val = str(len(self.data.x[index_data])) 1544 self.Npts_fit.SetValue(val) 1547 1545 else: 1548 1546 # No data in the panel … … 2147 2145 flag = False 2148 2146 else: 2149 self.Npts_fit.SetValue(str(len(index_data[index_data is True])))2147 self.Npts_fit.SetValue(str(len(index_data[index_data]))) 2150 2148 self.fitrange = True 2151 2149 … … 2182 2180 flag = False 2183 2181 else: 2184 val = index_data[index_data is True] 2185 val = len(val) if isinstance(val, list) else 1 2186 self.Npts_fit.SetValue(str(val)) 2182 self.Npts_fit.SetValue(str(len(index_data[index_data]))) 2187 2183 self.fitrange = True 2188 2184 … … 2628 2624 Layout after self._draw_model 2629 2625 """ 2630 if ON_MAC is True:2626 if ON_MAC: 2631 2627 time.sleep(1) 2632 2628 -
src/sas/sasgui/perspectives/fitting/fitpage.py
rbf44249e r24fd27a 1618 1618 return 1619 1619 # check if it is pinhole smear and get min max if it is. 1620 if data.dx is not None and n ot numpy.any(data.dx):1620 if data.dx is not None and numpy.any(data.dx): 1621 1621 self.smear_type = "Pinhole" 1622 1622 self.dq_l = data.dx[0] -
src/sas/sasgui/perspectives/fitting/model_thread.py
r286c757 rc1681ea 82 82 fn.set_model(self.model) 83 83 fn.set_index(index_model) 84 # Get necessary data from self.data and set the data for smearing85 fn.get_data()86 84 # Calculate smeared Intensity 87 85 #(by Gaussian averaging): DataLoader/smearing2d/Smearer2D() … … 89 87 else: 90 88 # calculation w/o smearing 91 value = self.model.evalDistribution(\ 92 [self.data.qx_data[index_model], 93 self.data.qy_data[index_model]]) 89 value = self.model.evalDistribution([ 90 self.data.qx_data[index_model], 91 self.data.qy_data[index_model] 92 ]) 94 93 output = numpy.zeros(len(self.data.qx_data)) 95 94 # output default is None … … 198 197 output[index] = self.model.evalDistribution(self.data.x[index]) 199 198 200 sq_model = None 201 pq_model = None 199 sq_values = None 200 pq_values = None 201 s_model = None 202 p_model = None 202 203 if isinstance(self.model, MultiplicationModel): 203 sq_model = numpy.zeros((len(self.data.x))) 204 pq_model = numpy.zeros((len(self.data.x))) 205 sq_model[index] = self.model.s_model.evalDistribution(self.data.x[index]) 206 pq_model[index] = self.model.p_model.evalDistribution(self.data.x[index]) 204 s_model = self.model.s_model 205 p_model = self.model.p_model 206 elif hasattr(self.model, "get_composition_models"): 207 p_model, s_model = self.model.get_composition_models() 208 209 if p_model is not None and s_model is not None: 210 sq_values = numpy.zeros((len(self.data.x))) 211 pq_values = numpy.zeros((len(self.data.x))) 212 sq_values[index] = s_model.evalDistribution(self.data.x[index]) 213 pq_values[index] = p_model.evalDistribution(self.data.x[index]) 207 214 208 215 elapsed = time.time() - self.starttime … … 221 228 unsmeared_data=unsmeared_data, 222 229 unsmeared_error=unsmeared_error, 223 pq_model=pq_ model,224 sq_model=sq_ model)230 pq_model=pq_values, 231 sq_model=sq_values) 225 232 226 233 def results(self): -
src/sas/sasgui/perspectives/fitting/fitting.py
r06a4306 r33844bf 45 45 from sas.sasgui.guiframe.gui_manager import MDIFrame 46 46 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 47 from sas.sasgui.perspectives.fitting.gpu_options import GpuOptions 47 48 48 49 from . import models … … 192 193 self.bumps_options_menu = self.menu1.FindItemById(self.id_bumps_options) 193 194 self.bumps_options_menu.Enable(True) 195 196 self.id_gpu_options_panel = wx.NewId() 197 self.menu1.Append(self.id_gpu_options_panel, "OpenCL Options", "Choose OpenCL driver or turn it off") 198 wx.EVT_MENU(owner, self.id_gpu_options_panel, self.on_gpu_options) 194 199 195 200 self.id_result_panel = wx.NewId() … … 801 806 self.result_frame.Show() 802 807 self.result_frame.Raise() 808 809 def on_gpu_options(self, event=None): 810 """ 811 Make the Fit Results panel visible. 812 """ 813 dialog = GpuOptions(None, wx.ID_ANY, "") 814 dialog.Show() 803 815 804 816 def stop_fit(self, uid):
Note: See TracChangeset
for help on using the changeset viewer.