- Timestamp:
- Sep 7, 2018 3:24:34 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- d6c4987
- Parents:
- 66d4370
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingLogic.py
rb4d05bd r40975f8 167 167 data, update_chisqr, source, \ 168 168 unsmeared_output, unsmeared_data, unsmeared_error, \ 169 pq_values, sq_values = return_data169 intermediate_results = return_data 170 170 171 171 return self._create1DPlot(tab_id, x, y, model, data) … … 224 224 data, update_chisqr, source, \ 225 225 unsmeared_output, unsmeared_data, unsmeared_error, \ 226 pq_values, sq_values = return_data 227 228 pq_plot = None 229 sq_plot = None 230 231 if pq_values is not None: 232 pq_plot = self._create1DPlot(tab_id, x, pq_values, model, data, component="P(Q)") 233 if sq_values is not None: 234 sq_plot = self._create1DPlot(tab_id, x, sq_values, model, data, component="S(Q)") 235 236 return pq_plot, sq_plot 226 intermediate_results = return_data 227 228 plots = [] 229 for name, result in intermediate_results.items(): 230 plots.append(self._create1DPlot(tab_id, x, result, model, data, component=name)) 231 return plots 237 232 238 233 def computeDataRange(self): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r66d4370 r40975f8 2346 2346 2347 2347 # Create plots for intermediate product data 2348 pq_data, sq_data = self.logic.new1DProductPlots(return_data, self.tab_id) 2349 if pq_data is not None: 2350 pq_data.symbol = "Line" 2351 self.createNewIndex(pq_data) 2352 # self.communicate.plotUpdateSignal.emit([pq_data]) 2353 new_plots.append(pq_data) 2354 if sq_data is not None: 2355 sq_data.symbol = "Line" 2356 self.createNewIndex(sq_data) 2357 # self.communicate.plotUpdateSignal.emit([sq_data]) 2358 new_plots.append(sq_data) 2348 plots = self.logic.new1DProductPlots(return_data, self.tab_id) 2349 for plot in plots: 2350 plot.symbol = "Line" 2351 self.createNewIndex(plot) 2352 new_plots.append(plot) 2359 2353 2360 2354 # Update/generate plots -
src/sas/qtgui/Perspectives/Fitting/ModelThread.py
r2df558e r40975f8 215 215 output[index] = self.model.evalDistribution(self.data.x[index]) 216 216 217 sq_values = None 218 pq_values = None 219 s_model = None 220 p_model = None 221 if isinstance(self.model, MultiplicationModel): 222 s_model = self.model.s_model 223 p_model = self.model.p_model 224 elif hasattr(self.model, "calc_composition_models"): 225 results = self.model.calc_composition_models(self.data.x[index]) 226 if results is not None: 227 pq_values, sq_values = results 228 229 if pq_values is None or sq_values is None: 230 if p_model is not None and s_model is not None: 231 sq_values = numpy.zeros((len(self.data.x))) 232 pq_values = numpy.zeros((len(self.data.x))) 233 sq_values[index] = s_model.evalDistribution(self.data.x[index]) 234 pq_values[index] = p_model.evalDistribution(self.data.x[index]) 217 results_eval = {} 218 intermediate_results = getattr(self.model, "_intermediate_results", None) 219 if callable(intermediate_results): 220 # support for future sasmodels (beta approx support) - it returns a dict of intermediate results, keyed by 221 # name 222 results_eval = intermediate_results() 223 else: 224 sq_values = None 225 pq_values = None 226 s_model = None 227 p_model = None 228 if isinstance(self.model, MultiplicationModel): 229 s_model = self.model.s_model 230 p_model = self.model.p_model 231 elif hasattr(self.model, "calc_composition_models"): 232 results = self.model.calc_composition_models(self.data.x[index]) 233 if results is not None: 234 pq_values, sq_values = results 235 236 if pq_values is None or sq_values is None: 237 if p_model is not None and s_model is not None: 238 sq_values = numpy.zeros((len(self.data.x))) 239 pq_values = numpy.zeros((len(self.data.x))) 240 sq_values[index] = s_model.evalDistribution(self.data.x[index]) 241 pq_values[index] = p_model.evalDistribution(self.data.x[index]) 242 243 if pq_values is not None and sq_values is not None: 244 results_eval = { 245 "P(Q)": pq_values, 246 "S(Q)": sq_values 247 } 235 248 236 249 elapsed = time.time() - self.starttime … … 248 261 self.source, 249 262 unsmeared_output, unsmeared_data, unsmeared_error, 250 pq_values, sq_values)263 results_eval) 251 264 else: 252 265 self.completefn((self.data.x[index], output[index], … … 261 274 self.source, 262 275 unsmeared_output, unsmeared_data, unsmeared_error, 263 pq_values, sq_values))276 results_eval)) 264 277 265 278 def results(self):
Note: See TracChangeset
for help on using the changeset viewer.