Changeset 783c1b5 in sasview for src/sas/sasgui/perspectives/fitting
- Timestamp:
- Aug 22, 2017 2:55:25 PM (7 years ago)
- Parents:
- f001bc9 (diff), d24e41d (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 Butler <butlerpd@…> (08/22/17 14:55:25)
- git-committer:
- GitHub <noreply@…> (08/22/17 14:55:25)
- Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitting.py
r489f53a rd24e41d 1742 1742 @param unsmeared_error: data error, rescaled to unsmeared model 1743 1743 """ 1744 1745 1744 number_finite = np.count_nonzero(np.isfinite(y)) 1746 1745 np.nan_to_num(y) … … 1759 1758 dy=unsmeared_error) 1760 1759 # Comment this out until we can get P*S models with correctly populated parameters 1761 #if sq_model is not None and pq_model is not None:1762 #self.create_theory_1D(x, sq_model, page_id, model, data, state,1763 #data_description=model.name + " S(q)",1764 #data_id=str(page_id) + " " + data.name + " S(q)")1765 #self.create_theory_1D(x, pq_model, page_id, model, data, state,1766 #data_description=model.name + " P(q)",1767 #data_id=str(page_id) + " " + data.name + " P(q)")1760 if sq_model is not None and pq_model is not None: 1761 self.create_theory_1D(x, sq_model, page_id, model, data, state, 1762 data_description=model.name + " S(q)", 1763 data_id=str(page_id) + " " + data.name + " S(q)") 1764 self.create_theory_1D(x, pq_model, page_id, model, data, state, 1765 data_description=model.name + " P(q)", 1766 data_id=str(page_id) + " " + data.name + " P(q)") 1768 1767 1769 1768 current_pg = self.fit_panel.get_page_by_id(page_id) -
src/sas/sasgui/perspectives/fitting/model_thread.py
r7432acb r426df2e 71 71 (self.data.qy_data * self.data.qy_data)) 72 72 73 # For theory, qmax is based on 1d qmax 73 # For theory, qmax is based on 1d qmax 74 74 # so that must be mulitified by sqrt(2) to get actual max for 2d 75 75 index_model = (self.qmin <= radius) & (radius <= self.qmax) … … 91 91 self.data.qy_data[index_model] 92 92 ]) 93 output = np.zeros(len(self.data.qx_data)) 93 # Initialize output to NaN so masked elements do not get plotted. 94 output = np.empty_like(self.data.qx_data) 94 95 # output default is None 95 96 # This method is to distinguish between masked 96 97 #point(nan) and data point = 0. 97 output = output / output98 output[:] = np.NaN 98 99 # set value for self.mask==True, else still None to Plottools 99 100 output[index_model] = value … … 198 199 output[index] = self.model.evalDistribution(self.data.x[index]) 199 200 201 x=self.data.x[index] 202 y=output[index] 200 203 sq_values = None 201 204 pq_values = None 202 s_model = None203 p_model = None204 205 if isinstance(self.model, MultiplicationModel): 205 206 s_model = self.model.s_model 206 207 p_model = self.model.p_model 207 elif hasattr(self.model, "get_composition_models"):208 p _model, s_model = self.model.get_composition_models()209 210 if p_model is not None and s_model is not None:211 sq_values = np.zeros((len(self.data.x)))212 pq_values = np.zeros((len(self.data.x)))213 sq_values[index] = s_model.evalDistribution(self.data.x[index])214 pq_values[index] = p_model.evalDistribution(self.data.x[index]) 208 sq_values = s_model.evalDistribution(x) 209 pq_values = p_model.evalDistribution(x) 210 elif hasattr(self.model, "calc_composition_models"): 211 results = self.model.calc_composition_models(x) 212 if results is not None: 213 sq_values = results[0] 214 pq_values = results[1] 215 215 216 216 217 elapsed = time.time() - self.starttime 217 218 218 self.complete(x= self.data.x[index], y=output[index],219 self.complete(x=x, y=y, 219 220 page_id=self.page_id, 220 221 state=self.state,
Note: See TracChangeset
for help on using the changeset viewer.