Ignore:
Timestamp:
Oct 5, 2016 11:03:32 AM (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:
6a0c75d1
Parents:
c807957
Message:

Add rescaled data (re #687)

File:
1 edited

Legend:

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

    rc807957 r804fefa  
    16661666 
    16671667    def create_theory_1D(self, x, y, page_id, model, data, state, 
    1668                          data_description, data_id): 
     1668                         data_description, data_id, dy=None): 
    16691669        """ 
    16701670            Create a theory object associate with an existing Data1D 
     
    16801680        """ 
    16811681        new_plot = Data1D(x=x, y=y) 
    1682         new_plot.is_data = False 
    1683         new_plot.dy = numpy.zeros(len(y)) 
    1684         new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM 
     1682        new_plot.is_data = dy is not None 
     1683        new_plot.interactive = True 
     1684        new_plot.dy = dy 
     1685        new_plot.dx = None 
     1686        new_plot.dxl = None 
     1687        new_plot.dxw = None 
     1688        # If this is a theory curve, pick the proper symbol to make it a curve 
     1689        if not new_plot.is_data: 
     1690            new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM 
    16851691        _yaxis, _yunit = data.get_yaxis() 
    16861692        _xaxis, _xunit = data.get_xaxis() 
    16871693        new_plot.title = data.name 
    1688  
    16891694        new_plot.group_id = data.group_id 
    16901695        if new_plot.group_id == None: 
     
    17131718                    toggle_mode_on=False, state=None, 
    17141719                    data=None, update_chisqr=True, 
    1715                     source='model', plot_result=True, unsmeared_model=None): 
     1720                    source='model', plot_result=True, 
     1721                    unsmeared_model=None, unsmeared_data=None, 
     1722                    unsmeared_error=None): 
    17161723        """ 
    17171724            Complete plotting 1D data 
    17181725            @param unsmeared_model: fit model, without smearing 
     1726            @param unsmeared_data: data, rescaled to unsmeared model 
    17191727        """ 
    17201728        try: 
     
    17241732                                             data_id=str(page_id) + " " + data.name) 
    17251733            if unsmeared_model is not None: 
     1734                logging.error(str(unsmeared_error)) 
    17261735                self.create_theory_1D(x, unsmeared_model, page_id, model, data, state, 
    17271736                                      data_description=model.name + " unsmeared", 
    17281737                                      data_id=str(page_id) + " " + data.name + " unsmeared") 
     1738 
     1739                self.create_theory_1D(x, unsmeared_data, page_id, model, data, state, 
     1740                                      data_description="Data unsmeared", 
     1741                                      data_id="Data  " + data.name + " unsmeared", 
     1742                                      dy=unsmeared_error) 
    17291743 
    17301744            current_pg = self.fit_panel.get_page_by_id(page_id) 
Note: See TracChangeset for help on using the changeset viewer.