Index: docs/sphinx-docs/source/user/opencl_installation.rst
===================================================================
--- docs/sphinx-docs/source/user/opencl_installation.rst	(revision 6e0c7b2ea537e60b8568342795a7bdb68be60ac2)
+++ docs/sphinx-docs/source/user/opencl_installation.rst	(revision 6673d2f5c2a167cfee20ecd93f1cb5b9ceed6ef2)
@@ -14,5 +14,5 @@
 
     * Go to: Start -> Control Panel -> Administrative Tools
-    * Double Click on Computer Managment
+    * Double Click on Computer Management
     * Click on Device Manager
     * Click open Display Adapters
@@ -32,5 +32,5 @@
 Windows
 =========
-    Depeneding on the graphic card on your system, drivers
+    Depending on the graphic card on your system, drivers
     can be obtained from different sources:
 
Index: docs/sphinx-docs/source/user/sasgui/guiframe/data_formats_help.rst
===================================================================
--- docs/sphinx-docs/source/user/sasgui/guiframe/data_formats_help.rst	(revision 49148bbc34832e06f4f05e8e4c4c32c0da92d133)
+++ docs/sphinx-docs/source/user/sasgui/guiframe/data_formats_help.rst	(revision 756f28841d840526d0f4c0fb0e04aa304386cdec)
@@ -3,4 +3,5 @@
 .. This is a port of the original SasView html help file to ReSTructured text
 .. by S King, ISIS, during SasView CodeCamp-III in Feb 2015.
+.. WG Bouwman, DUT, added during CodeCamp-V in Oct 2016 the SESANS data format
 
 .. _Formats:
@@ -9,10 +10,11 @@
 ============
 
-SasView reads several different 1D (I(Q) vs Q) and 2D (I(Qx,Qy) vs (Qx,Qy))
+SasView reads several different 1D (I(Q) vs Q), 2D SANS(I(Qx,Qy) vs (Qx,Qy))
+and SESANS (P(z) vs z)
 data files. But please note that SasView does not at present load data where
 the Q and I(Q) data are in separate files.
 
-1D Formats
-----------
+1D Formats SANS
+---------------
 
 SasView will read files with 2 to 4 columns of numbers in the following order: 
@@ -46,6 +48,6 @@
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
 
-2D Formats
-----------
+2D Formats SANS
+---------------
 
 SasView will only read files in the NIST 2D format with the extensions 
@@ -60,3 +62,22 @@
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
 
-.. note::  This help document was last changed by Steve King, 01May2015
+Format SESANS
+---------------
+
+The current file extension is .ses or .sesans (not case sensitive).
+
+The file format is to have a list of name-value pairs as a header at the top of the file, detailing general experimental parameters necessary for fitting and analyzing data. This list should contain all information necessary for the file to be 'portable' between users.
+
+Following that is a 6 column list of instrument experimental variables:
+
+- Spin echo length (z, in Angstroms)
+- Spin echo length error (:math:`\Delta` z, in Angstroms) (experimental resolution)
+- neutron wavelength (:math:`\lambda`, in Angstroms) (essential for ToF instruments)
+- neutron wavelength error (:math:`\Delta \lambda`, in Angstroms)
+- Normalized polarization (:math:`P/P_0`, unitless)
+- Normalized polarization error (:math:`\Delta(P/P_0)`, unitless) (measurement error)
+
+
+.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
+
+.. note::  This help document was last changed by Wim Bouwman, 05Oct2016
Index: docs/sphinx-docs/source/user/user.rst
===================================================================
--- docs/sphinx-docs/source/user/user.rst	(revision 20a3c5523e7ec4e36897e8e08812eb3525974178)
+++ docs/sphinx-docs/source/user/user.rst	(revision bdae3178bba556f0cdefce0d7acc6cc6c260d321)
@@ -7,5 +7,7 @@
    :maxdepth: 1
 
-   SasView Model Documentation <index>
+   Model Documentation <index>
+   
+   Menu Bar <menu_bar>
 
    Analysis <analysis>
@@ -14,4 +16,2 @@
          
    Working with SasView <working>
-
-   Computations with GPU <gpu_computations>
Index: docs/sphinx-docs/source/user/working.rst
===================================================================
--- docs/sphinx-docs/source/user/working.rst	(revision 3a6b10dad839b1b71060028ef2bdb047153c78cd)
+++ docs/sphinx-docs/source/user/working.rst	(revision c43953efb2e4acc613c7ebd6174b01e2351ffced)
@@ -16,2 +16,5 @@
       
    Tutorial <tutorial.rst>
