Changeset e82a901 in sasview for src/sas/perspectives/fitting


Ignore:
Timestamp:
Jun 10, 2015 2:17:59 AM (10 years ago)
Author:
butler
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
56e99f9
Parents:
7801df8 (diff), f202138 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of https://github.com/SasView/sasview.git

Conflicts:

src/sas/guiframe/documentation_window.py

Location:
src/sas/perspectives/fitting
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/perspectives/fitting/media/fitting.rst

    re3b9001 rb404a3de  
    88 
    99   Fitting Data <fitting_help> 
     10 
     11   Assessing Fit Quality <residuals_help> 
    1012 
    1113   Polydispersity Distributions <pd_help> 
  • src/sas/perspectives/fitting/media/fitting_help.rst

    r5ac0a7a rff42a26  
    351351window, and a second graph window will appear displaying the residuals (the 
    352352difference between the experimental data and the theory) at the same X-data values. 
     353See :ref:`Assessing_Fit_Quality`. 
    353354 
    354355The objective of model-fitting is to find a *physically-plausible* model, and set 
     
    373374fit of the theory to the experimental data improves the value of 'chi2/Npts' will 
    374375decrease. A good model fit should easily produce values of 'chi2/Npts' that are 
    375 close to zero, and certainly <100. 
     376close to zero, and certainly <100. See :ref:`Assessing_Fit_Quality`. 
    376377 
    377378SasView has a number of different optimisers (see the section :ref:`Fitting_Options`). 
     
    397398*Send To Fitting*. Either way, the result should be that for *n* data sets you have 
    3983992\ *n* graphs (*n* of the data and model fit, and *n* of the resulting residuals). But 
    399 it may be helpful to minimise the residuals plots for clarity. 
     400it may be helpful to minimise the residuals plots for clarity. Also see 
     401:ref:`Assessing_Fit_Quality`. 
    400402 
    401403*NB: If you need to use a customized model, you must ensure that model is available* 
     
    439441Note that the chi2/Npts value returned is the SUM of the chi2/Npts of each fit. To 
    440442see the chi2/Npts value for a specific *FitPage*, click the *Compute* button at the 
    441 bottom of that *FitPage* to recalculate. 
     443bottom of that *FitPage* to recalculate. Also see :ref:`Assessing_Fit_Quality`. 
    442444 
    443445Simultaneous Fits with Constraints 
     
    465467Note that the chi2/Npts value returned is the SUM of the chi2/Npts of each fit. To 
    466468see the chi2/Npts value for a specific *FitPage*, click the *Compute* button at the 
    467 bottom of that *FitPage* to recalculate. 
     469bottom of that *FitPage* to recalculate. Also see :ref:`Assessing_Fit_Quality`. 
    468470 
    469471.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    525527If you select a 'Chi2' value and click the *View Fits* button a graph of the 
    526528residuals for that data set is displayed. Again, if you select multiple 'Chi2' 
    527 values then all the residuals data will appear on one graph. 
     529values then all the residuals data will appear on one graph. Also see 
     530:ref:`Assessing_Fit_Quality`. 
    528531 
    529532Chain Fitting 
  • src/sas/perspectives/fitting/basepage.py

    r373d4ee r7801df8  
    28472847        """ 
    28482848 
    2849         if self.model == None: 
    2850             name = 'index.html' 
     2849        _TreeLocation = 'user/models/model_functions.html' 
     2850        if self.model != None: 
     2851            name = self.formfactorbox.GetValue() 
     2852            _PageAnchor = '#' + name 
     2853            _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, 
     2854                                              _PageAnchor, name + "Help") 
    28512855        else: 
    2852             name = self.formfactorbox.GetValue() 
    2853  
    2854         if self.model != None: 
    2855             _docspath = 'user/models/model_functions.html#' + name 
    2856             _doc_viewer = DocumentationWindow(self, -1, _docspath, name + "Help") 
    2857         else: 
    2858             _doc_viewer = DocumentationWindow(self, -1, "index.html", \ 
    2859                                                 "General Help") 
     2856            _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "", 
     2857                                                "General Model Help") 
    28602858 
    28612859 
     
    29082906 
    29092907        _TreeLocation = "_images/M_angles_pic.bmp" 
    2910         _doc_viewer = DocumentationWindow(self, -1, \ 
    2911              _TreeLocation, "Magnetic Angle Defintions") 
     2908        _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "", 
     2909                                         "Magnetic Angle Defintions") 
    29122910 
    29132911    def _on_mag_on(self, event): 
     
    29532951        """ 
    29542952 
    2955         _TreeLocation = "user/perspectives/fitting/fitting_help.html" 
    2956         _TreeLocation += "#polydispersity-distributions" 
    2957         _doc_viewer = DocumentationWindow(self, -1, \ 
    2958              _TreeLocation, "Polydispersity Help") 
     2953        _TreeLocation = "user/perspectives/fitting/pd_help.html" 
     2954        _PageAnchor = "" 
     2955        _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, 
     2956                                          _PageAnchor, "Polydispersity Help") 
    29592957 
    29602958    def on_left_down(self, event): 
  • src/sas/perspectives/fitting/fitpage.py

    r5265420 r7801df8  
    1616from sas.guiframe.utils import format_number 
    1717from sas.guiframe.utils import check_float 
     18from sas.guiframe.documentation_window import DocumentationWindow 
    1819 
    1920(Chi2UpdateEvent, EVT_CHI2_UPDATE) = wx.lib.newevent.NewEvent() 
     
    188189    def _fill_range_sizer(self): 
    189190        """ 
    190         Fill the sizer containing the plotting range 
    191         add  access to npts 
     191        Fill the Fitting sizer on the fit panel which contains: the smearing 
     192        information (dq), the weighting information (dI or other), the plotting 
     193        range, access to the 2D mask editor, the compute, fit, and help 
     194        buttons, xi^2, number of points etc. 
    192195        """ 
    193196        is_2Ddata = False 
     
    265268        weighting_box.Add(sizer_weighting) 
    266269 
    267         sizer_fit = wx.GridSizer(2, 4, 2, 6) 
     270        sizer_fit = wx.GridSizer(2, 5, 2, 6) 
    268271 
    269272        # combobox for smear2d accuracy selection 
     
    284287        self.btFit.SetToolTipString("Start fitting.") 
    285288 
     289        #General Help button 
     290        self.btFitHelp = wx.Button(self, -1, 'HELP') 
     291        self.btFitHelp.SetToolTipString("General Fitting Help.") 
     292        self.btFitHelp.Bind(wx.EVT_BUTTON, self._onFitHelp) 
     293         
     294        #Resolution Smearing Help button 
     295        self.btSmearHelp = wx.Button(self, -1, '?') 
     296        self.btSmearHelp.SetToolTipString("Resolution Smearing Help.") 
     297        self.btSmearHelp.Bind(wx.EVT_BUTTON, self._onSmearHelp) 
     298         
    286299        #textcntrl for custom resolution 
    287300        self.smear_pinhole_max = ModelTextCtrl(self, -1, 
     
    391404        #sizer_fit.Add(box_description_3, 0, 0) 
    392405        sizer_fit.Add(self.draw_button, 0, 0) 
     406        sizer_fit.Add((-1,5)) 
    393407        sizer_fit.Add(self.tcChi, 0, 0) 
    394408        sizer_fit.Add(self.Npts_fit, 0, 0) 
    395409        sizer_fit.Add(self.Npts_total, 0, 0) 
    396410        sizer_fit.Add(self.btFit, 0, 0) 
     411        sizer_fit.Add(self.btFitHelp, 0, 0) 
    397412 
    398413        # StaticText for smear 
     
    10461061        self.fit_started = self._manager.onFit(uid=self.uid) 
    10471062        wx.CallAfter(self.set_fitbutton) 
     1063 
     1064    def _onFitHelp(self, event): 
     1065        """ 
     1066        Bring up the Full Fitting Documentation whenever the HELP button is 
     1067        clicked. 
     1068 
     1069        Calls DocumentationWindow with the path of the location within the 
     1070        documentation tree (after /doc/ ....".  Note that when using old 
     1071        versions of Wx (before 2.9) and thus not the release version of 
     1072        installers, the help comes up at the top level of the file as 
     1073        webbrowser does not pass anything past the # to the browser when it is 
     1074        running "file:///...." 
     1075 
     1076    :param evt: Triggers on clicking the help button 
     1077    """ 
     1078 
     1079        _TreeLocation = "user/perspectives/fitting/fitting_help.html" 
     1080        _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "", 
     1081                                          "General Fitting Help") 
     1082 
     1083    def _onSmearHelp(self, event): 
     1084        """ 
     1085        Bring up the instrumental resolution smearing Documentation whenever 
     1086        the ? button in the smearing box is clicked. 
     1087 
     1088        Calls DocumentationWindow with the path of the location within the 
     1089        documentation tree (after /doc/ ....".  Note that when using old 
     1090        versions of Wx (before 2.9) and thus not the release version of 
     1091        installers, the help comes up at the top level of the file as 
     1092        webbrowser does not pass anything past the # to the browser when it is 
     1093        running "file:///...." 
     1094 
     1095    :param evt: Triggers on clicking the help button 
     1096    """ 
     1097 
     1098        _TreeLocation = "user/perspectives/fitting/sm_help.html" 
     1099        _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "", 
     1100                                          "Instrumental Resolution Smearing \ 
     1101                                          Help") 
    10481102 
    10491103    def set_fitbutton(self): 
Note: See TracChangeset for help on using the changeset viewer.