Index: src/sas/perspectives/fitting/media/fitting_help.html
===================================================================
--- src/sas/perspectives/fitting/media/fitting_help.html	(revision a235729ed2a479e35a34ad893c281ee31ba08990)
+++ 	(revision )
@@ -1,971 +1,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
-<title>Fitting Perspective</title>
-<style type="text/css">
-
-/*
-:Author: David Goodger (goodger@python.org)
-:Id: $Id: html4css1.css 7614 2013-02-21 15:55:51Z milde $
-:Copyright: This stylesheet has been placed in the public domain.
-
-Default cascading style sheet for the HTML output of Docutils.
-
-See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
-customize this style sheet.
-*/
-
-/* used to remove borders from tables and images */
-.borderless, table.borderless td, table.borderless th {
-  border: 0 }
-
-table.borderless td, table.borderless th {
-  /* Override padding for "table.docutils td" with "! important".
-     The right padding separates the table cells. */
-  padding: 0 0.5em 0 0 ! important }
-
-.first {
-  /* Override more specific margin styles with "! important". */
-  margin-top: 0 ! important }
-
-.last, .with-subtitle {
-  margin-bottom: 0 ! important }
-
-.hidden {
-  display: none }
-
-a.toc-backref {
-  text-decoration: none ;
-  color: black }
-
-blockquote.epigraph {
-  margin: 2em 5em ; }
-
-dl.docutils dd {
-  margin-bottom: 0.5em }
-
-object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
-  overflow: hidden;
-}
-
-/* Uncomment (and remove this text!) to get bold-faced definition list terms
-dl.docutils dt {
-  font-weight: bold }
-*/
-
-div.abstract {
-  margin: 2em 5em }
-
-div.abstract p.topic-title {
-  font-weight: bold ;
-  text-align: center }
-
-div.admonition, div.attention, div.caution, div.danger, div.error,
-div.hint, div.important, div.note, div.tip, div.warning {
-  margin: 2em ;
-  border: medium outset ;
-  padding: 1em }
-
-div.admonition p.admonition-title, div.hint p.admonition-title,
-div.important p.admonition-title, div.note p.admonition-title,
-div.tip p.admonition-title {
-  font-weight: bold ;
-  font-family: sans-serif }
-
-div.attention p.admonition-title, div.caution p.admonition-title,
-div.danger p.admonition-title, div.error p.admonition-title,
-div.warning p.admonition-title, .code .error {
-  color: red ;
-  font-weight: bold ;
-  font-family: sans-serif }
-
-/* Uncomment (and remove this text!) to get reduced vertical space in
-   compound paragraphs.
-div.compound .compound-first, div.compound .compound-middle {
-  margin-bottom: 0.5em }
-
-div.compound .compound-last, div.compound .compound-middle {
-  margin-top: 0.5em }
-*/
-
-div.dedication {
-  margin: 2em 5em ;
-  text-align: center ;
-  font-style: italic }
-
-div.dedication p.topic-title {
-  font-weight: bold ;
-  font-style: normal }
-
-div.figure {
-  margin-left: 2em ;
-  margin-right: 2em }
-
-div.footer, div.header {
-  clear: both;
-  font-size: smaller }
-
-div.line-block {
-  display: block ;
-  margin-top: 1em ;
-  margin-bottom: 1em }
-
-div.line-block div.line-block {
-  margin-top: 0 ;
-  margin-bottom: 0 ;
-  margin-left: 1.5em }
-
-div.sidebar {
-  margin: 0 0 0.5em 1em ;
-  border: medium outset ;
-  padding: 1em ;
-  background-color: #ffffee ;
-  width: 40% ;
-  float: right ;
-  clear: right }
-
-div.sidebar p.rubric {
-  font-family: sans-serif ;
-  font-size: medium }
-
-div.system-messages {
-  margin: 5em }
-
-div.system-messages h1 {
-  color: red }
-
-div.system-message {
-  border: medium outset ;
-  padding: 1em }
-
-div.system-message p.system-message-title {
-  color: red ;
-  font-weight: bold }
-
-div.topic {
-  margin: 2em }
-
-h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
-h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
-  margin-top: 0.4em }
-
-h1.title {
-  text-align: center }
-
-h2.subtitle {
-  text-align: center }
-
-hr.docutils {
-  width: 75% }
-
-img.align-left, .figure.align-left, object.align-left {
-  clear: left ;
-  float: left ;
-  margin-right: 1em }
-
-img.align-right, .figure.align-right, object.align-right {
-  clear: right ;
-  float: right ;
-  margin-left: 1em }
-
-img.align-center, .figure.align-center, object.align-center {
-  display: block;
-  margin-left: auto;
-  margin-right: auto;
-}
-
-.align-left {
-  text-align: left }
-
-.align-center {
-  clear: both ;
-  text-align: center }
-
-.align-right {
-  text-align: right }
-
-/* reset inner alignment in figures */
-div.align-right {
-  text-align: inherit }
-
-/* div.align-center * { */
-/*   text-align: left } */
-
-ol.simple, ul.simple {
-  margin-bottom: 1em }
-
-ol.arabic {
-  list-style: decimal }
-
-ol.loweralpha {
-  list-style: lower-alpha }
-
-ol.upperalpha {
-  list-style: upper-alpha }
-
-ol.lowerroman {
-  list-style: lower-roman }
-
-ol.upperroman {
-  list-style: upper-roman }
-
-p.attribution {
-  text-align: right ;
-  margin-left: 50% }
-
-p.caption {
-  font-style: italic }
-
-p.credits {
-  font-style: italic ;
-  font-size: smaller }
-
-p.label {
-  white-space: nowrap }
-
-p.rubric {
-  font-weight: bold ;
-  font-size: larger ;
-  color: maroon ;
-  text-align: center }
-
-p.sidebar-title {
-  font-family: sans-serif ;
-  font-weight: bold ;
-  font-size: larger }
-
-p.sidebar-subtitle {
-  font-family: sans-serif ;
-  font-weight: bold }
-
-p.topic-title {
-  font-weight: bold }
-
-pre.address {
-  margin-bottom: 0 ;
-  margin-top: 0 ;
-  font: inherit }
-
-pre.literal-block, pre.doctest-block, pre.math, pre.code {
-  margin-left: 2em ;
-  margin-right: 2em }
-
-pre.code .ln { color: grey; } /* line numbers */
-pre.code, code { background-color: #eeeeee }
-pre.code .comment, code .comment { color: #5C6576 }
-pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
-pre.code .literal.string, code .literal.string { color: #0C5404 }
-pre.code .name.builtin, code .name.builtin { color: #352B84 }
-pre.code .deleted, code .deleted { background-color: #DEB0A1}
-pre.code .inserted, code .inserted { background-color: #A3D289}
-
-span.classifier {
-  font-family: sans-serif ;
-  font-style: oblique }
-
-span.classifier-delimiter {
-  font-family: sans-serif ;
-  font-weight: bold }
-
-span.interpreted {
-  font-family: sans-serif }
-
-span.option {
-  white-space: nowrap }
-
-span.pre {
-  white-space: pre }
-
-span.problematic {
-  color: red }
-
-span.section-subtitle {
-  /* font-size relative to parent (h1..h6 element) */
-  font-size: 80% }
-
-table.citation {
-  border-left: solid 1px gray;
-  margin-left: 1px }
-
-table.docinfo {
-  margin: 2em 4em }
-
-table.docutils {
-  margin-top: 0.5em ;
-  margin-bottom: 0.5em }
-
-table.footnote {
-  border-left: solid 1px black;
-  margin-left: 1px }
-
-table.docutils td, table.docutils th,
-table.docinfo td, table.docinfo th {
-  padding-left: 0.5em ;
-  padding-right: 0.5em ;
-  vertical-align: top }
-
-table.docutils th.field-name, table.docinfo th.docinfo-name {
-  font-weight: bold ;
-  text-align: left ;
-  white-space: nowrap ;
-  padding-left: 0 }
-
-/* "booktabs" style (no vertical lines) */
-table.docutils.booktabs {
-  border: 0px;
-  border-top: 2px solid;
-  border-bottom: 2px solid;
-  border-collapse: collapse;
-}
-table.docutils.booktabs * {
-  border: 0px;
-}
-table.docutils.booktabs th {
-  border-bottom: thin solid;
-  text-align: left;
-}
-
-h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
-h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
-  font-size: 100% }
-
-ul.auto-toc {
-  list-style-type: none }
-
-</style>
-</head>
-<body>
-<div class="document" id="fitting-perspective">
-<h1 class="title">Fitting Perspective</h1>
-
-<!-- fitting_help.rst -->
-<!-- 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. -->
-<p><a class="reference internal" href="#load-a-file">Load_a_File</a></p>
-<p><a class="reference internal" href="#single-fit">Single_Fit</a></p>
-<p><a class="reference internal" href="#simultaneous-fitting">Simultaneous_Fitting</a></p>
-<p><a class="reference internal" href="#batch-fitting">Batch_Fitting</a></p>
-<p><a class="reference internal" href="#model-selection">Model_Selection</a></p>
-<p><a class="reference internal" href="#model-category-manager">Model_Category_Manager</a></p>
-<p><a class="reference internal" href="#model-functions">Model_Functions</a></p>
-<p><a class="reference internal" href="#custom-model-editor">Custom_Model_Editor</a></p>
-<p><a class="reference internal" href="#polydispersity-distributions">Polydispersity_Distributions</a></p>
-<p><a class="reference internal" href="#smearing-computation">Smearing_Computation</a></p>
-<p><a class="reference internal" href="#polarisation-magnetic-scattering">Polarisation_Magnetic_Scattering</a></p>
-<p><a class="reference internal" href="#key-combinations">Key_Combinations</a></p>
-<p><a class="reference internal" href="#status-bar-help">Status_Bar_Help</a></p>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-<div class="section" id="id1">
-<span id="load-a-file"></span><h1>Load a File</h1>
-<p>From Menu go to <em>Data</em> -&gt; <em>Load Data File(or Folder)</em> . Select a file/folder
-from the menu bar and click on Open button. Data contained in the file will be
-displayed. To cancel the loading click on <em>cancel</em> . In case a file can not be
-loaded, an error message will be displayed on the statusbar.</p>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id2">
-<span id="single-fit"></span><h1>Single Fit</h1>
-<p>One of two fit-engines can be chosen from the Fitting menu bar. The Simple Fit-
-engine uses Scipy's leasqr and the Complex Fit-Engine is a custom optimizer
-that provides a better chance to find the global minimum of the <a href="#id3"><span class="problematic" id="id4">|</span></a>chi|2 but that
-requires longer computation time. In order to set a data to a control panel
-(FitPage), see the &quot;DataLoader Help&quot;. Once a data set to the FiPage, select a
-model from the combo box. The default parameters of the model will be display.
-Set initial parameters if need. Check and uncheck parameters to fit/fix. Click
-the <em>'Fit'</em>  button. When the fitting is finished, the resultant parameter
-values will be displayed with the errors. If a error is missing, it generally
-means that the corresponding parameter is not very depending on the model. The
-chisq/Npt_fit and the plot associated with the fit operation will be also
-updated.</p>
-<div class="system-message" id="id3">
-<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">C:/Code/Eclipse_workspace/SasViewTrunk/src/sas/perspectives/fitting/media/fitting_help.rst</tt>, line 73); <em><a href="#id4">backlink</a></em></p>
-Inline substitution_reference start-string without end-string.</div>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id5">
-<span id="simultaneous-fitting"></span><h1>Simultaneous Fitting</h1>
-<p>This fitting option enables to set a number of the constraints between the
-parameters of fitting(s). It requires one or more FitPages with a data and a
-model set for the fitting, and performs multiple fittings given by the
-FitPage(s). The Complex (ParkMC) FitEngine will be used automatically.</p>
-<p>Simultaneous Fit without Constraint</p>
-<p>Assuming some FitPages are already set up, check the checkboxes of the
-model_data rows to fit. And click the 'Fit' button. The results will return to
-each FitPages.</p>
-<p>Note that the chi2/Npts returned is the sum of the chi2/Npts of each fits. If
-one needs the chi2 value only for a page, click the 'Compute' button in the
-FitPage to recalculate.</p>
-<p>Simultaneous Fit with Constraint</p>
-<p>Enter constraint in the text control next to <em>constraint fit</em>  button.
-Constraint should be of type model1 parameter name = f(model2 parameter name)
-for example, M0.radius=2*M1.radius. Many constraints can be entered for a
-single fit. Each of them should be separated by a newline charater or &quot;;&quot;
-The easy setup can generate many constraint inputs easily when the selected
-two models are the same type.</p>
-<p>Note that the chi2/Npts returned is the sum of the chi2/Npts of each fits.
-If one needs the chi2 value only for one fit, click the 'Compute' button in
-the FitPage to recalculate.</p>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id6">
-<span id="batch-fitting"></span><h1>Batch Fitting</h1>
-<p><a class="reference internal" href="#batch-fit">Batch_Fit</a></p>
-<p><a class="reference internal" href="#batch-window">Batch_Window</a></p>
-<p><a class="reference internal" href="#edit-grid">Edit_Grid</a></p>
-<p><a class="reference internal" href="#save-grid">Save_Grid</a></p>
-<p><a class="reference internal" href="#open-batch-results">Open_Batch_Results</a></p>
-<p><a class="reference internal" href="#plot">Plot</a></p>
-<p><a class="reference internal" href="#view-column-cell">View_Column_Cell</a></p>
-</div>
-<div class="section" id="id7">
-<span id="batch-fit"></span><h1>Batch Fit</h1>
-<p>Create a <em>Batch Page</em> by selecting the <em>Batch</em> radio button on the DataExplorer
-(see figure below) and for a new control page select 'New FitPage' in the
-Fitting menubar.</p>
-<img alt="batch_button_area.bmp" src="batch_button_area.bmp" />
-<p>Figure 1: MenuBar:</p>
-<p>Load Data to the DataExplorer if not already loaded.</p>
-<p>Select one or more data sets by checking the check boxes, and then make sure
-that &quot;Fitting&quot; is selected in the dropdown menu next to the &quot;Send To&quot; button.
-Once ready, click the 'Send To' button to set data to a BatchPage. If already
-an empty batch page exists, it will be set there. Otherwise it will create a
-new Batch Page. Set up the model and the parameter values as same as a single
-fitting (see Single Fit help) &lt;<a class="reference internal" href="#single-fit">Single_Fit</a>&gt;. Then use 'Fit' button to
-perform the fitting.</p>
-<p>Unlike a single fit, the results of the fittings will not return to the
-BatchPage'. Instead, a Grid window will be provided once the fitting is
-completed. The Grid window is also accessible from the 'View' menu
-(see Figure 2).</p>
-<p>Note that only one model is used for all the data. The initial parameter
-values given in the control page will be used all the data fittings. If one
-wants the FitEngine to use the initial values from the results of the
-previous data fitting (if any), choose the 'Chain Fitting' option in the
-Fitting menubar, which will speed up the fitting especially when you have
-lots of, and similar, data sets.</p>
-</div>
-<div class="section" id="id8">
-<span id="batch-window"></span><h1>Batch Window</h1>
-<p>Batch Window provides an easy way to view the fit results, i.e., plot data,
-fits, and residuals. Batch window will be automatically shown after a batch
-fit is finished.</p>
-<p>Once closed, it can be opened anytime from the &quot;View&quot; menubar item (see
-Figure 2).</p>
-<img alt="restore_batch_window.bmp" src="restore_batch_window.bmp" />
-<p>Figure 2: Edit Menu:</p>
-</div>
-<div class="section" id="id9">
-<span id="edit-grid"></span><h1>Edit Grid</h1>
-<p>Once a batch fit is completed, all fitted and fixed model parameters are
-displayed to the current sheet of the batch window except the errors of the
-parameters. To view the errors, click on a given column then under <em>Edit</em>
-menubar item, and insert the desired parameter by selecting a menu item with
-the appropriated label. Empty column can be inserted in the same way. A
-column value can be customized by editing an existing empty column.</p>
-<p>To Remove column from the grid, select it, choose edit menu, and click the
-<em>'remove'</em>  menu item. Any removed column should reinserted whenever needed.</p>
-<p>All above options are also available when right clicking on a given column
-label(see Figure 3).</p>
-<p><em>Note:</em>  A column always needs to be selected in order to remove or insert a
-column in the grid.</p>
-<img alt="edit_menu.bmp" src="edit_menu.bmp" />
-<p>Figure 3: Edit Menu:</p>
-</div>
-<div class="section" id="id10">
-<span id="save-grid"></span><h1>Save Grid</h1>
-<p>To save the current page on the batch window, select the <em>'File'</em>  menubar
-item(see Figure 4), then choose the <em>'Save as'</em>  menu item to save it as a
-.csv file.</p>
-<p><em>Note:</em> The grid doesn't save the data array, fits, and the array residuals.
-As a result, the 'View (fit) Results' functionality will be lost when
-reloading the saved file.</p>
-<p>Warning! To ensure accuracy of saved fit results, it is recommended to save
-the current grid before modifying it .</p>
-</div>
-<div class="section" id="id11">
-<span id="open-batch-results"></span><h1>Open Batch Results</h1>
-<p>Any <em>csv</em>  file can be opened in the grid by selecting the <em>'Open'</em>  under
-the <em>'File'</em>  menu in the Grid Window(see Figure 4). All columns in the file
-will be displayed but insertion will not available. Insertion will be
-available only when at least one column will be removed from the grid.</p>
-<img alt="file_menu.bmp" src="file_menu.bmp" />
-<p>Figure 4: MenuBar:</p>
-</div>
-<div class="section" id="id12">
-<span id="plot"></span><h1>Plot</h1>
-<p>To <em>plot</em>  a column versus another, select one column at the time, click the
-<em>'Add'</em>  button next to the text control of X/Y -axis <em>Selection Range</em>  to
-plot the value of this column on the X/Y axis. Alternatively, all available
-range can be selected by clicking the column letter (eg. B). Repeat the same
-procedure the next axis. Finally, click the <em>'Plot'</em>  button. When clicking
-on <em>Add</em>  button, the grid will automatically fill the axis label, but
-different labels and units can be entered in the correct controls before
-clicking on the plot button.</p>
-<p><em>X/Y -Axis Selection Range</em> can be edited manually. These text controls
-allow the following types of expression (operation can be + - * /, or pow)</p>
-<p>1) if the current axis label range is a function of 1 or more columns, write
-this type of expression</p>
-<p>constant1  * column_name1 [minimum row index :  maximum  row index] operator
-constant2 * column_name2 [minimum row index :  maximum  row index]</p>
-<p>Example: radius [2 : 5] -3 * scale [2 : 5]</p>
-<p>2) if only some values of a given column are need but the range between the
-first row and the last row used is not continuous, write the following
-expression in the text control</p>
-<p>column_name1 [minimum row index1 :  maximum  row index1] , column_name1
-[minimum row index2 :  maximum  row index2]</p>
-<p>Example : radius [2 : 5] , radius [10 : 25]</p>
-<p>Note: Both text controls ( X and Y-axis Selection Ranges) need to be filled
-with valid entries for plotting to work. The dY-bar is optional (see Figure 5).</p>
-<img alt="plot_button.bmp" src="plot_button.bmp" />
-<p>Figure 5: Plotting</p>
-</div>
-<div class="section" id="view-column-cell-s">
-<span id="view-column-cell"></span><h1>View Column/Cell(s)</h1>
-<p>Select 1 or more cells from the same column, click the 'View Fits' button to
-display available curves.</p>
-<p>For example, select the cells of the  'Chi2'  column, then click the  'View Fits'
-button. The plots generates will represent the residuals  plots.</p>
-<p>If you select any cells of the 'Data' column and click the 'View Fits' button.
-It generates both  data and fits in the graph (see Figure 6).</p>
-<p>Alternatively, just click the column letter (eg. B) to choose all the
-available data sets, then simply click the 'View Fits' button to plot the
-data and fits.</p>
-<img alt="view_button.bmp" src="view_button.bmp" />
-<p>Figure 6: View Fits</p>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-<p id="model-selection"><a class="reference internal" href="#model-type">Model_Type</a></p>
-<p><a class="reference internal" href="#change-model-parameters">Change_Model_Parameters</a></p>
-<p><a class="reference internal" href="#write-your-own-model">Write_your_Own_Model</a></p>
-</div>
-<div class="section" id="id13">
-<span id="model-type"></span><h1>Model Type</h1>
-<p>Models are grouped into three classes</p>
-<ul class="simple">
-<li><em>Shapes</em></li>
-<li><em>Shape-Independent</em></li>
-<li><em>Uncategorised</em></li>
-<li><em>Customized Models</em></li>
-<li><em>Structure Factor</em></li>
-</ul>
-</div>
-<div class="section" id="id14">
-<span id="change-model-parameters"></span><h1>Change Model Parameters</h1>
-<p>To visualize model in a different window, from menu click on <em>Model</em>. Select
-a type of model and then the name of your model.A new window will appear with
-the plot of your model with default values. Change model's parameters on
-<em>model view</em>  tab and view the plotted model with its new parameters.</p>
-</div>
-<div class="section" id="id15">
-<span id="write-your-own-model"></span><h1>Write your Own Model</h1>
-<p>The custom model editors are provided from 'Fitting' menu in the menu bar.
-See 'Custom model editor' in the side menu on left. Advanced users can write
-your own model and save it (in .py format) into <em>plugin_models</em>  directory in
-.sasview of your home directory (eg., username.sasview&gt;plugin_models). Your
-plugin model will be added into &quot;&lt;&gt;Customized Models&quot; on the next model
-selection.</p>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id16">
-<span id="model-category-manager"></span><h1>Model Category Manager</h1>
-<p>Our SAS models are, by default, classified into 5 categories; shapes,
-shape-independent, structure factor, and customized models, where these
-categories (except the customized models) can be reassigned, added, and
-removed using 'Category Manager'. Each models can also be enabled(shown)/
-disabled(hidden) from the category that they belong. The Category Manager
-panel is accessible from the model category 'Modify' button in the fitting
-panel or the 'View/Category Manager' menu in the menu bar (Fig. 1).</p>
-<p>1) Enable/Disable models: Check/uncheck the check boxes to enable/disable the
-models (Fig. 2).</p>
-<p>2) Change category: Highlight a model in the list by left-clicking and click
-the 'Modify' button. In the 'Change Category' panel, one can create/use a
-category for the model, then click the 'Add' button. In order to delete a
-category, select a category name and click the 'Remove Selected' button
-(Fig. 3).</p>
-<p>3) To apply the changes made, hit the OK button. Otherwise, click the 'Cancel'
-button (Fig. 2).</p>
-<img alt="cat_fig0.bmp" src="cat_fig0.bmp" />
-<p>Fig.1</p>
-<img alt="cat_fig1.bmp" src="cat_fig1.bmp" />
-<p>Fig.2</p>
-<img alt="cat_fig2.bmp" src="cat_fig2.bmp" />
-<p>Fig.3</p>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id17">
-<span id="model-functions"></span><h1>Model Functions</h1>
-<p>Model Documentation &lt;models/model_functions&gt;</p>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id18">
-<span id="custom-model-editor"></span><h1>Custom Model Editor</h1>
-<p><a class="reference internal" href="#description">Description</a></p>
-<p><a class="reference internal" href="#new">New</a></p>
-<p><a class="reference internal" href="#sum-multi-p1-p2">Sum_Multi_p1_p2</a></p>
-<p><a class="reference internal" href="#advanced">Advanced</a></p>
-<p><a class="reference internal" href="#delete">Delete</a></p>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id19">
-<span id="description"></span><h1>Description</h1>
-<p>This menu (Fitting/Edit Custom Model in the menu bar) interface is to provide
-you an easy way to write your own custom models. The changes in a model
-function are effective after it is re-selected from the combo-box menu.</p>
-<img alt="edit_model_menu.bmp" src="edit_model_menu.bmp" />
-</div>
-<div class="section" id="id20">
-<span id="new"></span><h1>New</h1>
-<p>This option is used to make a new model. A model code generated by this option
-can be viewed and further modified by the 'Advanced' option below.</p>
-<img alt="new_model.bmp" src="new_model.bmp" />
-</div>
-<div class="section" id="id21">
-<span id="sum-multi-p1-p2"></span><h1>Sum|Multi(p1,p2)</h1>
-<p>This option create a new sum (or multiplication) model. Fill up the (sum
-model function) name and the description. The description will show up on
-details button in the application. Then select the p1 or p2 model for the
-sum/multi model, select an operator as necessary and click the Apply button
-for activation. Hit the 'Close' button when it's done.</p>
-<img alt="sum_model.bmp" src="sum_model.bmp" />
-</div>
-<div class="section" id="id22">
-<span id="advanced"></span><h1>Advanced</h1>
-<p>The menu option shows all the files in the plugin_models folder. You can edit,
-modify, and save it. It is recommended to modify only the lines with arrow
-(-------). In the end of edit, 'Compile' and 'Run' from the menu bar to
-activate or to see the model working properly.</p>
-</div>
-<div class="section" id="id23">
-<span id="delete"></span><h1>Delete</h1>
-<p>The menu option is to delete the custom models. Just select the file name to
-delete.</p>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id24">
-<span id="polydispersity-distributions"></span><h1>Polydispersity Distributions</h1>
-<p>Calculates the form factor for a polydisperse and/or angular population of
-particles with uniform scattering length density. The resultant form factor
-is normalized by the average particle volume such that</p>
-<p>P(q) = scale*&lt;F*F&gt;/Vol + bkg</p>
-<p>where F is the scattering amplitude and the&lt;&gt;denote an average over the size
-distribution.  Users should use PD (polydispersity: this definition is
-different from the typical definition in polymer science) for a size
-distribution and Sigma for an angular distribution (see below).</p>
-<p>Note that this computation is very time intensive thus applying polydispersion/
-angular distrubtion for more than one paramters or increasing Npts values
-might need extensive patience to complete the computation. Also note that
-even though it is time consuming, it is safer to have larger values of Npts
-and Nsigmas.</p>
-<p>The following five distribution functions are provided</p>
-<ul class="simple">
-<li><em>Rectangular_Distribution_</em></li>
-<li><em>Array_Distribution_</em></li>
-<li><em>Gaussian_Distribution_</em></li>
-<li><em>Lognormal_Distribution_</em></li>
-<li><em>Schulz_Distribution_</em></li>
-</ul>
-</div>
-<div class="section" id="id25">
-<span id="rectangular-distribution"></span><h1>Rectangular Distribution</h1>
-<img alt="pd_image001.png" src="pd_image001.png" />
-<p>The xmean is the mean of the distribution, w is the half-width, and Norm is a
-normalization factor which is determined during the numerical calculation.
-Note that the Sigma and the half width <em>w</em>  are different.</p>
-<p>The standard deviation is</p>
-<img alt="pd_image002.png" src="pd_image002.png" />
-<p>The PD (polydispersity) is</p>
-<img alt="pd_image003.png" src="pd_image003.png" />
-<img alt="pd_image004.jpg" src="pd_image004.jpg" />
-</div>
-<div class="section" id="id26">
-<span id="array-distribution"></span><h1>Array Distribution</h1>
-<p>This distribution is to be given by users as a txt file where the array
-should be defined by two columns in the order of x and f(x) values. The f(x)
-will be normalized by SasView during the computation.</p>
-<p>Example of an array in the file</p>
-<p>30        0.1
-32        0.3
-35        0.4
-36        0.5
-37        0.6
-39        0.7
-41        0.9</p>
-<p>We use only these array values in the computation, therefore the mean value
-given in the control panel, for example Ã¢â¬Ëradius = 60Ã¢â¬â¢, will be ignored.</p>
-</div>
-<div class="section" id="id27">
-<span id="gaussian-distribution"></span><h1>Gaussian Distribution</h1>
-<img alt="pd_image005.png" src="pd_image005.png" />
-<p>The xmean is the mean of the distribution and Norm is a normalization factor
-which is determined during the numerical calculation.</p>
-<p>The PD (polydispersity) is</p>
-<img alt="pd_image003.png" src="pd_image003.png" />
-<img alt="pd_image006.jpg" src="pd_image006.jpg" />
-</div>
-<div class="section" id="id28">
-<span id="lognormal-distribution"></span><h1>Lognormal Distribution</h1>
-<img alt="pd_image007.png" src="pd_image007.png" />
-<p>The /mu/=ln(xmed), xmed is the median value of the distribution, and Norm is a
-normalization factor which will be determined during the numerical calculation.
-The median value is the value given in the size parameter in the control panel,
-for example, Ã¢â¬Åradius = 60Ã¢â¬ï¿œ.</p>
-<p>The PD (polydispersity) is given by /sigma/</p>
-<img alt="pd_image008.png" src="pd_image008.png" />
-<p>For the angular distribution</p>
-<img alt="pd_image009.png" src="pd_image009.png" />
-<p>The mean value is given by xmean=exp(/mu/+p2/2). The peak value is given by
-xpeak=exp(/mu/-p2).</p>
-<img alt="pd_image010.jpg" src="pd_image010.jpg" />
-<p>This distribution function spreads more and the peak shifts to the left as the
-p increases, requiring higher values of Nsigmas and Npts.</p>
-</div>
-<div class="section" id="id29">
-<span id="schulz-distribution"></span><h1>Schulz Distribution</h1>
-<img alt="pd_image011.png" src="pd_image011.png" />
-<p>The xmean is the mean of the distribution and Norm is a normalization factor
-which is determined during the numerical calculation.</p>
-<p>The z = 1/p2Ã¢â¬â 1.</p>
-<p>The PD (polydispersity) is</p>
-<img alt="pd_image012.png" src="pd_image012.png" />
-<p>Note that the higher PD (polydispersity) might need higher values of Npts and
-Nsigmas. For example, at PD = 0.7 and radisus = 60 A, Npts &gt;= 160, and
-Nsigmas &gt;= 15 at least.</p>
-<img alt="pd_image013.jpg" src="pd_image013.jpg" />
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id30">
-<span id="smearing-computation"></span><h1>Smearing Computation</h1>
-<p><a class="reference internal" href="#slit-smearing">Slit_Smearing</a></p>
-<p><a class="reference internal" href="#pinhole-smearing">Pinhole_Smearing</a></p>
-<p><a class="reference internal" href="#d-smearing">2D_Smearing</a></p>
-</div>
-<div class="section" id="id31">
-<span id="slit-smearing"></span><h1>Slit Smearing</h1>
-<p>The sit smeared scattering intensity for SAS is defined by</p>
-<img alt="sm_image002.gif" src="sm_image002.gif" />
-<p>where Norm =</p>
-<img alt="sm_image003.gif" src="sm_image003.gif" />
-<p>Equation 1</p>
-<p>The functions <img alt="inlineimage004" src="sm_image004.gif" /> and <img alt="inlineimage005" src="sm_image005.gif" />
-refer to the slit width weighting function and the slit height weighting
-determined at the q point, respectively. Here, we assumes that the weighting
-function is described by a rectangular function, i.e.,</p>
-<img alt="sm_image006.gif" src="sm_image006.gif" />
-<p>Equation 2</p>
-<p>and</p>
-<img alt="sm_image007.gif" src="sm_image007.gif" />
-<p>Equation 3</p>
-<p>so that <img alt="inlineimage008" src="sm_image008.gif" /> <img alt="inlineimage009" src="sm_image009.gif" /> for <img alt="inlineimage010" src="sm_image010.gif" /> and u.</p>
-<p>The <img alt="inlineimage011" src="sm_image011.gif" /> and <img alt="inlineimage012" src="sm_image012.gif" /> stand for
-the slit height (FWHM/2) and the slit width (FWHM/2) in the q space. Now the
-integral of Equation 1 is simplified to</p>
-<img alt="sm_image013.gif" src="sm_image013.gif" />
-<p>Equation 4</p>
-</div>
-<div class="section" id="numerical-implementation-of-equation-4">
-<h1>Numerical Implementation of Equation 4</h1>
-</div>
-<div class="section" id="case-1">
-<h1>Case 1</h1>
-<p>For <img alt="inlineimage012" src="sm_image012.gif" /> = 0 and <img alt="inlineimage011" src="sm_image011.gif" /> = constant.</p>
-<img alt="sm_image016.gif" src="sm_image016.gif" />
-<p>For discrete q values, at the q values from the data points and at the q
-values extended up to qN= qi + <img alt="inlineimage011" src="sm_image011.gif" /> the smeared
-intensity can be calculated approximately</p>
-<img alt="sm_image017.gif" src="sm_image017.gif" />
-<p>Equation 5</p>
-<p><img alt="inlineimage018" src="sm_image018.gif" /> = 0 for <em>Is</em> in <em>j</em> &lt; <em>i</em> or <em>j</em> &gt; N-1*.</p>
-</div>
-<div class="section" id="case-2">
-<h1>Case 2</h1>
-<p>For <img alt="inlineimage012" src="sm_image012.gif" /> = constant and <img alt="inlineimage011" src="sm_image011.gif" /> = 0.</p>
-<p>Similarly to Case 1, we get</p>
-<p><img alt="inlineimage019" src="sm_image019.gif" /> for qp= qi- <img alt="inlineimage012" src="sm_image012.gif" /> and qN= qi+ <img alt="inlineimage012" src="sm_image012.gif" />. <img alt="inlineimage018" src="sm_image018.gif" /> = 0
-for <em>Is</em> in <em>j</em> &lt; <em>p</em> or <em>j</em> &gt; <em>N-1</em>.</p>
-</div>
-<div class="section" id="case-3">
-<h1>Case 3</h1>
-<p>For <img alt="inlineimage011" src="sm_image011.gif" /> = constant and
-<img alt="inlineimage011" src="sm_image011.gif" /> = constant.</p>
-<p>In this case, the best way is to perform the integration, Equation 1,
-numerically for both slit height and width. However, the numerical integration
-is not correct enough unless given a large number of iteration, say at least
-10000 by 10000 for each element of the matrix, W, which will take minutes and
-minutes to finish the calculation for a set of typical SAS data. An
-alternative way which is correct for slit width &lt;&lt; slit hight, is used in
-SasView. This method is a mixed method that combines method 1 with the
-numerical integration for the slit width.</p>
-<img alt="sm_image020.gif" src="sm_image020.gif" />
-<p>Equation 7</p>
-<p>for qp= qi- <img alt="inlineimage012" src="sm_image012.gif" /> and
-qN= qi+ <img alt="inlineimage012" src="sm_image012.gif" />. <img alt="inlineimage018" src="sm_image018.gif" /> = 0 for
-<em>Is</em> in <em>j</em> &lt; <em>p</em> or <em>j</em> &gt; <em>N-1</em>.</p>
-</div>
-<div class="section" id="id32">
-<span id="pinhole-smearing"></span><h1>Pinhole Smearing</h1>
-<p>The pinhole smearing computation is done similar to the case above except
-that the weight function used is the Gaussian function, so that the Equation 6
-for this case becomes</p>
-<img alt="sm_image021.gif" src="sm_image021.gif" />
-<p>Equation 8</p>
-<p>For all the cases above, the weighting matrix <em>W</em> is calculated when the
-smearing is called at the first time, and it includes the ~ 60 q values
-(finely binned evenly) below (&gt;0) and above the q range of data in order
-to cover all data points of the smearing computation for a given model and
-for a given slit size. The <em>Norm</em>  factor is found numerically with the
-weighting matrix, and considered on <em>Is</em> computation.</p>
-</div>
-<div class="section" id="id33">
-<span id="d-smearing"></span><h1>2D Smearing</h1>
-<p>The 2D smearing computation is done similar to the 1D pinhole smearing above
-except that the weight function used was the 2D elliptical Gaussian function</p>
-<img alt="sm_image022.gif" src="sm_image022.gif" />
-<p>Equation 9</p>
-<p>In Equation 9, x0 = qcos/theta/ and y0 = qsin/theta/, and the primed axes
-are in the coordinate rotated by an angle /theta/ around the z-axis (below)
-so that xÃ¢â¬â¢0= x0cos/theta/+y0sin/theta/ and yÃ¢â¬â¢0= -x0sin/theta/+y0cos/theta/.</p>
-<p>Note that the rotation angle is zero for x-y symmetric elliptical Gaussian
-distribution. The A is a normalization factor.</p>
-<img alt="sm_image023.gif" src="sm_image023.gif" />
-<p>Now we consider a numerical integration where each bins in /theta/ and R are
-<em>evenly</em> (this is to simplify the equation below) distributed by /delta//theta/
-and /delta/R, respectively, and it is assumed that I(xÃ¢â¬â¢, yÃ¢â¬â¢) is constant
-within the bins which in turn becomes</p>
-<img alt="sm_image024.gif" src="sm_image024.gif" />
-<p>Equation 10</p>
-<p>Since we have found the weighting factor on each bin points, it is convenient
-to transform xÃ¢â¬â¢-yÃ¢â¬â¢ back to x-y coordinate (rotating it by -/theta/ around z
-axis). Then, for the polar symmetric smear</p>
-<img alt="sm_image025.gif" src="sm_image025.gif" />
-<p>Equation 11</p>
-<p>where</p>
-<img alt="sm_image026.gif" src="sm_image026.gif" />
-<p>while for the x-y symmetric smear</p>
-<img alt="sm_image027.gif" src="sm_image027.gif" />
-<p>Equation 12</p>
-<p>where</p>
-<img alt="sm_image028.gif" src="sm_image028.gif" />
-<p>Here, the current version of the SasView uses Equation 11 for 2D smearing
-assuming that all the Gaussian weighting functions are aligned in the polar
-coordinate.</p>
-<p>In the control panel, the higher accuracy indicates more and finer binnng
-points so that it costs more in time.</p>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id34">
-<span id="polarisation-magnetic-scattering"></span><h1>Polarisation/Magnetic Scattering</h1>
-<p>Magnetic scattering is implemented in five (2D) models</p>
-<ul class="simple">
-<li><em>SphereModel</em></li>
-<li><em>CoreShellModel</em></li>
-<li><em>CoreMultiShellModel</em></li>
-<li><em>CylinderModel</em></li>
-<li><em>ParallelepipedModel</em></li>
-</ul>
-<p>In general, the scattering length density (SLD) in each regions where the
-SLD (=/beta/) is uniform, is a combination of the nuclear and magnetic SLDs and
-depends on the spin states of the neutrons as follows. For magnetic scattering,
-only the magnetization component, <em>M*perp, perpendicular to the scattering
-vector *Q</em> contributes to the the magnetic scattering length.</p>
-<img alt="mag_vector.bmp" src="mag_vector.bmp" />
-<p>The magnetic scattering length density is then</p>
-<img alt="dm_eq.gif" src="dm_eq.gif" />
-<p>where /gamma/ = -1.913 the gyromagnetic ratio, /mu/B is the Bohr magneton, r0
-is the classical radius of electron, and <em>/sigma/</em> is the Pauli spin. For
-polarised neutron, the magnetic scattering is depending on the spin states.</p>
-<p>Let's consider that the incident neutrons are polarized parallel (+)/
-anti-parallel (-) to the x' axis (See both Figures above). The possible
-out-coming states then are + and - states for both incident states</p>
-<p>Non-spin flips: (+ +) and (- -)
-Spin flips:     (+ -) and (- +)</p>
-<img alt="M_angles_pic.bmp" src="M_angles_pic.bmp" />
-<p>Now, let's assume that the angles of the <em>Q</em>  vector and the spin-axis (x')
-against x-axis are /phi/ and /theta/up, respectively (See Figure above). Then,
-depending upon the polarisation (spin) state of neutrons, the scattering length
-densities, including the nuclear scattering length density (/beta/N) are given
-as, for non-spin-flips</p>
-<img alt="sld1.gif" src="sld1.gif" />
-<p>for spin-flips</p>
-<img alt="sld2.gif" src="sld2.gif" />
-<p>where</p>
-<img alt="mxp.gif" src="mxp.gif" />
-<img alt="myp.gif" src="myp.gif" />
-<img alt="mzp.gif" src="mzp.gif" />
-<img alt="mqx.gif" src="mqx.gif" />
-<img alt="mqy.gif" src="mqy.gif" />
-<p>Here, the M0x, M0y and M0z are the x, y and z components of the magnetization
-vector given in the xyz lab frame. The angles of the magnetization, /theta/M
-and /phi/M as defined in the Figure (above)</p>
-<img alt="m0x_eq.gif" src="m0x_eq.gif" />
-<img alt="m0y_eq.gif" src="m0y_eq.gif" />
-<img alt="m0z_eq.gif" src="m0z_eq.gif" />
-<p>The user input parameters are M0_sld = DMM0, Up_theta = /theta/up,
-M_theta = /theta/M, and M_phi = /phi/M. The 'Up_frac_i' and 'Up_frac_f' are
-the ratio</p>
-<p>(spin up)/(spin up + spin down)</p>
-<p>neutrons before the sample and at the analyzer, respectively.</p>
-<p><em>Note:</em> The values of the 'Up_frac_i' and 'Up_frac_f' must be in the range
-between 0 and 1.</p>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id35">
-<span id="key-combinations"></span><h1>Key Combinations</h1>
-<p><a class="reference internal" href="#copy-paste">Copy_Paste</a></p>
-<p><a class="reference internal" href="#bookmark">Bookmark</a></p>
-<p><a class="reference internal" href="#graph-context-menu">Graph_Context_Menu</a></p>
-<p><a class="reference internal" href="#ftolerance">FTolerance</a></p>
-</div>
-<div class="section" id="id36">
-<span id="copy-paste"></span><h1>Copy &amp; Paste</h1>
-<p>To copy the parameter values in a Fit(Model) panel to the clipboard:</p>
-<p><em>Ctrl(Cmd on MAC) + Left(Mouse)Click</em>  on the panel.</p>
-<p>To paste the parameter values to a Fit(Model)panel from the clipboard:</p>
-<p><em>Ctrl(Cmd on MAC) + Shift + Left(Mouse)Click</em>  on the panel.</p>
-<p>If this operation is successful, it will say so in the info line at the
-bottom of the SasView window.</p>
-</div>
-<div class="section" id="id37">
-<span id="bookmark"></span><h1>Bookmark</h1>
-<p>Bookmark of a fit-panel or model-panel status:</p>
-<p><em>(Mouse)Right-Click</em>  and select the bookmark in the popup list.</p>
-</div>
-<div class="section" id="id38">
-<span id="graph-context-menu"></span><h1>Graph Context Menu</h1>
-<p>To get the graph context menu to print, copy, save data, (2D)average, etc.:</p>
-<p><em>Locate the mouse point on the plot to highlight and *(Mouse) Right Click</em>
-to bring up the full menu.</p>
-</div>
-<div class="section" id="ftolerance-scipy">
-<span id="ftolerance"></span><h1>FTolerance (SciPy)</h1>
-<p>To change the ftol value of the Scipy FitEngine (leastsq):</p>
-<p>First, make sure that the Fit panel has data and a model selected.</p>
-<p><em>Ctrl(Cmd on MAC) + Shift + Alt + Right(Mouse)Click</em>  on the panel.</p>
-<p>Then, set up the value in the dialog panel.</p>
-<p>If this operation is successful, the new ftol value will be displayed in the
-info line at the bottom of the SV window.Note that increasing the ftol value
-may cause for the fitting to terminate with higher <a href="#id39"><span class="problematic" id="id40">|</span></a>chi|sq.</p>
-<div class="system-message" id="id39">
-<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">C:/Code/Eclipse_workspace/SasViewTrunk/src/sas/perspectives/fitting/media/fitting_help.rst</tt>, line 947); <em><a href="#id40">backlink</a></em></p>
-Inline substitution_reference start-string without end-string.</div>
-<!-- ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -->
-</div>
-<div class="section" id="id41">
-<span id="status-bar-help"></span><h1>Status Bar Help</h1>
-<p><a class="reference internal" href="#message-warning-hint">Message_Warning_Hint</a></p>
-<p><a class="reference internal" href="#console">Console</a></p>
-</div>
-<div class="section" id="id42">
-<span id="message-warning-hint"></span><h1>Message/Warning/Hint</h1>
-<p>The status bar located at the bottom of the application frame, displays
-messages, hints, warnings and errors.</p>
-</div>
-<div class="section" id="id43">
-<span id="console"></span><h1>Console</h1>
-<p>Select <em>light bulb/info icon</em>  button in the status bar at the bottom of the
-application window to display available history. During a long task, the
-console can also help users to understand the status in progressing.</p>
-</div>
-</div>
-</body>
-</html>
