Ignore:
Timestamp:
Aug 10, 2018 6:17:13 AM (6 years ago)
Author:
Torin Cooper-Bennun <torin.cooper-bennun@…>
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:
44777ee
Parents:
a2cc8b97
Message:

intermediate P(Q), S(Q) values are now saved in Data Explorer and are plottable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/ModelThread.py

    rd4dac80 r3ae9179  
    222222            s_model = self.model.s_model 
    223223            p_model = self.model.p_model 
    224         elif hasattr(self.model, "get_composition_models"): 
    225             p_model, s_model = self.model.get_composition_models() 
    226  
    227         if p_model is not None and s_model is not None: 
    228             sq_values = numpy.zeros((len(self.data.x))) 
    229             pq_values = numpy.zeros((len(self.data.x))) 
    230             sq_values[index] = s_model.evalDistribution(self.data.x[index]) 
    231             pq_values[index] = p_model.evalDistribution(self.data.x[index]) 
     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]) 
    232235 
    233236        elapsed = time.time() - self.starttime 
     
    243246                    self.data, 
    244247                    self.update_chisqr, 
    245                     self.source) 
     248                    self.source, 
     249                    unsmeared_output, unsmeared_data, unsmeared_error, 
     250                    pq_values, sq_values) 
    246251        else: 
    247252            self.complete(x=self.data.x[index], y=output[index], 
Note: See TracChangeset for help on using the changeset viewer.