+   
+   Computations with a GPU <gpu_computations>
+   
Index: src/sas/sasgui/guiframe/gui_manager.py
===================================================================
--- src/sas/sasgui/guiframe/gui_manager.py	(revision c8a641e878a6209ec6a298efe68269f170645bed)
+++ src/sas/sasgui/guiframe/gui_manager.py	(revision 3fac0df814fa16cb4e81b12f38998515162dd09a)
@@ -1345,21 +1345,27 @@
         self._help_menu.Append(wx_id, '&Documentation', '')
         wx.EVT_MENU(self, wx_id, self._onSphinxDocs)
+        self._help_menu.AppendSeparator()
 
         if config._do_tutorial and (IS_WIN or sys.platform == 'darwin'):
-            self._help_menu.AppendSeparator()
             wx_id = wx.NewId()
             self._help_menu.Append(wx_id, '&Tutorial', 'Software tutorial')
             wx.EVT_MENU(self, wx_id, self._onTutorial)
+            self._help_menu.AppendSeparator()
+
 
         if config._do_acknowledge:
-            self._help_menu.AppendSeparator()
             wx_id = wx.NewId()
             self._help_menu.Append(wx_id, '&Acknowledge', 'Acknowledging SasView')
             wx.EVT_MENU(self, wx_id, self._onAcknowledge)
+            self._help_menu.AppendSeparator()
+
 
         if config._do_aboutbox:
+            logging.info("Doing help menu")
+            wx_id = wx.NewId()
+            self._help_menu.Append(wx_id, '&About', 'Software information')
+            wx.EVT_MENU(self, wx_id, self._onAbout)
             self._help_menu.AppendSeparator()
-            self._help_menu.Append(wx.ID_ABOUT, '&About', 'Software information')
-            wx.EVT_MENU(self, wx.ID_ABOUT, self._onAbout)
+
 
         # Checking for updates
Index: src/sas/sasgui/perspectives/fitting/basepage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/basepage.py	(revision 6c382da7a67e14f0ad75317f0696ce771b802d39)
+++ src/sas/sasgui/perspectives/fitting/basepage.py	(revision c65a265f903fc473c9bca504ea24f9bb02d98193)
@@ -1521,7 +1521,4 @@
                 self.fitrange = False
 
-            if not self.data.is_data:
-                is_modified = True
-
             ## if any value is modify draw model with new value
             if not self.fitrange:
@@ -1539,4 +1536,6 @@
                 self._draw_model()
                 self.Refresh()
+
+        logging.info("is_modified flag set to %g",is_modified)
         return is_modified
 
Index: src/sas/sasgui/perspectives/fitting/fitting.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitting.py	(revision 7673ecd9d5adcefdfa1fc6a6d1ff0649f8e63bc8)
+++ src/sas/sasgui/perspectives/fitting/fitting.py	(revision ca4d9854c75a5344e770dec25221dfeb5a270915)
@@ -313,5 +313,5 @@
         """
         event_id = event.GetId()
-        self.update_custom_combo()        
+        self.update_custom_combo()
 
     def update_custom_combo(self):
@@ -342,6 +342,5 @@
                                 page.formfactorbox.SetLabel(current_val)
         except:
-            pass
-
+            logging.error("update_custom_combo: %s", sys.exc_value)
 
     def set_edit_menu(self, owner):
@@ -1666,45 +1665,93 @@
         wx.PostEvent(self.parent, StatusEvent(status=msg, type="update"))
 
+    def create_theory_1D(self, x, y, page_id, model, data, state,
+                         data_description, data_id, dy=None):
+        """
+            Create a theory object associate with an existing Data1D
+            and add it to the data manager.
+            @param x: x-values of the data
+            @param y: y_values of the data
+            @param page_id: fit page ID
+            @param model: model used for fitting
+            @param data: Data1D object to create the theory for
+            @param state: model state
+            @param data_description: title to use in the data manager
+            @param data_id: unique data ID
+        """
+        new_plot = Data1D(x=x, y=y)
+        if dy is None:
+            new_plot.is_data = False
+            new_plot.dy = numpy.zeros(len(y))
+            # If this is a theory curve, pick the proper symbol to make it a curve
+            new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM
+        else:
+            new_plot.is_data = True
+            new_plot.dy = dy
+        new_plot.interactive = True
+        new_plot.dx = None
+        new_plot.dxl = None
+        new_plot.dxw = None
+        _yaxis, _yunit = data.get_yaxis()
+        _xaxis, _xunit = data.get_xaxis()
+        new_plot.title = data.name
+        new_plot.group_id = data.group_id
+        if new_plot.group_id == None:
+            new_plot.group_id = data.group_id
+        new_plot.id = data_id
+        # Find if this theory was already plotted and replace that plot given
+        # the same id
+        self.page_finder[page_id].get_theory_data(fid=data.id)
+
+        if data.is_data:
+            data_name = str(data.name)
+        else:
+            data_name = str(model.__class__.__name__)
+
+        new_plot.name = data_description + " [" + data_name + "]"
+        new_plot.xaxis(_xaxis, _xunit)
+        new_plot.yaxis(_yaxis, _yunit)
+        self.page_finder[page_id].set_theory_data(data=new_plot,
+                                                  fid=data.id)
+        self.parent.update_theory(data_id=data.id, theory=new_plot,
+                                   state=state)
+        return new_plot
+
     def _complete1D(self, x, y, page_id, elapsed, index, model,
                     weight=None, fid=None,
                     toggle_mode_on=False, state=None,
                     data=None, update_chisqr=True,
-                    source='model', plot_result=True):
-        """
-        Complete plotting 1D data
+                    source='model', plot_result=True,
+                    unsmeared_model=None, unsmeared_data=None,
+                    unsmeared_error=None, sq_model=None, pq_model=None):
+        """
+            Complete plotting 1D data
+            @param unsmeared_model: fit model, without smearing
+            @param unsmeared_data: data, rescaled to unsmeared model
+            @param unsmeared_error: data error, rescaled to unsmeared model
         """
         try:
             numpy.nan_to_num(y)
