Changes in src/sas/sasgui/perspectives/fitting/fitting.py [0900627:2d9526d] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitting.py
r0900627 r2d9526d 1326 1326 1327 1327 is_data2d = issubclass(data.__class__, Data2D) 1328 # Check consistency of arrays1328 #check consistency of arrays 1329 1329 if not is_data2d: 1330 1330 if len(res.theory) == len(res.index[res.index]) and \ … … 1337 1337 new_theory[res.index == False] = np.nan 1338 1338 correct_result = True 1339 # Get all fittable parameters of the current model1339 #get all fittable parameters of the current model 1340 1340 param_list = model.getParamList() 1341 1341 for param in model.getDispParamList(): 1342 if '.' in param and param in param_list: 1343 # Ensure polydispersity results are displayed 1344 p1, p2 = param.split('.') 1345 if not model.is_fittable(p1) and not (p2 == 'width' and param in res.param_list)\ 1346 and param in param_list: 1347 param_list.remove(param) 1348 elif not model.is_fittable(param) and \ 1342 if not model.is_fittable(param) and \ 1349 1343 param in param_list: 1350 1344 param_list.remove(param) … … 1367 1361 batch_outputs["Chi2"].append(ERROR) 1368 1362 for param in param_list: 1369 # Save value of fixed parameters1363 # save value of fixed parameters 1370 1364 if param not in res.param_list: 1371 1365 batch_outputs[str(param)].append(ERROR) 1372 1366 else: 1373 # Save only fitted values1367 #save only fitted values 1374 1368 batch_outputs[param].append(ERROR) 1375 1369 batch_inputs["error on %s" % str(param)].append(ERROR) … … 1748 1742 @param unsmeared_error: data error, rescaled to unsmeared model 1749 1743 """ 1750 1751 1744 number_finite = np.count_nonzero(np.isfinite(y)) 1752 1745 np.nan_to_num(y) … … 1754 1747 data_description=model.name, 1755 1748 data_id=str(page_id) + " " + data.name) 1749 plots_to_update = [] # List of plottables that have changed since last calculation 1750 # Create the new theories 1756 1751 if unsmeared_model is not None: 1757 self.create_theory_1D(x, unsmeared_model, page_id, model, data, state, 1752 unsmeared_model_plot = self.create_theory_1D(x, unsmeared_model, 1753 page_id, model, data, state, 1758 1754 data_description=model.name + " unsmeared", 1759 1755 data_id=str(page_id) + " " + data.name + " unsmeared") 1756 plots_to_update.append(unsmeared_model_plot) 1760 1757 1761 1758 if unsmeared_data is not None and unsmeared_error is not None: 1762 self.create_theory_1D(x, unsmeared_data, page_id, model, data, state, 1759 unsmeared_data_plot = self.create_theory_1D(x, unsmeared_data, 1760 page_id, model, data, state, 1763 1761 data_description="Data unsmeared", 1764 1762 data_id="Data " + data.name + " unsmeared", 1765 1763 dy=unsmeared_error) 1766 # Comment this out until we can get P*S models with correctly populated parameters 1767 #if sq_model is not None and pq_model is not None: 1768 # self.create_theory_1D(x, sq_model, page_id, model, data, state, 1769 # data_description=model.name + " S(q)", 1770 # data_id=str(page_id) + " " + data.name + " S(q)") 1771 # self.create_theory_1D(x, pq_model, page_id, model, data, state, 1772 # data_description=model.name + " P(q)", 1773 # data_id=str(page_id) + " " + data.name + " P(q)") 1764 plots_to_update.append(unsmeared_data_plot) 1765 if sq_model is not None and pq_model is not None: 1766 sq_id = str(page_id) + " " + data.name + " S(q)" 1767 sq_plot = self.create_theory_1D(x, sq_model, page_id, model, data, state, 1768 data_description=model.name + " S(q)", 1769 data_id=sq_id) 1770 plots_to_update.append(sq_plot) 1771 pq_id = str(page_id) + " " + data.name + " P(q)" 1772 pq_plot = self.create_theory_1D(x, pq_model, page_id, model, data, state, 1773 data_description=model.name + " P(q)", 1774 data_id=pq_id) 1775 plots_to_update.append(pq_plot) 1776 # Update the P(Q), S(Q) and unsmeared theory plots if they exist 1777 wx.PostEvent(self.parent, NewPlotEvent(plots=plots_to_update, 1778 action='update')) 1774 1779 1775 1780 current_pg = self.fit_panel.get_page_by_id(page_id)
Note: See TracChangeset
for help on using the changeset viewer.