Index: src/sas/perspectives/calculator/media/data_operator_help.html
===================================================================
--- src/sas/perspectives/calculator/media/data_operator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/perspectives/calculator/media/data_operator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
@@ -0,0 +1,35 @@
+<html>
+<body>
+<h4>Data Operator</h4>
+<ul>
+<li><a href="#Description">Description</a></li>
+<li><a href="#Howto">Howto?</a></li>
+</ul>
+<h5><a name="Description">Description</a></h5>
+<p>
+This dialog panel provides arithmetic operations between two data sets (the last data set could be a number): <br> 
+When the data1 and data2 are selected, their x (or qx and qy for 2D) values must match with each other.
+</p>
+
+<h5><a name="Howto">Howto?</a></h5>
+<p>
+1) Type the data name resulted from an operation.<br>
+2) Select a data/theory in the drop down menus. When the data2 is set to number,
+ type a number in the text control box. <br>
+3) Select an arithmetic operator symbol; + (for addition), - (for subtraction), 
+* (for multiplication), / (for division), and | (for combination of two data sets).
+If two data sets are not match, the operation will fail and the background 
+color of the combo box items will turn to red (WIN only).<br>
+4) If the operation is successful, hit the Apply button to make the new data.
+Then the data name will be shown up in the data box in the data explorer.<br>
+Note: The errors and warnings will be displayed at the bottom of the SansView window. 
+</p> 
+<p>
+<img src="data_oper_pic.png">
+<br>
+Data operation dialog
+</p>
+
+</body>
+
+</html>
Index: src/sas/perspectives/calculator/media/density_calculator_help.html
===================================================================
--- src/sas/perspectives/calculator/media/density_calculator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/perspectives/calculator/media/density_calculator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
@@ -0,0 +1,33 @@
+<html>
+<body>
+<h4>Mass Density Calculator</h4>
+<ul>
+<li><a href="#Description">Description</a></li>
+<li><a href="#HowTo">HowTo?</a></li>
+</ul>
+<h5><a name="Description">Description</a></h5>
+<p>
+This tool is to calculate the mass density from the molar volume or vice versa.
+To calculate the mass density, the chemical formula and molar volume should be
+provided.
+</p>
+
+
+<h5><a name="HowTo">HowTo?</a></h5>
+<p>
+1. Molecular Formula: The chemical formula of ONE molecule or ONE atom. For mixtures,
+the ratio of the each molecules should be used; for example, (H2O)0.5(D2O)0.5.
+</p>
+<p>
+2. Select input (molar volume or mass density) from combobox. Then type in the input value.</p>
+<p>
+3. Click the 'Calculate' button to perform the calculation.
+</p>
+<p>
+4. Outputs also include the molar mass (weight) that depends only on the chemical formula
+</p>
+<p><img src="density_tutor.gif">
+</p>
+</body>
+
+</html>
Index: src/sas/perspectives/calculator/media/gen_sans_help.html
===================================================================
--- src/sas/perspectives/calculator/media/gen_sans_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/perspectives/calculator/media/gen_sans_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
@@ -0,0 +1,147 @@
+<body>
+<h4>Generic Scattering Calculator:</h4>
+Polarization and Magnetic Scattering
+<br>
+<br>
+<ul>
+<li><a href="#theory">Theory:</a></li>
+<li><a href="#gui">GUI</a></li>
+<li><a href="#pdb">PDB Data</a></li>
+</ul>
+<br>
+<br>
+<b>1. <a name="theory">Theory</a> </b>
+<br>
+In general, a particle with a volume V can be described by an ensemble containing N 
+3-dimensional rectangular pixels where each pixels are much smaller than V. 
+Assuming that
+all the pixel sizes are same, the elastic scattering intensity 
+by the particle 
+<p>
+<img src="gen_i.gif"/>
+</p>
+<br>
+where &#946;<sub>j</sub> and r<sub>j</sub> are the scattering 
+length density and the position 
+of the j'th pixel respectively. And the total volume
+<p>
+<img src="v_j.gif"/>
+</p>
+<br>
+for &#946;<sub>j</sub> &#8800; 0 where v<sub>j</sub> is the volume of the j'th pixel 
+(or the j'th natural atomic volume (= atomic mass/natural molar density/Avogadro number) 
+ for the atomic structures). The total volume V can be corrected by users. 
+This correction is useful especially for an atomic structure (taken from a pdb file) to get the right 
+normalization. Note that the  &#946;<sub>j</sub> displayed in GUI may be incorrect but will not 
+affect the scattering computation if the correction of the total volume is made.
+<br>
+The scattering length density (SLD) of each pixel where the SLD is uniform, is a combination of the nuclear and magnetic SLDs 
+and depends on the spin states of the neutrons as follows:
+<br>
+<br>
+For magnetic scattering, only the magnetization component, <b>M</b><sub>perp</sub>, 
+perpendicular to the scattering vector <b>Q</b> contributes to the the magnetic 
+scattering length. (Figure below).
+<p>
+<img src="mag_vector.bmp"/>
+</p>
+<br>
+The magnetic scattering length density is then
+<p>
+<img src="dm_eq.gif"/>
+</p>
+<br>
+where &#947; = -1.913 the gyromagnetic ratio,  	&#956;<sub>B</sub> is the Bohr magneton, 
+r<sub>0</sub> is the classical radius of electron, 
+and <b>&#963;</b> is the Pauli spin.
+<br>
+For polarized neutron, the magnetic scattering is depending on the spin states.
+Let's consider that the incident neutrons are polarized parallel (+)/anti-parallel 
+(&#8211;) to the x' axis (See both Figures above).
+The possible out-coming states then are + and - states for both incident states.
+<br>
+ - Non-spin-flips:  	(+ +) and  	(- -)
+<br>
+ - Spin-flips:  	(+ -) and  	(- +)
+<br>
+<p>
+<img src="gen_mag_pic.bmp"/>
+</p>
+<br>
+<br>
+Now, let's assume that the angles of the <b>Q</b> vector and the spin-axis (x') from x-axis 
+are &#966; and  &#952;<sub>up</sub>, respectively (See Figure above).
+Then, depending upon the polarization (spin) state of neutrons, the scattering length
+densities , including the nuclear scattering length density (&#946; <sub>N</sub>) are given as, for non-spin-flips,
+<p>
+<img src="sld1.gif"/>
+</p>
+<br>
+<br>
+for spin-flips,
+<p>
+<img src="sld2.gif"/>
+</p>
+<br>
+<br>
+where
+<p>
+<img src="mxp.gif"/>
+</p>
+<p>
+<img src="myp.gif"/>
+</p>
+<p>
+<img src="mzp.gif"/>
+</p>
+<p>
+<img src="mqx.gif"/>
+</p>
+<p>
+<img src="mqy.gif"/>
+</p>
+<br>
+<br>
+Here, the M<sub>0x</sub>, M<sub>0y</sub> and M<sub>0z</sub> are the x, y and z 
+components of the magnetization vector given in the xyz lab frame.
+<br>
+<br>
+<b>2. <a name="gui">GUI</a> </b>
+<br>
+<p>
+<img src="gen_gui_help.bmp"/>
+</p>
+<br>
+<p>
+After the computation, the result will be listed in the 'Theory' box 
+in the data explorer panel on the main window.
+<br>
+The 'Up_frac_in' and 'Up_frac_out' are the ratio, (spin up) /(spin up + spin down) neutrons 
+before the sample and at the analyzer, respectively.
+</p>
+<br>
+*Note I: The values of 'Up_frac_in' and 'Up_frac_out' must be in the range between 0 and 1.
+For example, both values are 0.5 for unpolarized neutrons.
+<br>
+*Note II: This computation is totally based on the pixel (or atomic) data fixed
+in the xyz coordinates. Thus no angular orientational averaging is considered.
+<br>
+*Note III: For the nuclear scattering length density, only the real component is taken account.
+<br>
+<br>
+<b>3. <a name="pdb">PDB Data</a> </b>
+<br>
+This Generic scattering calculator also supports some pdb files without considering polarized/magnetic scattering
+ so that the related parameters such as Up_*** will be ignored (see the Picture below). The calculation for fixed orientation uses (the first) Equation above resulting 
+in a 2D output, whileas the scattering calculation averaged over all the orientations uses the Debye equation providing a 1D output:
+ <p>
+<img src="gen_debye_eq.gif"/>
+</p>
+<br>
+where v<sub>j</sub>&#946;<sub>j</sub> &#8801; b<sub>j</sub> is the scattering length of the j'th atom.
+The resultant outputs will be displayed in the DataExporer for further uses. 
+<br>
+ <p>
+<img src="pdb_combo.jpg"/>
+</p>
+</body>
Index: src/sas/perspectives/calculator/media/kiessig_calculator_help.html
===================================================================
--- src/sas/perspectives/calculator/media/kiessig_calculator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/perspectives/calculator/media/kiessig_calculator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
@@ -0,0 +1,27 @@
+<html>
+<body>
+<h4>Kiessig Thickness Calculator</h4>
+<ul>
+<li><a href="#Description">Description:</a></li>
+<li><a href="#HowTo">HowTo?</a></li>
+
+</ul>
+<h5><a name="Description">Description</a></h5>
+<p>
+This tool is to approximately estimate the thickness of a layer
+ or the diameter of particles from the Kiessig fringe in 
+ SANS/NR data, and uses the Kiessig relation;
+ thickness = 2*Pi/fringe_width.
+  
+</p>
+
+
+<h5><a name="HowTo">HowTo?</a></h5>
+<p>
+To get a rough thickness or particle size, just type the Kiessig fringe width (in the 1/A unit)
+ and click on the 'Compute' button. Then the output value will be show up in the 'Thickness' text box.</p>
+
+
+</body>
+
+</html>
Index: src/sas/perspectives/calculator/media/load_image_help.html
===================================================================
--- src/sas/perspectives/calculator/media/load_image_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/perspectives/calculator/media/load_image_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
@@ -0,0 +1,48 @@
+<body>
+<h4>Image Viewer</h4>
+<ul>
+<li><a href="#Description">Description</a></li>
+<li><a href="#HowTo">HowTo?</a></li>
+</ul>
+<h5><a name="Description">Description</a></h5>
+<p>
+This tool is to load image files (in the format of png, bmp, gif, jpg, or tif) 
+and to display it in the x-y coordinate (against the pixel number). The displayed plot then
+ can be saved, printed, and copied. 
+ The plot can also be resized by dragging the corner of the panel. 
+</p>
+
+
+<h5><a name="HowTo">HowTo?</a></h5>
+<p>
+1. Select 'Image Viewer' under 'Tool' menu in the menubar.
+</p>
+<p>
+2. Select a file type from the drop-box at the bottom of the file dialog panel, 
+choose a file of interest, and then click the 'Open' button (See Picture below).</p>
+<p>
+<img src="load_image.bmp">
+</p>
+<p>
+3. If the loading is successful, the image will be displayed in the x-y coordinate. 
+The file name will be shown in the title bar (See Picture below). 
+</p>
+<p>
+4. Some options such as Saving, printing, and copying are available from the menubar, 
+or in the popup-menu by right-mouse-clicking anywhere in the plot (See Picture below).
+</p>
+<p><img src="pic_plot.bmp">
+</p>
+<p>
+5. If the image is taken from a 2D detector, it can be converted to our 2D data where 
+the z values are computed by the Eq. z = 0.299R + 0.587G + 0.114B unless the picture file
+is formatted in an 8 bit Grey-Scale tif. In the "Convert to Data" dialog, users set 
+the proper values in the text boxes and then click the OK button to close and to send the data generated to the Data
+ Explorer in the SasView main window. The "Cancel" button will just close the dialog 
+ (See Picture below).
+</p>
+
+<p><img src="pic_convert.bmp">
+</p>
+<br>
+</body>
Index: src/sas/perspectives/calculator/media/pycrust_help.html
===================================================================
--- src/sas/perspectives/calculator/media/pycrust_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/perspectives/calculator/media/pycrust_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
@@ -0,0 +1,36 @@
+<html>
+<body>
+<h4>Python (PyCrust) Shell</h4>
+<ul>
+<li><a href="#description">Description</a></li>
+<li><a href="#example">Example</a></li>
+</ul>
+<h5><a name="description">Description</a></h5>
+<p>
+This is a python shell (PyCrust) provided with WxPython. 
+An editing notebook will show up when a Python file is loaded from the 'New' or 'Open' menu.
+The 'Run' menu is added for the editor to be able to compile and run the python code. 
+</p>
+<br/>
+For the details about the Python, visit the website, http://docs.python.org/tutorial/.
+<br/>
+The numpy, scipy, matplotlib, etc. are shipped with the SanView. 
+<br/>
+However, some functionalities of those packages may or may not work. 
+<br/>
+The PyCrust includes its own Help menu in the shell window.
+<br/>
+Note: Help(), Credits(), ... do not work on MAC.
+<br/>
+
+<p>
+<h5><a name="example">Example</a></h5>
+</p>
+<p>
+An example from the matplotlib gallery: 
+</p> 
+<img src="pycrust_example.bmp"/>
+
+</body>
+
+</html>
Index: src/sas/perspectives/calculator/media/resolution_calculator_help.html
===================================================================
--- src/sas/perspectives/calculator/media/resolution_calculator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/perspectives/calculator/media/resolution_calculator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
@@ -0,0 +1,83 @@
+<html>
+<body>
+<h4>SANS Q Resolution Estimator</h4>
+<ul>
+<li><a href="#Description">Description</a></li>
+<li><a href="#HowTo">HowTo?</a></li>
+<li><a href="#Theory">Theory</a></li>
+<li><a href="#References">References</a></li>
+</ul>
+<h5><a name="Description">Description</a></h5>
+<p>
+This tool is to approximately estimate the resolution of Q based on the
+SANS instrumental parameter values assuming that the detector is flat 
+and vertical to the incident beam direction.
+</p>
+
+
+<h5><a name="HowTo">HowTo?</a></h5>
+<p>
+1. Select the source and source type (Monochromatic or TOF). 
+Note that the computational difference between the sources is 
+only the gravitational contribution due to the mass.</p>
+<p>
+2. Change the default values of the instrumental parameters as desired.</p>
+<p>
+3. The input formats of wavelength and its spread (=FWHM/wavelength) depend on the source type.
+<li>For monochromatic wave, the inputs are just one values as shown with the defaults.</li>
+<li>For TOF, the min and max values should be separated by "-" to describe the wavelength band range.
+Optionally, the input of the wavelength (NOT of the wavelength spread) 
+could be extended by adding "; ##" where the ## is the number 
+of the bins for the numerical integration.
+Otherwise, the default value "10" bins will be used. 
+The same number of bins will be used for the corresponding wavelength spread in either cases.</li>
+</p>
+<p>4. For TOF, the default wavelength spectrum is flat. 
+The custom spectrum file (with 2 column text: wavelength(A) vs. intensity) 
+can also be loaded by selecting "Add new" in the combobox.</p>
+<p>
+5. Once set all the input values, click the compute button. 
+Depending on computation loads the calculation time will vary.
+</p>
+<p> 
+6. 1D and 2D dQ will be displayed in the text-box at the bottom of 
+the panel. Two dimensional resolution weight distribution 
+(2D elliptical Gaussian function) will also be 
+displayed in the plot panel even if the Q inputs are outside 
+of the detector limit.
+The red lines indicate the limits of the detector (if a green lines appear (for TOF), 
+it indicates the limits of the maximum q range for the largest wavelength 
+due to the size of the detector). Note that the effect from the beam block is ignored, 
+so in the small q region near the beam block [ie., q < 2*pi*(beam block diameter) / (sample to detector distance) / lamda_min] 
+the variance is slightly under estimated.</p>
+<p>7. The summary can be accessed by clicking the 'light-bulb' icon 
+at the bottom of the SansView main window.
+</p>
+<p><img src="resolution_tutor.gif">
+</p>
+<h5><a name="Theory">Theory</a></h5>
+<p>
+The scattering wave transfer vector is by definition,
+<img src="q.gif">
+</p>
+<p>In the limit of the small angle, the variance of q in the first order approximation is</p>
+<p>
+<img src="sigma_q.gif">
+</p>
+In summary, the geometric and gravitational contributions depending on the shape of each factors can be expressed  
+as shown the table.</p>
+<p>
+<img src="sigma_table.gif">
+</p>
+<p>
+Finally, we use a Gaussian function to describe the 2D weighting distribution of the uncertainty in q.
+</p>
+<p/>
+<h5><a name="References">References</a></h5>
+<p>
+D.F.R. Mildner and J.M. Carpenter, J. Appl. Cryst. 17, 249-256 (1984).</p>
+<p>
+D.F.R. Mildner, J.M. Carpenter and D.L. Worcester, J. Appl. Cryst. 19, 311-319 (1986).</p>
+</body>
+
+</html>
Index: src/sas/perspectives/calculator/media/sld_calculator_help.html
===================================================================
--- src/sas/perspectives/calculator/media/sld_calculator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/perspectives/calculator/media/sld_calculator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
@@ -0,0 +1,42 @@
+<html>
+<body>
+<h4>Scattering Length Density (SLD) Calculator</h4>
+<ul>
+<li><a href="#SLD_calculator">Description</a></li>
+<li><a href="#How to use">How to format the compound name?</a></li>
+</ul>
+<h5><a name="SLD_calculator">Description</a></h5>
+<p>
+The neutron scattering length density is defined as: <br> 
+SLD = (b_c1 +b_c2+...+b_cn )/Vm  <br> where b_ci is the bound coherent scattering length of ith of 
+n atoms in a molecule with the molecular volume Vm
+</p>
+
+
+<h5><a name="How to use">How to format the compound name?</a></h5>
+<p>
+To calculate scattering length densities enter a compound and
+a mass density and click "Calculate". Enter a wavelength value is optional and its default 
+value will be 6.0A.
+</p> 
+<p>
+<ul>
+<li>Formula strings consist of counts and atoms such as "CaCO3+6H2O".</li>
+<li>Groups can be separated by <b>'+'</b> or <b>space</b>, so "CaCO3 6H2O" works as well.</li>
+<li>Groups and be defined using parentheses, such as "CaCO3(H2O)6".</li>
+<li>Parentheses can nest: "(CaCO3(H2O)6)1".</li>
+<li>Isotopes are represented by index, e.g., "CaCO[18]3+6H2O".</li>
+More examples: H[1], H[2].
+<li>Counts can be integer or decimal, e.g. "CaCO3+(3HO0.5)2".</li>
+Other compositions can be calculated as well,<br>
+for example a 70-30 mixture of H2O/D2O can be written as <b>H14O7+ D6O3</b><br>
+or more simply <b>H7D3O5 <\b>(i.e. 7 hydrogens, 3 deuteriums, and 5 oxygens)<br>
+and the mass density calculated based on the percentages of H and D. 
+Type for example "C[13]6 H[2]12 O[18]6" for C(13)6H(2)12O(18)6 (6 Carbon-13 atoms, 12 deuterium atoms, and 6 Oxygen-18 atoms) 
+
+</ul>
+</p>
+
+</body>
+
+</html>
Index: src/sas/perspectives/calculator/media/slit_calculator_help.html
===================================================================
--- src/sas/perspectives/calculator/media/slit_calculator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/perspectives/calculator/media/slit_calculator_help.html	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
@@ -0,0 +1,33 @@
+<html>
+<body>
+<h4>Slit Size Calculator</h4>
+<ul>
+<li><a href="#Description">Description:</a></li>
+<li><a href="#HowTo">HowTo?</a></li>
+<li><a href="#Note">Note</a></li>
+</ul>
+<h5><a name="Description">Description</a></h5>
+<p>
+This tool is for X-ray users to calculate the slit size (FWHM/2) 
+for smearing  based on their half beam profile data (SAXSess). 
+</p>
+
+
+<h5><a name="HowTo">HowTo?</a></h5>
+<p>
+To calculate the slit size (FWHM/2), just load the beam profile data using the browse button. </p>
+<p>
+Once a data is loaded, the slit size will be computed and show up in the text box. </p>
+<p>
+Because the unit is not specified in the data file, we do not convert it into 1/A so that users are responsible for converting the unit.
+</p>
+
+<h5><a name="Note">Note: </a></h5>
+This slit size calculator is working only for a beam profile data produced by 'SAXSess'. 
+
+<p>
+To see the file format, check the file, 'beam profile.DAT', in the 'test' folder of SansView. 
+</p>
+</body>
+
+</html>
