Changeset 5ed76f8 in sasview


Ignore:
Timestamp:
Apr 7, 2017 1:11:41 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
fca1f50
Parents:
727c05f
Message:

docs: use latex in equations rather than unicode + rst markup

Location:
src/sas
Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/calculator/sas_gen.py

    r9a5097c r5ed76f8  
    909909    def set_sldms(self, sld_mx, sld_my, sld_mz): 
    910910        r""" 
    911         Sets (\|m\|, m_theta, m_phi) 
    912         """ 
     911        Sets mx, my, mz and abs(m). 
     912        """ # Note: escaping 
    913913        if sld_mx.__class__.__name__ == 'float': 
    914914            self.sld_mx = np.ones(len(self.pos_x)) * sld_mx 
  • src/sas/sasgui/guiframe/media/graph_help.rst

    rf9b0c81 r5ed76f8  
    99 
    1010SasView generates three different types of graph window: one that displays *1D data* 
    11 (ie, I(Q) vs Q), one that displays *1D residuals* (ie, the difference between the 
    12 experimental data and the theory at the same Q values), and *2D color maps*. 
     11(i.e., $I(Q)$ vs $Q$), one that displays *1D residuals* (ie, the difference between the 
     12experimental data and the theory at the same $Q$ values), and *2D color maps*. 
    1313 
    1414Graph window options 
     
    4242plot window. 
    4343 
    44 .. note::  
     44.. note:: 
    4545    *If a residuals graph (when fitting data) is hidden, it will not show up 
    4646    after computation.* 
     
    138138style and size. *Remove Text* will remove the last annotation added. To change 
    139139the legend. *Window Title* allows a custom title to be entered instead of Graph 
    140 x.  
     140x. 
    141141 
    142142Changing scales 
     
    226226^^^^^^^^^^^^^^^^^^^ 
    227227 
    228 Linear fit performs a simple ( y(x)=ax+b ) linear fit within the plot window. 
     228Linear fit performs a simple $y(x)=ax+b$ linear fit within the plot window. 
    229229 
    230230In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Linear Fit*. A 
     
    234234 
    235235This option is most useful for performing simple Guinier, XS Guinier, and 
    236 Porod type analyses, for example, to estimate Rg, a rod diameter, or incoherent 
     236Porod type analyses, for example, to estimate $R_g$, a rod diameter, or incoherent 
    237237background level, respectively. 
    238238 
     
    319319^^^^^^^^^^^^^^^^^^^^^^^^^ 
    320320 
    321 This operation will perform an average in constant Q-rings around the (x,y) 
     321This operation will perform an average in constant $Q$ rings around the (x,y) 
    322322pixel location of the beam center. 
    323323 
     
    331331^^^^^^^^^^^^^^^^^^^^^^^ 
    332332 
    333 This operation averages in constant Q-arcs. 
    334  
    335 The width of the sector is specified in degrees (+/- |delta|\|phi|\) each side 
    336 of the central angle (|phi|\). 
    337  
    338 Annular average [|phi| View] 
    339 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
    340  
    341 This operation performs an average between two Q-values centered on (0,0), 
     333This operation averages in constant $Q$ arcs. 
     334 
     335The width of the sector is specified in degrees ($\pm\delta|\phi|$) each side 
     336of the central angle $\phi$. 
     337 
     338Annular average [:math:`\phi`] 
     339^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
     340 
     341This operation performs an average between two $Q$ values centered on (0,0), 
    342342and averaged over a specified number of pixels. 
    343343 
    344 The data is returned as a function of angle (|phi|\) in degrees with zero 
     344The data is returned as a function of angle $\phi$ in degrees with zero 
    345345degrees at the 3 O'clock position. 
    346346 
     
    356356^^^^^^^^^^^^^^^^^^^ 
    357357 
    358 This operation computes an average I(Qx) for the region of interest. 
     358This operation computes an average $I(Q_x)$ for the region of interest. 
    359359 
    360360When editing the slicer parameters, the user can control the length and the 
    361361width the rectangular slicer. The averaged output is calculated from constant 
    362 bins with rectangular shape. The resultant Q values are nominal values, that 
     362bins with rectangular shape. The resultant $Q$ values are nominal values, that 
    363363is, the central value of each bin on the x-axis. 
    364364 
     
    366366^^^^^^^^^^^^^^^^^^^ 
    367367 
    368 This operation computes an average I(Qy) for the region of interest. 
     368This operation computes an average $I(Q_y)$ for the region of interest. 
    369369 
    370370When editing the slicer parameters, the user can control the length and the 
    371371width the rectangular slicer. The averaged output is calculated from constant 
    372 bins with rectangular shape. The resultant Q values are nominal values, that 
     372bins with rectangular shape. The resultant $Q$ values are nominal values, that 
    373373is, the central value of each bin on the x-axis. 
    374374 
  • src/sas/sasgui/perspectives/calculator/media/kiessig_calculator_help.rst

    r7805458 r5ed76f8  
    1010----------- 
    1111 
    12 This tool is approximately estimates the thickness of a layer or the diameter  
    13 of particles from the position of the Kiessig fringe/Bragg peak in NR/SAS data  
    14 using the relation 
     12This tool estimates real space dimensions from the position or spacing of 
     13features in recipricol space.  In particular a particle of size $d$ will 
     14give rise to Bragg peaks with spacing $\Delta q$ according to the relation 
    1515 
    16 (thickness *or* size) = 2 * |pi| / (fringe_width *or* peak position) 
    17    
     16.. math:: 
     17 
     18    d = 2\pi / \Delta q 
     19 
     20Similarly, the spacing between the peaks in Kiessig fringes in reflectometry 
     21data arise from layers of thickness $d$. 
     22 
    1823.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    1924 
     
    2126-------------- 
    2227 
    23 To get a rough thickness or particle size, simply type the fringe or peak  
     28To get a rough thickness or particle size, simply type the fringe or peak 
    2429position (in units of 1/|Ang|\) and click on the *Compute* button. 
    2530 
    2631.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    2732 
    28 .. note::  This help document was last changed by Steve King, 01May2015 
    29  
     33.. note::  This help document was last changed by Paul Kienzle, 05Apr2017 
  • src/sas/sasgui/perspectives/calculator/media/resolution_calculator_help.rst

    r6aad2e8 r5ed76f8  
    1010----------- 
    1111 
    12 This tool is approximately estimates the resolution of Q from SAS instrumental  
    13 parameter values assuming that the detector is flat and normal to the  
     12This tool is approximately estimates the resolution of $Q$ from SAS instrumental 
     13parameter values assuming that the detector is flat and normal to the 
    1414incident beam. 
    1515 
     
    23232) Select the source (Neutron or Photon) and source type (Monochromatic or TOF). 
    2424 
    25    *NOTE! The computational difference between the sources is only the  
     25   *NOTE! The computational difference between the sources is only the 
    2626   gravitational contribution due to the mass of the particles.* 
    2727 
    28 3) Change the default values of the instrumental parameters as required. Be  
     283) Change the default values of the instrumental parameters as required. Be 
    2929   careful to note that distances are specified in cm! 
    3030 
    31 4) Enter values for the source wavelength(s), |lambda|\ , and its spread (= FWHM/|lambda|\ ). 
    32     
    33    For monochromatic sources, the inputs are just one value. For TOF sources,  
    34    the minimum and maximum values should be separated by a '-' to specify a  
     314) Enter values for the source wavelength(s), $\lambda$, and its spread (= $\text{FWHM}/\lambda$). 
     32 
     33   For monochromatic sources, the inputs are just one value. For TOF sources, 
     34   the minimum and maximum values should be separated by a '-' to specify a 
    3535   range. 
    36     
    37    Optionally, the wavelength (BUT NOT of the wavelength spread) can be extended  
    38    by adding '; nn' where the 'nn' specifies the number of the bins for the  
    39    numerical integration. The default value is nn = 10. The same number of bins  
     36 
     37   Optionally, the wavelength (BUT NOT of the wavelength spread) can be extended 
     38   by adding '; nn' where the 'nn' specifies the number of the bins for the 
     39   numerical integration. The default value is nn = 10. The same number of bins 
    4040   will be used for the corresponding wavelength spread. 
    4141 
    42 5) For TOF, the default wavelength spectrum is flat. A custom spectral  
    43    distribution file (2-column text: wavelength (|Ang|\) vs Intensity) can also  
     425) For TOF, the default wavelength spectrum is flat. A custom spectral 
     43   distribution file (2-column text: wavelength (|Ang|\) vs Intensity) can also 
    4444   be loaded by selecting *Add new* in the combo box. 
    4545 
    46 6) When ready, click the *Compute* button. Depending on the computation the  
     466) When ready, click the *Compute* button. Depending on the computation the 
    4747   calculation time will vary. 
    4848 
    49 7) 1D and 2D dQ values will be displayed at the bottom of the panel, and a 2D  
    50    resolution weight distribution (a 2D elliptical Gaussian function) will also  
    51    be displayed in the plot panel even if the Q inputs are outside of the  
     497) 1D and 2D $dQ$ values will be displayed at the bottom of the panel, and a 2D 
     50   resolution weight distribution (a 2D elliptical Gaussian function) will also 
     51   be displayed in the plot panel even if the $Q$ inputs are outside of the 
    5252   detector limit (the red lines indicate the limits of the detector). 
    53     
    54    TOF only: green lines indicate the limits of the maximum Q range accessible  
     53 
     54   TOF only: green lines indicate the limits of the maximum $Q$ range accessible 
    5555   for the longest wavelength due to the size of the detector. 
    56      
    57    Note that the effect from the beam block/stop is ignored, so in the small Q  
    58    region near the beam block/stop  
    5956 
    60    [ie., Q < 2. |pi|\ .(beam block diameter) / (sample-to-detector distance) / |lambda|\_min]  
     57   Note that the effect from the beam block/stop is ignored, so in the small $Q$ 
     58   region near the beam block/stop 
     59 
     60   [i.e., $Q < (2 \pi \cdot \text{beam block diameter}) / (\text{sample-to-detector distance} \cdot \lambda_\text{min})$] 
    6161 
    6262   the variance is slightly under estimated. 
    6363 
    64 8) A summary of the calculation is written to the SasView *Console* at the  
     648) A summary of the calculation is written to the SasView *Console* at the 
    6565   bottom of the main SasView window. 
    6666 
     
    7676.. image:: q.png 
    7777 
    78 In the small-angle limit, the variance of Q is to a first-order  
     78In the small-angle limit, the variance of $Q$ is to a first-order 
    7979approximation 
    8080 
     
    8585.. image:: sigma_table.png 
    8686 
    87 Finally, a Gaussian function is used to describe the 2D weighting distribution  
    88 of the uncertainty in Q. 
     87Finally, a Gaussian function is used to describe the 2D weighting distribution 
     88of the uncertainty in $Q$. 
    8989 
    9090.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    9393---------- 
    9494 
    95 D.F.R. Mildner and J.M. Carpenter  
     95D.F.R. Mildner and J.M. Carpenter 
    9696*J. Appl. Cryst.* 17 (1984) 249-256 
    9797 
    98 D.F.R. Mildner, J.M. Carpenter and D.L. Worcester  
     98D.F.R. Mildner, J.M. Carpenter and D.L. Worcester 
    9999*J. Appl. Cryst.* 19 (1986) 311-319 
    100100 
  • src/sas/sasgui/perspectives/calculator/media/sas_calculator_help.rst

    r6aad2e8 r5ed76f8  
    1919------ 
    2020 
    21 In general, a particle with a volume *V* can be described by an ensemble  
    22 containing *N* 3-dimensional rectangular pixels where each pixel is much  
    23 smaller than *V*. 
     21In general, a particle with a volume $V$ can be described by an ensemble 
     22containing $N$ 3-dimensional rectangular pixels where each pixel is much 
     23smaller than $V$. 
    2424 
    25 Assuming that all the pixel sizes are the same, the elastic scattering  
     25Assuming that all the pixel sizes are the same, the elastic scattering 
    2626intensity from the particle is 
    2727 
     
    3030Equation 1. 
    3131 
    32 where |beta|\ :sub:`j` and *r*\ :sub:`j` are the scattering length density and  
    33 the position of the j'th pixel respectively. 
     32where $\beta_j$ and $r_j$ are the scattering length density and 
     33the position of the $j^\text{th}$ pixel respectively. 
    3434 
    35 The total volume *V* 
     35The total volume $V$ 
    3636 
    37 .. image:: v_j.png 
     37.. math:: 
    3838 
    39 for |beta|\ :sub:`j` |noteql|\0 where *v*\ :sub:`j` is the volume of the j'th  
    40 pixel (or the j'th natural atomic volume (= atomic mass / (natural molar  
     39    V = \sum_j^N v_j 
     40 
     41for $\beta_j \ne 0$ where $v_j$ is the volume of the $j^\text{th}$ 
     42pixel (or the $j^\text{th}$ natural atomic volume (= atomic mass / (natural molar 
    4143density * Avogadro number) for the atomic structures). 
    4244 
    43 *V* can be corrected by users. This correction is useful especially for an  
    44 atomic structure (such as taken from a PDB file) to get the right normalization.  
     45$V$ can be corrected by users. This correction is useful especially for an 
     46atomic structure (such as taken from a PDB file) to get the right normalization. 
    4547 
    46 *NOTE!* |beta|\ :sub:`j` *displayed in the GUI may be incorrect but this will not  
     48*NOTE! $\beta_j$ displayed in the GUI may be incorrect but this will not 
    4749affect the scattering computation if the correction of the total volume V is made.* 
    4850 
    49 The scattering length density (SLD) of each pixel, where the SLD is uniform, is  
    50 a combination of the nuclear and magnetic SLDs and depends on the spin states  
     51The scattering length density (SLD) of each pixel, where the SLD is uniform, is 
     52a combination of the nuclear and magnetic SLDs and depends on the spin states 
    5153of the neutrons as follows. 
    5254 
     
    5456^^^^^^^^^^^^^^^^^^^ 
    5557 
    56 For magnetic scattering, only the magnetization component, *M*\ :sub:`perp`\ ,  
    57 perpendicular to the scattering vector *Q* contributes to the magnetic  
     58For magnetic scattering, only the magnetization component, $M_\perp$, 
     59perpendicular to the scattering vector $Q$ contributes to the magnetic 
    5860scattering length. 
    5961 
     
    6466.. image:: dm_eq.png 
    6567 
    66 where the gyromagnetic ratio |gamma| = -1.913, |mu|\ :sub:`B` is the Bohr  
    67 magneton, *r*\ :sub:`0` is the classical radius of electron, and |sigma| is the  
     68where the gyromagnetic ratio is $\gamma = -1.913$, $\mu_B$ is the Bohr 
     69magneton, $r_0$ is the classical radius of electron, and $\sigma$ is the 
    6870Pauli spin. 
    6971 
    7072For a polarized neutron, the magnetic scattering is depending on the spin states. 
    7173 
    72 Let us consider that the incident neutrons are polarised both parallel (+) and   
    73 anti-parallel (-) to the x' axis (see below). The possible states after  
    74 scattering from the sample are then  
     74Let us consider that the incident neutrons are polarised both parallel (+) and 
     75anti-parallel (-) to the x' axis (see below). The possible states after 
     76scattering from the sample are then 
    7577 
    7678*  Non-spin flips: (+ +) and (- -) 
     
    7981.. image:: gen_mag_pic.png 
    8082 
    81 Now let us assume that the angles of the *Q* vector and the spin-axis (x')  
    82 to the x-axis are |phi| and |theta|\ :sub:`up` respectively (see above). Then,  
    83 depending upon the polarization (spin) state of neutrons, the scattering  
    84 length densities, including the nuclear scattering length density (|beta|\ :sub:`N`\ )  
     83Now let us assume that the angles of the *Q* vector and the spin-axis (x') 
     84to the x-axis are $\phi$ and $\theta_\text{up}$ respectively (see above). Then, 
     85depending upon the polarization (spin) state of neutrons, the scattering 
     86length densities, including the nuclear scattering length density ($\beta_N$) 
    8587are given as 
    8688 
     
    105107.. image:: mqy.png 
    106108 
    107 Here the *M0*\ :sub:`x`\ , *M0*\ :sub:`y` and *M0*\ :sub:`z` are the x, y and z  
    108 components of the magnetisation vector in the laboratory xyz frame.  
     109Here the $M0_x$, $M0_y$ and $M0_z$ are the $x$, $y$ and $z$ 
     110components of the magnetisation vector in the laboratory $xyz$ frame. 
    109111 
    110112.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    115117.. image:: gen_gui_help.png 
    116118 
    117 After computation the result will appear in the *Theory* box in the SasView   
     119After computation the result will appear in the *Theory* box in the SasView 
    118120*Data Explorer* panel. 
    119121 
    120 *Up_frac_in* and *Up_frac_out* are the ratio  
     122*Up_frac_in* and *Up_frac_out* are the ratio 
    121123 
    122124   (spin up) / (spin up + spin down) 
    123     
     125 
    124126of neutrons before the sample and at the analyzer, respectively. 
    125127 
    126 *NOTE 1. The values of* Up_frac_in *and* Up_frac_out *must be in the range  
     128*NOTE 1. The values of* Up_frac_in *and* Up_frac_out *must be in the range 
    1271290.0 to 1.0. Both values are 0.5 for unpolarized neutrons.* 
    128130 
    129 *NOTE 2. This computation is totally based on the pixel (or atomic) data fixed  
     131*NOTE 2. This computation is totally based on the pixel (or atomic) data fixed 
    130132in xyz coordinates. No angular orientational averaging is considered.* 
    131133 
    132 *NOTE 3. For the nuclear scattering length density, only the real component  
     134*NOTE 3. For the nuclear scattering length density, only the real component 
    133135is taken account.* 
    134136 
     
    139141 
    140142The SANS Calculator tool can read some PDB, OMF or SLD files but ignores 
    141 polarized/magnetic scattering when doing so, thus related parameters such as  
     143polarized/magnetic scattering when doing so, thus related parameters such as 
    142144*Up_frac_in*, etc, will be ignored. 
    143145 
    144 The calculation for fixed orientation uses Equation 1 above resulting in a 2D  
    145 output, whereas the scattering calculation averaged over all the orientations  
     146The calculation for fixed orientation uses Equation 1 above resulting in a 2D 
     147output, whereas the scattering calculation averaged over all the orientations 
    146148uses the Debye equation below providing a 1D output 
    147149 
    148150.. image:: gen_debye_eq.png 
    149151 
    150 where *v*\ :sub:`j` |beta|\ :sub:`j` |equiv| *b*\ :sub:`j` is the scattering  
    151 length of the j'th atom. The calculation output is passed to the *Data Explorer*  
     152where $v_j \beta_j \equiv b_j$ is the scattering 
     153length of the $j^\text{th}$ atom. The calculation output is passed to the *Data Explorer* 
    152154for further use. 
    153155 
  • src/sas/sasgui/perspectives/calculator/media/sld_calculator_help.rst

    rf93b473f r5ed76f8  
    1010----------- 
    1111 
    12 The neutron scattering length density (SLD) is defined as 
     12The neutron scattering length density (SLD, $\beta_N$) is defined as 
    1313 
    14   SLD = (b_c1 + b_c2 + ... + b_cn) / Vm 
     14.. math:: 
    1515 
    16 where b_ci is the bound coherent scattering length of ith of n atoms in a molecule 
    17 with the molecular volume Vm 
     16  \beta_N = (b_{c1} + b_{c2} + ... + b_{cn}) / V_m 
     17 
     18where $b_{ci}$ is the bound coherent scattering length of ith of n atoms in a molecule 
     19with the molecular volume $V_m$. 
    1820 
    1921.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    2224---------------------------- 
    2325 
    24 To calculate scattering length densities enter the empirical formula of a  
     26To calculate scattering length densities enter the empirical formula of a 
    2527compound and its mass density and click "Calculate". 
    2628 
    27 Entering a wavelength value is optional (a default value of 6.0 |Ang| will  
     29Entering a wavelength value is optional (a default value of 6.0 |Ang| will 
    2830be used). 
    2931 
     
    3840*  Parentheses can be nested, such as "(CaCO3(H2O)6)1". 
    3941 
    40 *  Isotopes are represented by their atomic number in *square brackets*, such  
     42*  Isotopes are represented by their atomic number in *square brackets*, such 
    4143   as "CaCO[18]3+6H2O", H[1], or H[2]. 
    4244 
    4345*  Numbers of atoms can be integer or decimal, such as "CaCO3+(3HO0.5)2". 
    4446 
    45 *  The SLD of mixtures can be calculated as well. For example, for a 70-30  
     47*  The SLD of mixtures can be calculated as well. For example, for a 70-30 
    4648   mixture of H2O/D2O write "H14O7+D6O3" or more simply "H7D3O5" (i.e. this says 
    4749   7 hydrogens, 3 deuteriums, and 5 oxygens) and enter a mass density calculated 
    4850   on the percentages of H2O and D2O. 
    4951 
    50 *  Type "C[13]6 H[2]12 O[18]6" for C(13)6H(2)12O(18)6 (6 Carbon-13 atoms, 12  
     52*  Type "C[13]6 H[2]12 O[18]6" for C(13)6H(2)12O(18)6 (6 Carbon-13 atoms, 12 
    5153   deuterium atoms, and 6 Oxygen-18 atoms). 
    52     
     54 
    5355.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    5456 
    55 .. note::  This help document was last changed by Steve King, 01May2015 
     57.. note::  This help document was last changed by Paul Kienzle, 05Apr2017 
    5658 
  • src/sas/sasgui/perspectives/calculator/media/slit_calculator_help.rst

    rf93b473f r5ed76f8  
    1111----------- 
    1212 
    13 This tool enables X-ray users to calculate the slit size (FWHM/2) for smearing  
     13This tool enables X-ray users to calculate the slit size (FWHM/2) for smearing 
    1414based on their half beam profile data. 
    1515 
    1616*NOTE! Whilst it may have some more generic applicability, the calculator has 
    17 only been tested with beam profile data from Anton-Paar SAXSess*\ |TM|\   
    18 *software.* 
     17only been tested with beam profile data from Anton-Paar SAXSess:sup:`TM` software.* 
    1918 
    2019.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    27262) Load a beam profile file in the *Data* field using the *Browse* button. 
    2827 
    29    *NOTE! To see an example of the beam profile file format, visit the file  
     28   *NOTE! To see an example of the beam profile file format, visit the file 
    3029   beam profile.DAT in your {installation_directory}/SasView/test folder.* 
    3130 
    32 3) Once a data is loaded, the slit size is automatically computed and displayed  
     313) Once a data is loaded, the slit size is automatically computed and displayed 
    3332   in the tool window. 
    3433 
    35 *NOTE! The beam profile file does not carry any information about the units of  
     34*NOTE! The beam profile file does not carry any information about the units of 
    3635the Q data. This calculator assumes the data has units of 1/\ |Ang|\ . If the 
    3736data is not in these units it must be manually converted beforehand.* 
  • src/sas/sasgui/perspectives/fitting/media/fitting_help.rst

    r6aad2e8 r5ed76f8  
    381381 
    382382In the bottom left corner of the *Fit Page* is a box displaying the normalised value 
    383 of the statistical |chi|\  :sup:`2` parameter returned by the optimiser. 
     383of the statistical $\chi^2$ parameter returned by the optimiser. 
    384384 
    385385Now check the box for another model parameter and click *Fit* again. Repeat this 
     
    387387fit of the theory to the experimental data improves the value of 'chi2/Npts' will 
    388388decrease. A good model fit should easily produce values of 'chi2/Npts' that are 
    389 close to zero, and certainly <100. See :ref:`Assessing_Fit_Quality`. 
     389close to one, and certainly <100. See :ref:`Assessing_Fit_Quality`. 
    390390 
    391391SasView has a number of different optimisers (see the section :ref:`Fitting_Options`). 
  • src/sas/sasgui/perspectives/fitting/media/mag_help.rst

    r6aad2e8 r5ed76f8  
    2020-------------------------------- 
    2121 
    22 Magnetic scattering is implemented in five (2D) models  
     22Magnetic scattering is implemented in five (2D) models 
    2323 
    2424*  *sphere* 
     
    2828*  *parallelepiped* 
    2929 
    30 In general, the scattering length density (SLD, = |beta|) in each region where the 
     30In general, the scattering length density (SLD, = $\beta$) in each region where the 
    3131SLD is uniform, is a combination of the nuclear and magnetic SLDs and, for polarised 
    3232neutrons, also depends on the spin states of the neutrons. 
    3333 
    34 For magnetic scattering, only the magnetization component, *M*\ :sub:`perp`, 
    35 perpendicular to the scattering vector *Q* contributes to the the magnetic 
     34For magnetic scattering, only the magnetization component, $M_\perp$, 
     35perpendicular to the scattering vector $Q$ contributes to the the magnetic 
    3636scattering length. 
    3737 
     
    4242.. image:: dm_eq.png 
    4343 
    44 where |gamma| = -1.913 is the gyromagnetic ratio, |mu|\ :sub:`B` is the 
    45 Bohr magneton, *r*\ :sub:`0` is the classical radius of electron, and |sigma| 
     44where $\gamma = -1.913$ is the gyromagnetic ratio, $\mu_B$ is the 
     45Bohr magneton, $r_0$ is the classical radius of electron, and $\sigma$ 
    4646is the Pauli spin. 
    4747 
     
    5555.. image:: M_angles_pic.png 
    5656 
    57 If the angles of the *Q* vector and the spin-axis (*x'*) to the *x*-axis are |phi| 
    58 and |theta|\ :sub:`up`, respectively, then, depending on the spin state of the 
     57If the angles of the $Q$ vector and the spin-axis (*x'*) to the *x*-axis are $\phi$ 
     58and $\theta_\text{up}$, respectively, then, depending on the spin state of the 
    5959neutrons, the scattering length densities, including the nuclear scattering 
    60 length density (|beta|\ :sub:`N`) are 
     60length density ($\beta_N$) are 
    6161 
    6262.. image:: sld1.png 
     
    7878.. image:: mqy.png 
    7979 
    80 Here, *M*\ :sub:`0x`, *M*\ :sub:`0y` and *M*\ :sub:`0z` are the x, y and z components 
    81 of the magnetization vector given in the laboratory xyz frame given by 
     80Here, $M_{0x}$, $M_{0y}$ and $M_{0z}$ are the $x$, $y$ and $z$ components 
     81of the magnetization vector given in the laboratory $xyz$ frame given by 
    8282 
    8383.. image:: m0x_eq.png 
     
    8787.. image:: m0z_eq.png 
    8888 
    89 and the magnetization angles |theta|\ :sub:`M` and |phi|\ :sub:`M` are defined in 
     89and the magnetization angles $\theta_M$ and $\phi_M$ are defined in 
    9090the figure above. 
    9191 
     
    9393 
    9494===========   ================================================================ 
    95  M0_sld        = *D*\ :sub:`M` *M*\ :sub:`0` 
    96  Up_theta      = |theta|\ :sub:`up` 
    97  M_theta       = |theta|\ :sub:`M` 
    98  M_phi         = |phi|\ :sub:`M` 
     95 M0_sld        = $D_M M_0$ 
     96 Up_theta      = $\theta_\text{up}$ 
     97 M_theta       = $\theta_M$ 
     98 M_phi         = $\phi_M$ 
    9999 Up_frac_i     = (spin up)/(spin up + spin down) neutrons *before* the sample 
    100100 Up_frac_f     = (spin up)/(spin up + spin down) neutrons *after* the sample 
  • src/sas/sasgui/perspectives/fitting/media/pd_help.rst

    r6aad2e8 r5ed76f8  
    2424form factor is normalized by the average particle volume such that 
    2525 
    26 *P(q) = scale* * \ <F*\F> / *V + bkg* 
     26.. math:: 
    2727 
    28 where F is the scattering amplitude and the \<\> denote an average over the size 
    29 distribution. 
     28    P(q) = \text{scale} \langle F^*F rangle V + \text{background} 
     29 
     30where $F$ is the scattering amplitude and $\langle\cdot\rangle$ denotes an average 
     31over the size distribution. 
    3032 
    3133Users should note that this computation is very intensive. Applying polydispersion 
     
    5759.. image:: pd_image001.png 
    5860 
    59 where *xmean* is the mean of the distribution, *w* is the half-width, and *Norm* is a 
    60 normalization factor which is determined during the numerical calculation. 
     61where $x_{mean}$ is the mean of the distribution, $w$ is the half-width, and $Norm$ 
     62is a normalization factor which is determined during the numerical calculation. 
    6163 
    62 Note that the standard deviation and the half width *w* are different! 
     64Note that the standard deviation and the half width $w$ are different! 
    6365 
    6466The standard deviation is 
     
    8183.. image:: pd_image005.png 
    8284 
    83 where *xmean* is the mean of the distribution and *Norm* is a normalization factor 
     85where $x_{mean}$ is the mean of the distribution and $Norm$ is a normalization factor 
    8486which is determined during the numerical calculation. 
    8587 
     
    100102.. image:: pd_image007.png 
    101103 
    102 where |mu|\ =ln(*xmed*), *xmed* is the median value of the distribution, and 
    103 *Norm* is a normalization factor which will be determined during the numerical 
     104where $\mu=\ln(x_{med})$, $x_{med}$ is the median value of the distribution, and 
     105$Norm$ is a normalization factor which will be determined during the numerical 
    104106calculation. 
    105107 
     
    107109size parameter in the *FitPage*, for example, radius = 60. 
    108110 
    109 The polydispersity is given by |sigma| 
     111The polydispersity is given by $\sigma$ 
    110112 
    111113.. image:: pd_image008.png 
     
    115117.. image:: pd_image009.png 
    116118 
    117 The mean value is given by *xmean*\ =exp(|mu|\ +p\ :sup:`2`\ /2). The peak value 
    118 is given by *xpeak*\ =exp(|mu|-p\ :sup:`2`\ ). 
     119The mean value is given by $x_{mean} =\exp(\mu + p^2 /2)$. The peak value 
     120is given by $x_{peak} =\exp(\mu-p^2)$. 
    119121 
    120122.. image:: pd_image010.jpg 
    121123 
    122 This distribution function spreads more, and the peak shifts to the left, as *p* 
     124This distribution function spreads more, and the peak shifts to the left, as $p$ 
    123125increases, requiring higher values of Nsigmas and Npts. 
    124126 
     
    132134.. image:: pd_image011.png 
    133135 
    134 where *xmean* is the mean of the distribution and *Norm* is a normalization factor 
    135 which is determined during the numerical calculation, and *z* is a measure of the 
     136where $x_{mean}$ is the mean of the distribution and $Norm$ is a normalization factor 
     137which is determined during the numerical calculation, and $z$ is a measure of the 
    136138width of the distribution such that 
    137139 
    138 z = (1-p\ :sup:`2`\ ) / p\ :sup:`2` 
     140.. math:: 
     141 
     142    z = (1-p^2 ) / p^2 
    139143 
    140144The polydispersity is 
     
    156160 
    157161This user-definable distribution should be given as as a simple ASCII text file 
    158 where the array is defined by two columns of numbers: *x* and *f(x)*. The *f(x)* 
     162where the array is defined by two columns of numbers: $x$ and $f(x)$. The $f(x)$ 
    159163will be normalized by SasView during the computation. 
    160164 
     
    172176 
    173177SasView only uses these array values during the computation, therefore any mean 
    174 value of the parameter represented by *x* present in the *FitPage* 
     178value of the parameter represented by $x$ present in the *FitPage* 
    175179will be ignored. 
    176180 
     
    181185 
    182186Many commercial Dynamic Light Scattering (DLS) instruments produce a size 
    183 polydispersity parameter, sometimes even given the symbol *p*! This parameter is 
     187polydispersity parameter, sometimes even given the symbol $p$! This parameter is 
    184188defined as the relative standard deviation coefficient of variation of the size 
    185189distribution and is NOT the same as the polydispersity parameters in the Lognormal 
  • src/sas/sasgui/perspectives/fitting/media/residuals_help.rst

    r7805458 r5ed76f8  
    1818also provides two other measures of the quality of a fit: 
    1919 
    20 |chi|\  :sup:`2` (or 'Chi2'; pronounced 'chi-squared') 
     20$\chi^2$ (or 'Chi2'; pronounced 'chi-squared') 
    2121*  *Residuals* 
    2222 
     
    3232*Npts* such that 
    3333 
    34   *Chi2/Npts* = { SUM[(*Y_i* - *Y_theory_i*)^2 / (*Y_error_i*)^2] } / *Npts* 
     34.. math:: 
    3535 
    36 This differs slightly from what is sometimes called the 'reduced chi-squared' 
     36  \chi^2/N_{pts} =  \sum[(Y_i - Y_{theory}_i)^2 / (Y_error_i)^2] } / N_{pts} 
     37 
     38This differs slightly from what is sometimes called the 'reduced $\chi^2$' 
    3739because it does not take into account the number of fitting parameters (to 
    38 calculate the number of 'degrees of freedom'), but the 'normalized chi-squared' 
    39 and the 'reduced chi-squared' are very close to each other when *Npts* >> number of 
    40 parameters. 
     40calculate the number of 'degrees of freedom'), but the 'normalized $\chi^2$ 
     41and the 'reduced $\chi^2$ are very close to each other when $N_{pts} \gg 
     42\text{number of parameters}. 
    4143 
    42 For a good fit, *Chi2/Npts* tends to 0. 
     44For a good fit, $\chi^2/N_{pts}$ tends to 1. 
    4345 
    44 *Chi2/Npts* is sometimes referred to as the 'goodness-of-fit' parameter. 
     46$\chi^2/N_{pts}$ is sometimes referred to as the 'goodness-of-fit' parameter. 
    4547 
    4648.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    5355value and its *true* value is its error). 
    5456 
    55 *SasView* calculates 'normalized residuals', *R_i*, for each data point in the 
     57*SasView* calculates 'normalized residuals', $R_i$, for each data point in the 
    5658fit: 
    5759 
    58   *R_i* = (*Y_i* - *Y_theory_i*) / (*Y_err_i*) 
     60.. math:: 
    5961 
    60 For a good fit, *R_i* ~ 0. 
     62  R_i = (Y_i - Y_theory_i) / (Y_err_i) 
     63 
     64For a good fit, $R_i \sim 0$. 
    6165 
    6266.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
  • src/sas/sasgui/perspectives/fitting/media/sm_help.rst

    r6aad2e8 r5ed76f8  
    2020================== 
    2121 
    22 Sometimes the instrumental geometry used to acquire the experimental data has  
    23 an impact on the clarity of features in the reduced scattering curve. For  
    24 example, peaks or fringes might be slightly broadened. This is known as  
    25 *Q resolution smearing*. To compensate for this effect one can either try and  
    26 remove the resolution contribution - a process called *desmearing* - or add the  
    27 resolution contribution into a model calculation/simulation (which by definition  
    28 will be exact) to make it more representative of what has been measured  
     22Sometimes the instrumental geometry used to acquire the experimental data has 
     23an impact on the clarity of features in the reduced scattering curve. For 
     24example, peaks or fringes might be slightly broadened. This is known as 
     25*Q resolution smearing*. To compensate for this effect one can either try and 
     26remove the resolution contribution - a process called *desmearing* - or add the 
     27resolution contribution into a model calculation/simulation (which by definition 
     28will be exact) to make it more representative of what has been measured 
    2929experimentally - a process called *smearing*. SasView will do the latter. 
    3030 
    31 Both smearing and desmearing rely on functions to describe the resolution  
     31Both smearing and desmearing rely on functions to describe the resolution 
    3232effect. SasView provides three smearing algorithms: 
    3333 
     
    3636*  *2D Smearing* 
    3737 
    38 SasView also has an option to use Q resolution data (estimated at the time of  
     38SasView also has an option to use $Q$ resolution data (estimated at the time of 
    3939data reduction) supplied in a reduced data file: the *Use dQ data* radio button. 
    4040 
     
    4343dQ Smearing 
    4444----------- 
    45   
    46 If this option is checked, SasView will assume that the supplied dQ values  
     45 
     46If this option is checked, SasView will assume that the supplied $dQ$ values 
    4747represent the standard deviations of Gaussian functions. 
    4848 
     
    6565**[Equation 1]** 
    6666 
    67 The functions |inlineimage004| and |inlineimage005| 
    68 refer to the slit width weighting function and the slit height weighting  
    69 determined at the given *q* point, respectively. It is assumed that the weighting 
     67The functions $W_v(v)$ and $W_u(u)$ 
     68refer to the slit width weighting function and the slit height weighting 
     69determined at the given $q$ point, respectively. It is assumed that the weighting 
    7070function is described by a rectangular function, such that 
    7171 
     
    8080**[Equation 3]** 
    8181 
    82 so that |inlineimage008| |inlineimage009| for |inlineimage010| and *u*\ . 
    83  
    84 Here |inlineimage011| and |inlineimage012| stand for 
    85 the slit height (FWHM/2) and the slit width (FWHM/2) in *q* space. 
     82so that $\Delta q_\alpha = \int_0^\infty d\alpha W_\alpha(\alpha)$ 
     83for $\alpha = v$ and $u$. 
     84 
     85Here $\Delta q_u$ and $\Delta q_v$ stand for 
     86the slit height (FWHM/2) and the slit width (FWHM/2) in $q$ space. 
    8687 
    8788This simplifies the integral in Equation 1 to 
     
    9192**[Equation 4]** 
    9293 
    93 which may be solved numerically, depending on the nature of |inlineimage011| and |inlineimage012| . 
     94which may be solved numerically, depending on the nature of 
     95$\Delta q_u$ and $\Delta q_v$. 
    9496 
    9597Solution 1 
    9698^^^^^^^^^^ 
    9799 
    98 **For** |inlineimage012| **= 0 and** |inlineimage011| **= constant.** 
     100**For $\Delta q_v= 0$ and $\Delta q_u = \text{constant}$.** 
    99101 
    100102.. image:: sm_image016.png 
    101103 
    102 For discrete *q* values, at the *q* values of the data points and at the *q* 
    103 values extended up to *q*\ :sub:`N`\ = *q*\ :sub:`i` + |inlineimage011| the smeared 
     104For discrete $q$ values, at the $q$ values of the data points and at the $q$ 
     105values extended up to $q_N = q_i + \Delta q_u$ the smeared 
    104106intensity can be approximately calculated as 
    105107 
     
    108110**[Equation 5]** 
    109111 
    110 where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *i* or *j* > *N-1*. 
     112where |inlineimage018| = 0 for $I_s$ when $j < i$ or $j > N-1$. 
    111113 
    112114Solution 2 
    113115^^^^^^^^^^ 
    114116 
    115 **For** |inlineimage012| **= constant and** |inlineimage011| **= 0.** 
     117**For $\Delta q_v = \text{constant}$ and $\Delta q_u= 0$.** 
    116118 
    117119Similar to Case 1 
    118120 
    119 |inlineimage019| for *q*\ :sub:`p` = *q*\ :sub:`i` - |inlineimage012| and *q*\ :sub:`N` = *q*\ :sub:`i` + |inlineimage012| 
     121|inlineimage019| for $q_p = q_i - \Delta q_v$ and $q_N = q_i + \Delta q_v$ 
    120122 
    121123**[Equation 6]** 
    122124 
    123 where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *p* or *j* > *N-1*. 
     125where |inlineimage018| = 0 for $I_s$ when $j < p$ or $j > N-1$. 
    124126 
    125127Solution 3 
    126128^^^^^^^^^^ 
    127129 
    128 **For** |inlineimage011| **= constant and** |inlineimage011| **= constant.** 
     130**For $\Delta q_u = \text{constant}$ and $\Delta q_v = \text{constant}$.** 
    129131 
    130132In this case, the best way is to perform the integration of Equation 1 
     
    142144**[Equation 7]** 
    143145 
    144 for *q*\ :sub:`p` = *q*\ :sub:`i` - |inlineimage012| and *q*\ :sub:`N` = *q*\ :sub:`i` + |inlineimage012| 
    145  
    146 where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *p* or *j* > *N-1*. 
     146for *q_p = q_i - \Delta q_v$ and $q_N = q_i + \Delta q_v$ 
     147where |inlineimage018| = 0 for *I_s$ when $j < p$ or $j > N-1$. 
    147148 
    148149.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    175176**[Equation 9]** 
    176177 
    177 In Equation 9, *x*\ :sub:`0` = *q* cos(|theta|), *y*\ :sub:`0` = *q* sin(|theta|), and 
    178 the primed axes, are all in the coordinate rotated by an angle |theta| about 
    179 the z-axis (see the figure below) so that *x'*\ :sub:`0` = *x*\ :sub:`0` cos(|theta|) + 
    180 *y*\ :sub:`0` sin(|theta|) and *y'*\ :sub:`0` = -*x*\ :sub:`0` sin(|theta|) + 
    181 *y*\ :sub:`0` cos(|theta|). Note that the rotation angle is zero for a x-y symmetric 
    182 elliptical Gaussian distribution. The *A* is a normalization factor. 
     178In Equation 9, $x_0 = q \cos(\theta)$, $y_0 = q \sin(\theta)$, and 
     179the primed axes, are all in the coordinate rotated by an angle $\theta$ about 
     180the z-axis (see the figure below) so that 
     181$x'_0 = x_0 \cos(\theta) + y_0 \sin(\theta)$ and 
     182$y'_0 = -x_0 \sin(\theta) + y_0 \cos(\theta)$. 
     183Note that the rotation angle is zero for a $xy$ symmetric 
     184elliptical Gaussian distribution. The $A$ is a normalization factor. 
    183185 
    184186.. image:: sm_image023.png 
    185187 
    186 Now we consider a numerical integration where each of the bins in |theta| and *R* are 
    187 *evenly* (this is to simplify the equation below) distributed by |bigdelta|\ |theta| 
    188 and |bigdelta|\ R, respectively, and it is further assumed that *I(x',y')* is constant 
     188Now we consider a numerical integration where each of the bins in $\theta$ and $R$ are 
     189*evenly* (this is to simplify the equation below) distributed by $\Delta \theta$ 
     190and $\Delta R$, respectively, and it is further assumed that $I(x',y')$ is constant 
    189191within the bins. Then 
    190192 
     
    194196 
    195197Since the weighting factor on each of the bins is known, it is convenient to 
    196 transform *x'-y'* back to *x-y* coordinates (by rotating it by -|theta| around the 
    197 *z* axis). 
     198transform $x'y'$ back to $xy$ coordinates (by rotating it by $-\theta$ around the 
     199$z$ axis). 
    198200 
    199201Then, for a polar symmetric smear 
     
    207209.. image:: sm_image026.png 
    208210 
    209 while for a *x-y* symmetric smear 
     211while for a $xy$ symmetric smear 
    210212 
    211213.. image:: sm_image027.png 
     
    225227------------------------- 
    226228 
    227 In all the cases above, the weighting matrix *W* is calculated on the first call 
    228 to a smearing function, and includes ~60 *q* values (finely and evenly binned) 
    229 below (>0) and above the *q* range of data in order to smear all data points for 
    230 a given model and slit/pinhole size. The *Norm*  factor is found numerically with the 
    231 weighting matrix and applied on the computation of *I*\ :sub:`s`. 
     229In all the cases above, the weighting matrix $W$ is calculated on the first call 
     230to a smearing function, and includes ~60 $q$ values (finely and evenly binned) 
     231below (>0) and above the $q$ range of data in order to smear all data points for 
     232a given model and slit/pinhole size. The $Norm$  factor is found numerically with the 
     233weighting matrix and applied on the computation of $I_s$. 
    232234 
    233235.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
Note: See TracChangeset for help on using the changeset viewer.