Changeset ca4d985 in sasview


Ignore:
Timestamp:
Oct 5, 2016 2:52:56 PM (8 years ago)
Author:
Mathieu Doucet <doucetm@…>
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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
cbbb6a4, 3fac0df
Parents:
edbe974
Message:

S(q), P(q) plots. Fixes #209

Location:
src/sas/sasgui/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/fitting.py

    redbe974 rca4d985  
    17231723                    source='model', plot_result=True, 
    17241724                    unsmeared_model=None, unsmeared_data=None, 
    1725                     unsmeared_error=None): 
     1725                    unsmeared_error=None, sq_model=None, pq_model=None): 
    17261726        """ 
    17271727            Complete plotting 1D data 
     
    17441744                                      data_id="Data  " + data.name + " unsmeared", 
    17451745                                      dy=unsmeared_error) 
     1746                 
     1747            if sq_model is not None and pq_model is not None: 
     1748                self.create_theory_1D(x, sq_model, page_id, model, data, state, 
     1749                                      data_description=model.name + " S(q)", 
     1750                                      data_id=str(page_id) + " " + data.name + " S(q)") 
     1751                self.create_theory_1D(x, pq_model, page_id, model, data, state, 
     1752                                      data_description=model.name + " P(q)", 
     1753                                      data_id=str(page_id) + " " + data.name + " P(q)") 
     1754 
    17461755 
    17471756            current_pg = self.fit_panel.get_page_by_id(page_id) 
  • src/sas/sasgui/perspectives/fitting/model_thread.py

    r804fefa rca4d985  
    77import math 
    88from sas.sascalc.data_util.calcthread import CalcThread 
     9from sas.sascalc.fit.MultiplicationModel import MultiplicationModel 
    910 
    1011class Calc2D(CalcThread): 
     
    194195            output[index] = self.model.evalDistribution(self.data.x[index]) 
    195196 
     197        sq_model = None 
     198        pq_model = None 
     199        if isinstance(self.model, MultiplicationModel): 
     200            sq_model = numpy.zeros((len(self.data.x))) 
     201            pq_model = numpy.zeros((len(self.data.x))) 
     202            sq_model[index] = self.model.s_model.evalDistribution(self.data.x[index]) 
     203            pq_model[index] = self.model.p_model.evalDistribution(self.data.x[index]) 
     204 
    196205        elapsed = time.time() - self.starttime 
    197206 
     
    208217                      unsmeared_model=unsmeared_output, 
    209218                      unsmeared_data=unsmeared_data, 
    210                       unsmeared_error=unsmeared_error) 
     219                      unsmeared_error=unsmeared_error, 
     220                      pq_model=pq_model, 
     221                      sq_model=sq_model) 
    211222 
    212223    def results(self): 
Note: See TracChangeset for help on using the changeset viewer.