-
-            new_plot = Data1D(x=x, y=y)
-            new_plot.is_data = False
-            new_plot.dy = numpy.zeros(len(y))
-            new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM
-            _yaxis, _yunit = data.get_yaxis()
-            _xaxis, _xunit = data.get_xaxis()
-            new_plot.title = data.name
-
-            new_plot.group_id = data.group_id
-            if new_plot.group_id == None:
-                new_plot.group_id = data.group_id
-            new_plot.id = str(page_id) + " " + data.name
-            #if new_plot.id in self.color_dict:
-            #    new_plot.custom_color = self.color_dict[new_plot.id]
-            #find if this theory was already plotted and replace that plot given
-            #the same id
-            self.page_finder[page_id].get_theory_data(fid=data.id)
-
-            if data.is_data:
-                data_name = str(data.name)
-            else:
-                data_name = str(model.__class__.__name__)
-
-            new_plot.name = model.name + " [" + data_name + "]"
-            new_plot.xaxis(_xaxis, _xunit)
-            new_plot.yaxis(_yaxis, _yunit)
-            self.page_finder[page_id].set_theory_data(data=new_plot,
-                                                      fid=data.id)
-            self.parent.update_theory(data_id=data.id, theory=new_plot,
-                                       state=state)
+            new_plot = self.create_theory_1D(x, y, page_id, model, data, state,
+                                             data_description=model.name,
+                                             data_id=str(page_id) + " " + data.name)
+            if unsmeared_model is not None:
+                self.create_theory_1D(x, unsmeared_model, page_id, model, data, state,
+                                      data_description=model.name + " unsmeared",
+                                      data_id=str(page_id) + " " + data.name + " unsmeared")
+
+                self.create_theory_1D(x, unsmeared_data, page_id, model, data, state,
+                                      data_description="Data unsmeared",
+                                      data_id="Data  " + data.name + " unsmeared",
+                                      dy=unsmeared_error)
+                
+            if sq_model is not None and pq_model is not None:
+                self.create_theory_1D(x, sq_model, page_id, model, data, state,
+                                      data_description=model.name + " S(q)",
+                                      data_id=str(page_id) + " " + data.name + " S(q)")
+                self.create_theory_1D(x, pq_model, page_id, model, data, state,
+                                      data_description=model.name + " P(q)",
+                                      data_id=str(page_id) + " " + data.name + " P(q)")
+
+
             current_pg = self.fit_panel.get_page_by_id(page_id)
             title = new_plot.title
