source: sasview/src/sas/sasgui/perspectives/fitting/media/fitting_help.rst @ 0c2c324

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 0c2c324 was c812d11, checked in by smk78, 8 years ago

Fix broken ref link now old model docs removed

  • Property mode set to 100644
File size: 23.1 KB
RevLine 
[ec392464]1.. fitting_help.rst
2
3.. This is a port of the original SasView html help file to ReSTructured text
4.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015.
5
[98b30b4]6.. |inlineimage004| image:: sm_image004.gif
7.. |inlineimage005| image:: sm_image005.gif
8.. |inlineimage008| image:: sm_image008.gif
9.. |inlineimage009| image:: sm_image009.gif
10.. |inlineimage010| image:: sm_image010.gif
11.. |inlineimage011| image:: sm_image011.gif
12.. |inlineimage012| image:: sm_image012.gif
13.. |inlineimage018| image:: sm_image018.gif
14.. |inlineimage019| image:: sm_image019.gif
15
[ec392464]16
17Fitting Perspective
18===================
19
[a6f3613]20.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
21
22Preparing to fit data
23---------------------
24
25To fit some data you must first load some data, activate one or more data sets,
26send those data sets to the fitting perspective, and select a model to fit to
27each data set.
28
[f3377b8]29Instructions on how to load and activate data are in the section :ref:`Loading_data`.
[ec392464]30
[a6f3613]31SasView can fit data in one of three ways:
[ec392464]32
[a6f3613]33*  in *Single* fit mode - individual data sets are fitted independently one-by-one
[ec392464]34
[f3377b8]35*  in *Simultaneous* fit mode - multiple data sets are fitted simultaneously to the *same* model with/without constrained parameters (this might be useful, for example, if you have measured the same sample at different contrasts)
[ec392464]36
[f3377b8]37*  in *Batch* fit mode - multiple data sets are fitted sequentially to the *same* model (this might be useful, for example, if you have performed a kinetic or time-resolved experiment and have *lots* of data sets!)
[a6f3613]38
39.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[ec392464]40
[a6f3613]41Selecting a model
42-----------------
[ec392464]43
[a6f3613]44By default, the models in SasView are grouped into five categories
[ec392464]45
[a6f3613]46*  *Shapes* - models describing 'objects' (spheres, cylinders, etc)
[f3377b8]47*  *Shape-Independent* - models describing structure in terms of density correlation functions, fractals, peaks, power laws, etc
[8570246]48*  *Customized Models* - SasView- or User-created (non-library) Python models
[a6f3613]49*  *Uncategorised* - other models (for reflectivity, etc)
50*  *Structure Factor* - S(Q) models
[ec392464]51
[a6f3613]52Use the *Category* drop-down menu to chose a category of model, then select
[f3377b8]53a model from the drop-down menu beneath. A graph of the chosen model, calculated
54using default parameter values, will appear. The graph will update dynamically
55as the parameter values are changed.
56
57You can decide your own model categorizations using the :ref:`Category_Manager`.
[ce62e75]58
[a6f3613]59Once you have selected a model you can read its help documentation by clicking
60on the *Description* button to the right.
61
62Show 1D/2D
63^^^^^^^^^^
64
65Models are normally fitted to 1D (ie, I(Q) vs Q) data sets, but some models in
66SasView can also be fitted to 2D (ie, I(Qx,Qy) vs Qx vs Qy) data sets.
67
68*NB: Magnetic scattering can only be fitted in SasView in 2D.*
69
70To activate 2D fitting mode, click the *Show 2D* button on the *Fit Page*. To
71return to 1D fitting model, click the same button (which will now say *Show 1D*).
[ce62e75]72
[ec392464]73.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
74
[a6f3613]75.. _Category_Manager:
[a0637de]76
[a6f3613]77Category Manager
78----------------
79
[f3377b8]80To change the model categorizations, either choose *Category Manager* from the
81*View* option on the menubar, or click on the *Modify* button on the *Fit Page*.
[a6f3613]82
[f3377b8]83.. image:: cat_fig0.bmp
[a6f3613]84
[f3377b8]85The categorization of all models except the customized models can be reassigned,
86added to, and removed using *Category Manager*. Models can also be hidden from view
87in the drop-down menus.
[a6f3613]88
[f3377b8]89.. image:: cat_fig1.bmp
[a6f3613]90
[f3377b8]91Changing category
92^^^^^^^^^^^^^^^^^
[a6f3613]93
[f3377b8]94To change category, highlight a model in the list by left-clicking on its entry and
95then click the *Modify* button. Use the *Change Category* panel that appears to make
96the required changes.
[a6f3613]97
[f3377b8]98.. image:: cat_fig2.bmp
[a6f3613]99
[f3377b8]100To create a category for the selected model, click the *Add* button. In order
101to delete a category, select the category name and click the *Remove Selected*
102button. Then click *Done*.
[a6f3613]103
[f3377b8]104Showing/hiding models
105^^^^^^^^^^^^^^^^^^^^^
[a6f3613]106
[8570246]107Use the *Enable All / Disable All* buttons and the check boxes beside each model to
[f3377b8]108select the models to show/hide. To apply the selection, click *Ok*. Otherwise click
109*Cancel*.
[a6f3613]110
[8570246]111*NB: It may be necessary to change to a different category and then back again*
[f3377b8]112*before any changes take effect.*
[a6f3613]113
114.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
115
[f3377b8]116Model Functions
117---------------
[a6f3613]118
[f3377b8]119For a complete list of all the library models available in SasView, see the section
[c812d11]120:ref:`Models`.
[a6f3613]121
[f3377b8]122It is also possible to add your own models.
[a6f3613]123
[f3377b8]124.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[a6f3613]125
[b5846a10]126.. _Adding_your_own_models:
127
[f3377b8]128Adding your own models
129----------------------
[a6f3613]130
[f3377b8]131There are currently two ways to add your own models to SasView:
132
[8570246]133* Using the :ref:`Custom_Model_Editor`
134* By :ref:`Writing_a_Plugin`
[f3377b8]135
136*NB: Because of the way these options are implemented, it is not possible for them*
137*to use the polydispersity algorithms in SasView. Only models in the model library*
138*can do this. At the time of writing (Release 3.1.0) work is in hand to make it*
139*easier to add new models to the model library.*
[a6f3613]140
141.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
142
[f3377b8]143.. _Custom_Model_Editor:
144
[a6f3613]145Custom Model Editor
146-------------------
147
[f3377b8]148From the *Fitting* option in the menu bar, select *Edit Custom Model*.
[a6f3613]149
150.. image:: edit_model_menu.bmp
151
[f3377b8]152and then one of the options
153
154*  *New* - to create a new custom model template
155*  *Sum|Multi(p1,p2)* - to create a new model by summing/multiplying existing models in the model library
156*  *Advanced* - to edit a new custom model
157*  *Delete* - to delete a custom model
[a6f3613]158
[f3377b8]159New
160^^^^
[a6f3613]161
162.. image:: new_model.bmp
163
[f3377b8]164A model template generated by this option can be viewed and further modified using
165the :ref:`Advanced` option.
166
[a6f3613]167Sum|Multi(p1,p2)
168^^^^^^^^^^^^^^^^
169
170.. image:: sum_model.bmp
[a0637de]171
[f3377b8]172This option creates a custom model of the form
173
[8570246]174Custom Model = scale_factor \* (model1 +/\* model2)
[f3377b8]175
176In the *Easy Sum/Multi Editor* give the new custom model a function name and brief
177description (to appear under the *Details* button on the *Fit Page*). Then select
178two existing models, as p1 and p2, and the required operator, '+' or '*' between
179them. Finally, click the *Apply* button to generate the model and then click *Close*.
180
181*NB: Any changes to a custom model generated in this way only become effective after*
182*it is re-selected from the model drop-down menu on the Fit Page.*
183
184.. _Advanced:
185
[a6f3613]186Advanced
187^^^^^^^^
[ec392464]188
[f3377b8]189Selecting this option shows all the custom models in the plugin model folder
190
[8570246]191  *C:\\Users\\[username]\\.sasview\\plugin_models* - (on Windows)
[f3377b8]192
193You can edit, modify, and save the Python code in any of these models using the
194*Advanced Custom Model Editor*.
195
196*NB: Unless you are confident about what you are doing, it is recommended that you*
197*only modify lines denoted with the ## <----- comments!*
198
199When editing is complete, select *Run -> Compile* from the *Model Editor* menu bar. An
200*Info* box will appear with the results of the compilation and model unit tests. The
201model will only be usable if the tests 'pass'.
202
203To use the model, go to the relevant *Fit Page*, select the *Customized Models*
204category and then select the model from the drop-down menu.
205
206*NB: Any changes to a custom model generated in this way only become effective after*
207*it is re-selected from the model drop-down menu on the Fit Page.*
[a6f3613]208
209Delete
210^^^^^^
211
[f3377b8]212Simply highlight the custom model to be removed. This operation is final!
213
214*NB: Custom models shipped with SasView cannot be removed in this way.*
[ec392464]215
216.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
217
[f3377b8]218.. _Writing_a_Plugin:
219
220Writing a Plugin
[a6f3613]221----------------
222
[f3377b8]223Advanced users can write their own model in Python and save it to the the SasView
224*plugin_models* folder
[a6f3613]225
[8570246]226  *C:\\Users\\[username]\\.sasview\\plugin_models* - (on Windows)
[a6f3613]227
[f3377b8]228in .py format. The next time SasView is started it will compile the plugin and add
229it to the list of *Customized Models*.
[a6f3613]230
[f3377b8]231It is recommended that existing plugin models be used as templates.
[a6f3613]232
[f3377b8]233.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[ec392464]234
[4666660]235.. _Fitting_Options:
236
[f3377b8]237Fitting Options
238---------------
[a6f3613]239
[f3377b8]240It is possible to specify which optimiser SasView should use to fit the data, and
241to modify some of the configurational parameters for each optimiser.
242
243From *Fitting* in the menu bar select *Fit Options*, then select one of the following
244optimisers:
[a6f3613]245
[f3377b8]246*  DREAM
247*  Levenberg-Marquardt
248*  Quasi-Newton BFGS
249*  Differential Evolution
250*  Nelder-Mead Simplex
[a6f3613]251
[6af2785]252The DREAM optimiser is the most sophisticated, but may not necessarily be the best
253option for fitting simple models. If uncertain, try the Levenberg-Marquardt optimiser
254initially.
255
[f3377b8]256These optimisers form the *Bumps* package written by P Kienzle. For more information
[4666660]257on each optimiser, see the :ref:`Fitting_Documentation`.
[a6f3613]258
[f3377b8]259.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[a6f3613]260
[5ac0a7a]261Fitting Limits
262--------------
263
264By default, *SasView* will attempt to model fit the full range of the data; ie,
265across all *Q* values. If necessary, however, it is possible to specify only a
266sub-region of the data for fitting.
267
268In a *FitPage* or *BatchPage* change the *Q* values in the *Min* and/or *Max*
269text boxes. Vertical coloured bars will appear on the graph with the data and
270'theory' indicating the current *Q* limits (red = *Qmin*, purple = *Qmax*).
271
272To return to including all data in the fit, click the *Reset* button.
273
274.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
275
276
[f3377b8]277Shortcuts
278---------
[a6f3613]279
[f3377b8]280Copy/Paste Parameters
281^^^^^^^^^^^^^^^^^^^^^
[a6f3613]282
[f3377b8]283It is possible to copy the parameters from one *Fit Page* and to paste them into
284another *Fit Page* using the same model.
[a6f3613]285
[f3377b8]286To *copy* parameters, either:
[a6f3613]287
[f3377b8]288*  Select *Edit -> Copy Params* from the menu bar, or
289*  Use Ctrl(Cmd on Mac) + Left Mouse Click on the *Fit Page*.
[a6f3613]290
[f3377b8]291To *paste* parameters, either:
292
293*  Select *Edit -> Paste Params* from the menu bar, or
294*  Use Ctrl(Cmd on Mac) + Shift + Left-click on the *Fit Page*.
295
296If either operation is successful a message will appear in the info line at the
297bottom of the SasView window.
298
299Bookmark
300^^^^^^^^
[a6f3613]301
[1fda506]302To *Bookmark* a *Fit Page* either:
[a6f3613]303
[f3377b8]304*  Select a *Fit Page* and then click on *Bookmark* in the tool bar, or
305*  Right-click and select the *Bookmark* in the popup menu.
[a6f3613]306
307.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
308
[4666660]309.. _Status_bar:
310
[1fda506]311Status Bar & Console
312--------------------
313
314The status bar is located at the bottom of the SasView window and displays
315messages, hints, warnings and errors.
316
317At the right-hand side of the status bar is a button marked *Console*. The *Console*
318displays available message history and some run-time traceback information.
319
320During a long task the *Console* can also be used to monitor the progress.
321
322.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
323
[6af2785]324.. _Single_Fit_Mode:
325
[a6f3613]326Single Fit Mode
327---------------
[ec392464]328
[4666660]329*NB: Before proceeding, ensure that the Single Mode radio button at the bottom of*
330*the Data Explorer is checked (see the section* :ref:`Loading_data` *).*
331
[63d314b]332This mode fits one data set.
333
[4666660]334When data is sent to the fitting perspective it is plotted in a graph window as
335markers.
336
337If a graph does not appear, or a graph window appears but is empty, then the data
338has not loaded correctly. Check to see if there is a message in the :ref:`Status_Bar`
339or in the *Console* window.
340
341Assuming the data has loaded correctly, when a model is selected a green model
342calculation (or what SasView calls a 'Theory') line will appear in the earlier graph
343window, and a second graph window will appear displaying the residuals (the
344difference between the experimental data and the theory) at the same X-data values.
[f9250dc]345See :ref:`Assessing_Fit_Quality`.
[4666660]346
347The objective of model-fitting is to find a *physically-plausible* model, and set
348of model parameters, that generate a theory that reproduces the experimental data
349and gives residual values as close to zero as possible.
350
351Change the default values of the model parameters by hand until the theory line
352starts to represent the experimental data. Then uncheck the tick boxes alongside
353all parameters *except* the 'background' and the 'scale'. Click the *Fit* button.
354SasView will optimise the values of the 'background' and 'scale' and also display
355the corresponding uncertainties on the optimised values.
356
357*NB: If no uncertainty is shown it generally means that the model is not very*
358*dependent on the corresponding parameter (or that one or more parameters are*
359*'correlated').*
360
361In the bottom left corner of the *Fit Page* is a box displaying the normalised value
362of the statistical |chi|\  :sup:`2` parameter returned by the optimiser.
363
364Now check the box for another model parameter and click *Fit* again. Repeat this
365process until most or all parameters are checked and have been optimised. As the
366fit of the theory to the experimental data improves the value of 'chi2/Npts' will
367decrease. A good model fit should easily produce values of 'chi2/Npts' that are
[ff42a26]368close to zero, and certainly <100. See :ref:`Assessing_Fit_Quality`.
[4666660]369
370SasView has a number of different optimisers (see the section :ref:`Fitting_Options`).
371The DREAM optimiser is the most sophisticated, but may not necessarily be the best
372option for fitting simple models. If uncertain, try the Levenberg-Marquardt optimiser
373initially.
[ec392464]374
375.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
376
[a6f3613]377Simultaneous Fit Mode
378---------------------
[ec392464]379
[63d314b]380*NB: Before proceeding, ensure that the Single Mode radio button at the bottom of*
381*the Data Explorer is checked (see the section* :ref:`Loading_data` *).*
[ec392464]382
[6af2785]383This mode is an extension of the :ref:`Single_Fit_Mode` that fits two or more data
[63d314b]384sets *to the same model* simultaneously. If necessary it is possible to constrain
385fit parameters between data sets (eg, to fix a background level, or radius, etc).
386
[b5846a10]387If the data to be fit are in multiple files, load each file, then select each file
388in the *Data Explorer*, and *Send To Fitting*. If multiple data sets are in one file,
389load that file, *Unselect All Data*, select just those data sets to be fitted, and
390*Send To Fitting*. Either way, the result should be that for *n* data sets you have
[6af2785]3912\ *n* graphs (*n* of the data and model fit, and *n* of the resulting residuals). But
[f9250dc]392it may be helpful to minimise the residuals plots for clarity. Also see
393:ref:`Assessing_Fit_Quality`.
[b5846a10]394
395*NB: If you need to use a customized model, you must ensure that model is available*
396*first (see* :ref:`Adding_your_own_models` *).*
397
[6af2785]398Method
399^^^^^^
400
[b5846a10]401Now go to each *FitPage* in turn and:
402
403  Select the required category and model;
404
405  Unselect all the model parameters;
406
407  Enter some starting guesses for the parameters;
408
409  Enter any parameter limits (recommended);
[63d314b]410
[b5846a10]411  Select which parameters will refine (selecting all is generally a bad idea...);
[63d314b]412
[b5846a10]413When done, select *Constrained or Simultaneous Fit* under *Fitting* in the menu bar.
414
415In the *Const & Simul Fit* page that appears, select which data sets are to be
416simultaneously fitted (this will probably be all of them or you would not have loaded
417them in the first place!).
418
419To tie parameters between the data sets with constraints, check the 'yes' radio button
420next to *Add Constraint?* in the *Fit Constraints* box.
421
422*NB: You can only constrain parameters that are set to refine.*
423
424When ready, click the *Fit* button on the *Const & Simul Fit* page, NOT the *Fit*
425button on the individual *FitPage*'s.
[63d314b]426
427Simultaneous Fits without Constraints
428^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ec392464]429
[b5846a10]430The results of the model-fitting will be returned to each of the individual
431*FitPage*'s.
[ec392464]432
[b5846a10]433Note that the chi2/Npts value returned is the SUM of the chi2/Npts of each fit. To
[6af2785]434see the chi2/Npts value for a specific *FitPage*, click the *Compute* button at the
[f9250dc]435bottom of that *FitPage* to recalculate. Also see :ref:`Assessing_Fit_Quality`.
[ec392464]436
[63d314b]437Simultaneous Fits with Constraints
438^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ec392464]439
[b5846a10]440Use the *Easy Setup* drop-down buttons in the *Const & Simul Fit* page to set
441up constraints between *FitPage*'s.
442
[6af2785]443Constraints will generally be of the form
444
445  Mi Parameter1 = Mj.Parameter1
446
447however the text box after the '=' sign can be used to adjust this
448relationship; for example
449
450  Mi Parameter1 = scalar \* Mj.Parameter1
451
452A 'free-form' constraint box is also provided.
[b5846a10]453
454Many constraints can be entered for a single fit.
455
456The results of the model-fitting will be returned to each of the individual
457*FitPage*'s.
[ec392464]458
[b5846a10]459Note that the chi2/Npts value returned is the SUM of the chi2/Npts of each fit. To
[6af2785]460see the chi2/Npts value for a specific *FitPage*, click the *Compute* button at the
[f9250dc]461bottom of that *FitPage* to recalculate. Also see :ref:`Assessing_Fit_Quality`.
[ec392464]462
463.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
464
[a6f3613]465Batch Fit Mode
466--------------
[ec392464]467
[6af2785]468*NB: Before proceeding, ensure that the Single Mode radio button at the bottom of*
469*the Data Explorer is checked (see the section* :ref:`Loading_data` *). The Batch*
470*Mode button will be used later on!*
[63d314b]471
[6af2785]472This mode *sequentially* fits two or more data sets *to the same model*. Unlike in
473simultaneous fitting, in batch fitting it is not possible to constrain fit parameters
474between data sets.
[ec392464]475
[6af2785]476If the data to be fit are in multiple files, load each file in the *Data Explorer*.
477If multiple data sets are in one file, load just that file. *Unselect All Data*, then
478select a single initial data set to be fitted. Fit that selected data set as described
479above under :ref:`Single_Fit_Mode` .
[ec392464]480
[6af2785]481*NB: If you need to use a customized model, you must ensure that model is available*
482*first (see* :ref:`Adding_your_own_models` *).*
[ec392464]483
[6af2785]484Method
485^^^^^^
[ec392464]486
[6af2785]487Now *Select All Data* in the *Data Explorer*, check the *Batch Mode* radio button
488at the bottom of that panel and *Send To Fitting*. A *BatchPage* will be created.
[ec392464]489
[6af2785]490.. image:: batch_button_area.bmp
[ec392464]491
[6af2785]492*NB: The Batch Page can also be created by checking the Batch Mode radio button*
493*and selecting New Fit Page under Fitting in the menu bar.*
[ec392464]494
[6af2785]495Using the drop-down menus in the *BatchPage*, now set up the *same* data set
496with the *same* model that you just fitted in single fit mode. A quick way to
497set the model parameter values is to just copy them from the earlier Single
498Fit. To do this, go back to the Single Fit *FitPage*, select *Copy Params*
499under *Edit* in the menu bar, then go back to the *BatchPage* and *Paste Params*.
[ec392464]500
[6af2785]501When ready, use the *Fit* button on the *BatchPage* to perform the fitting, NOT
502the *Fit* button on the individual *FitPage*'s.
[ec392464]503
[6af2785]504Unlike in single fit mode, the results of batch fits are not returned to
505the *BatchPage*. Instead, a spreadsheet-like :ref:`Grid_Window` will appear.
[ec392464]506
[6af2785]507If you want to visually check a graph of a particular fit, click on the name of
508a *Data set* in the *Grid Window* and then click the *View Fits* button. The
509data and the model fit will be displayed. If you select mutliple data sets they
510will all appear on one graph.
[ec392464]511
[6af2785]512.. image:: view_button.bmp
[ec392464]513
[6af2785]514*NB: In theory, returning to the BatchPage and changing the name of the I(Q)*
515*data source should also work, but at the moment whilst this does change the*
516*data set displayed it always superimposes the 'theory' corresponding to the*
517*starting parameters.*
[ec392464]518
[6af2785]519If you select a 'Chi2' value and click the *View Fits* button a graph of the
520residuals for that data set is displayed. Again, if you select multiple 'Chi2'
[f9250dc]521values then all the residuals data will appear on one graph. Also see
522:ref:`Assessing_Fit_Quality`.
[ec392464]523
[6af2785]524Chain Fitting
525^^^^^^^^^^^^^
[ec392464]526
[6af2785]527By default, the *same* parameter values copied from the initial single fit into
528the *BatchPage* will be used as the starting parameters for all batch fits. It
529is, however, possible to get *SasView* to use the results of a fit to a preceding
530data set as the starting parameters for the next fit in the sequence. This
531variation of batch fitting is called *Chain Fitting*, and will considerably speed
532up model-fitting if you have lots of very similar data sets where a few parameters
533are gradually changing. Do not use chain fitting on disparate data sets.
[ec392464]534
[6af2785]535To use chain fitting, select *Chain Fitting* under *Fitting* in the menu bar. It
536toggles on/off, so selecting it again will switch back to normal batch fitting.
[ec392464]537
[6af2785]538.. _Grid_Window:
[ec392464]539
[6af2785]540Grid Window
541^^^^^^^^^^^
[ec392464]542
[6af2785]543The *Grid Window* provides an easy way to view the results from batch fitting.
544It will be displayed automatically when a batch fit completes, but may be
545opened at any time by selecting *Show Grid Window* under *View* in the menu
546bar.
[ec392464]547
[6af2785]548.. image:: restore_batch_window.bmp
[ec392464]549
[6af2785]550Once a batch fit is completed, all model parameters are displayed but *not*
551their uncertainties. To view the uncertainties, click on a given column then
552go to *Edit* in the menu bar, select *Insert Column Before* and choose the
553required data from the list. An empty column can be inserted in the same way.
[ec392464]554
[6af2785]555To remove a column from the grid, click on the column header and choose
556*Remove Column* under *Edit* in the menu bar. The same functionality also
557allows you to re-order columns.
[ec392464]558
[6af2785]559*NB: You cannot insert/remove/re-order the rows in the Grid Window.*
[ec392464]560
[6af2785]561All of the above functions are also available by right-clicking on a column
562label.
[ec392464]563
[6af2785]564.. image:: edit_menu.bmp
[ec392464]565
[6af2785]566*NB: If there is an existing Grid Window and another batch fit is performed,*
567*an additional 'Table' tab will be added to the Grid Window.*
[ec392464]568
[6af2785]569The parameter values in the *currently selected* table of the *Grid Window*
570can be output to a CSV file by choosing *Save As* under *File* in the (*Grid*
571*Window*) menu bar. The default filename includes the date and time that the
572batch fit was performed.
[ec392464]573
[6af2785]574Saved CSV files can be reloaded by choosing *Open* under *File* in the *Grid*
575*Window* menu bar. The loaded parameters will appear in a new table tab.
[ec392464]576
[6af2785]577.. image:: file_menu.bmp
[ec392464]578
[6af2785]579*NB: Saving the Grid Window does not save any experimental data, residuals*
580*or actual model fits. Consequently if you reload a saved CSV file the*
581*ability to View Fits will be lost.*
[ec392464]582
[6af2785]583Parameter Plots
584^^^^^^^^^^^^^^^
[ec392464]585
[6af2785]586Any column of *numeric* parameter values can be plotted against another using
587the *Grid Window*. Simply select one column at the time and click the *Add*
588button next to the required *X/Y-axis Selection Range* text box. When both
589the X and Y axis boxes have been completed, click the *Plot* button.
[ec392464]590
[6af2785]591When the *Add* button is clicked, *SasView* also automatically completes the
592*X/Y-axis Label* text box with the heading from Row 1 of the selected table,
593but different labels and units can be entered manually.
[ec392464]594
595.. image:: plot_button.bmp
596
[6af2785]597The *X/Y-axis Selection Range* can be edited manually. The text control box
598recognises the operators +, -, \*, /, or 'pow', and allows the following
599types of expression :
600 
601  1) if an axis label range is a function of 1 or more *columns*, write
602     this type of expression
[ec392464]603
[6af2785]604     constant1 * column_name1 [minimum row index :  maximum  row index]
605     operator constant2 * column_name2 [minimum row index :  maximum  row index]
[ec392464]606
[6af2785]607     Example: radius [2 : 5] -3 * scale [2 : 5]
[ec392464]608
[6af2785]609  2) if only some *values* of a given column are needed but the range between
610     the first row and the last row used is not continuous, write this type of
611     expression
[ec392464]612
[6af2785]613     column_name1 [minimum row index1 :  maximum  row index1] , column_name1
614     [minimum row index2 :  maximum  row index2]
[ec392464]615
[6af2785]616     Example: radius [2 : 5] , radius [10 : 25]
[ec392464]617
618.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[6af2785]619
620.. note::  This help document was last changed by Steve King, 04Jun2015
Note: See TracBrowser for help on using the repository browser.