Changeset ba8d326 in sasview for src/sas/sasgui/perspectives/fitting/model_thread.py
- Timestamp:
- Jun 23, 2017 4:16:29 PM (7 years ago)
- 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 98e3f24
- Parents:
- 81b35396
- git-author:
- Paul Kienzle <pkienzle@…> (06/21/17 12:38:48)
- git-committer:
- Paul Kienzle <pkienzle@…> (06/23/17 16:16:29)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/model_thread.py
r7432acb rba8d326 1 1 """ 2 2 Calculation thread for modeling 3 3 """ 4 4 … … 28 28 worktime=0.04, 29 29 exception_handler=None, 30 30 ): 31 31 CalcThread.__init__(self, completefn, updatefn, yieldtime, worktime, 32 32 exception_handler=exception_handler) … … 57 57 if self.qmax is None: 58 58 if self.data is not None: 59 newx = math.pow(max(math.fabs(self.data.xmax), 60 math.fabs(self.data.xmin)), 2) 61 newy = math.pow(max(math.fabs(self.data.ymax), 62 math.fabs(self.data.ymin)), 2) 63 self.qmax = math.sqrt(newx + newy) 59 newx = max(math.fabs(self.data.xmax), math.fabs(self.data.xmin)) 60 newy = max(math.fabs(self.data.ymax), math.fabs(self.data.ymin)) 61 self.qmax = math.sqrt(newx**2 + newy**2) 64 62 65 63 if self.data is None: … … 68 66 69 67 # Define matrix where data will be plotted 70 radius = np.sqrt((self.data.qx_data * self.data.qx_data) + \ 71 (self.data.qy_data * self.data.qy_data)) 72 73 # For theory, qmax is based on 1d qmax 68 radius = np.sqrt(self.data.qx_data**2 + self.data.qy_data**2) 69 70 # For theory, qmax is based on 1d qmax 74 71 # so that must be mulitified by sqrt(2) to get actual max for 2d 75 72 index_model = (self.qmin <= radius) & (radius <= self.qmax) 76 index_model = index_model &self.data.mask77 index_model = index_model &np.isfinite(self.data.data)73 index_model &= self.data.mask 74 index_model &= np.isfinite(self.data.data) 78 75 79 76 if self.smearer is not None: … … 100 97 elapsed = time.time() - self.starttime 101 98 self.complete(image=output, 102 103 104 105 106 107 108 109 110 111 112 113 114 115 99 data=self.data, 100 page_id=self.page_id, 101 model=self.model, 102 state=self.state, 103 toggle_mode_on=self.toggle_mode_on, 104 elapsed=elapsed, 105 index=index_model, 106 fid=self.fid, 107 qmin=self.qmin, 108 qmax=self.qmax, 109 weight=self.weight, 110 #qstep=self.qstep, 111 update_chisqr=self.update_chisqr, 112 source=self.source) 116 113 117 114 … … 137 134 worktime=0.01, 138 135 exception_handler=None, 139 136 ): 140 137 """ 141 138 """ … … 192 189 * unsmeared_output[first_bin:last_bin+1]\ 193 190 / output[first_bin:last_bin+1] 194 unsmeared_output =unsmeared_output[index]195 unsmeared_data =unsmeared_data[index]196 unsmeared_error =unsmeared_error191 unsmeared_output = unsmeared_output[index] 192 unsmeared_data = unsmeared_data[index] 193 unsmeared_error = unsmeared_error 197 194 else: 198 195 output[index] = self.model.evalDistribution(self.data.x[index])
Note: See TracChangeset
for help on using the changeset viewer.