Index: src/sas/sasgui/perspectives/fitting/media/plugin.rst
===================================================================
--- src/sas/sasgui/perspectives/fitting/media/plugin.rst	(revision e925f619082339c12fe40c03c51a580d7ec9d8ab)
+++ src/sas/sasgui/perspectives/fitting/media/plugin.rst	(revision cbbb6a465b6cb84cd0c143df039db2c3cb53adbe)
@@ -48,5 +48,5 @@
 - If necessary use underscore to separate words (i.e. barbell not BarBell or
   broad_peak not BroadPeak)
-- Do not include âmodelâ in the name (i.e. barbell not BarBellModel)
+- Do not include Ã¢â¬ÅmodelÃ¢â¬ï¿œ in the name (i.e. barbell not BarBellModel)
 
 
@@ -644,5 +644,5 @@
 - a dictionary of parameter values. This can be {} using the default
   parameters, or filled with some parameters that will be different
-  from the default, such as {âradiusâ:10.0, âsldâ:4}. Unlisted parameters
+  from the default, such as {Ã¢â¬ËradiusÃ¢â¬â¢:10.0, Ã¢â¬ËsldÃ¢â¬â¢:4}. Unlisted parameters
   will be given the default values.
 - the input $q$ value or tuple of $(q_x, q_y)$ values.
@@ -664,5 +664,5 @@
 
 If you are editing your model from the SasView GUI, you can test it
-by selecting *Run > Compile* from the *Model Editor* menu bar. An
+by selecting *Run > Check Model* from the *Model Editor* menu bar. An
 *Info* box will appear with the results of the compilation and a
 check that the model runs.
Index: src/sas/sasgui/perspectives/fitting/model_thread.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/model_thread.py	(revision 934ce6493af6e904cf20f2500ef522b42192adfd)
+++ src/sas/sasgui/perspectives/fitting/model_thread.py	(revision ca4d9854c75a5344e770dec25221dfeb5a270915)
@@ -7,4 +7,5 @@
 import math
 from sas.sascalc.data_util.calcthread import CalcThread
+from sas.sascalc.fit.MultiplicationModel import MultiplicationModel
 
 class Calc2D(CalcThread):
@@ -166,4 +167,8 @@
         index = (self.qmin <= self.data.x) & (self.data.x <= self.qmax)
 
+        # If we use a smearer, also return the unsmeared model
+        unsmeared_output = None
+        unsmeared_data = None
+        unsmeared_error = None
         ##smearer the ouput of the plot
         if self.smearer is not None:
@@ -171,8 +176,30 @@
                                                              self.qmax)
             mask = self.data.x[first_bin:last_bin+1]
-            output[first_bin:last_bin+1] = self.model.evalDistribution(mask)
-            output = self.smearer(output, first_bin, last_bin)
+            unsmeared_output = numpy.zeros((len(self.data.x)))
+            unsmeared_output[first_bin:last_bin+1] = self.model.evalDistribution(mask)
+            output = self.smearer(unsmeared_output, first_bin, last_bin)
+            
+            # Rescale data to unsmeared model
+            unsmeared_data = numpy.zeros((len(self.data.x)))
+            unsmeared_error = numpy.zeros((len(self.data.x)))
+            unsmeared_data[first_bin:last_bin+1] = self.data.y[first_bin:last_bin+1]\
+                                                    * unsmeared_output[first_bin:last_bin+1]\
+                                                    / output[first_bin:last_bin+1]
+            unsmeared_error[first_bin:last_bin+1] = self.data.dy[first_bin:last_bin+1]\
+                                                    * unsmeared_output[first_bin:last_bin+1]\
+                                                    / output[first_bin:last_bin+1]
+            unsmeared_output=unsmeared_output[index]
+            unsmeared_data=unsmeared_data[index]
+            unsmeared_error=unsmeared_error
         else:
             output[index] = self.model.evalDistribution(self.data.x[index])
+
+        sq_model = None
+        pq_model = None
+        if isinstance(self.model, MultiplicationModel):
+            sq_model = numpy.zeros((len(self.data.x)))
+            pq_model = numpy.zeros((len(self.data.x)))
+            sq_model[index] = self.model.s_model.evalDistribution(self.data.x[index])
+            pq_model[index] = self.model.p_model.evalDistribution(self.data.x[index])
 
         elapsed = time.time() - self.starttime
@@ -187,5 +214,10 @@
                       data=self.data,
                       update_chisqr=self.update_chisqr,
-                      source=self.source)
+                      source=self.source,
+                      unsmeared_model=unsmeared_output,
+                      unsmeared_data=unsmeared_data,
+                      unsmeared_error=unsmeared_error,
+                      pq_model=pq_model,
+                      sq_model=sq_model)
 
     def results(self):
