Changeset 5cb0c87 in sasview for src/sas/sasgui/perspectives/calculator
- Timestamp:
- Sep 5, 2017 2:53:09 PM (7 years ago)
- 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:
- 96f00a0
- Parents:
- 78d0a9b (diff), f9ba422 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas/sasgui/perspectives/calculator
- Files:
-
- 22 added
- 22 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/calculator/model_editor.py
ra1b8fee r07ec714 643 643 self.name_hsizer = None 644 644 self.name_tcl = None 645 self.overwrite_cb = None 645 646 self.desc_sizer = None 646 647 self.desc_tcl = None … … 657 658 self.warning = "" 658 659 #This does not seem to be used anywhere so commenting out for now 659 # -- PDB 2/26/17 660 # -- PDB 2/26/17 660 661 #self._description = "New Plugin Model" 661 662 self.function_tcl = None … … 689 690 #title name [string] 690 691 name_txt = wx.StaticText(self, -1, 'Function Name : ') 691 overwrite_cb = wx.CheckBox(self, -1, "Overwrite existing plugin model of this name?", (10, 10))692 overwrite_cb.SetValue(False)693 overwrite_cb.SetToolTipString("Overwrite it if already exists?")694 wx.EVT_CHECKBOX(self, overwrite_cb.GetId(), self.on_over_cb)692 self.overwrite_cb = wx.CheckBox(self, -1, "Overwrite existing plugin model of this name?", (10, 10)) 693 self.overwrite_cb.SetValue(False) 694 self.overwrite_cb.SetToolTipString("Overwrite it if already exists?") 695 wx.EVT_CHECKBOX(self, self.overwrite_cb.GetId(), self.on_over_cb) 695 696 self.name_tcl = wx.TextCtrl(self, -1, size=(PANEL_WIDTH * 3 / 5, -1)) 696 697 self.name_tcl.Bind(wx.EVT_TEXT_ENTER, self.on_change_name) … … 700 701 self.name_tcl.SetToolTipString(hint_name) 701 702 self.name_hsizer.AddMany([(self.name_tcl, 0, wx.LEFT | wx.TOP, 0), 702 ( overwrite_cb, 0, wx.LEFT, 20)])703 (self.overwrite_cb, 0, wx.LEFT, 20)]) 703 704 self.name_sizer.AddMany([(name_txt, 0, wx.LEFT | wx.TOP, 10), 704 705 (self.name_hsizer, 0, … … 740 741 self.param_sizer.AddMany([(param_txt, 0, wx.LEFT, 10), 741 742 (self.param_tcl, 1, wx.EXPAND | wx.ALL, 10)]) 742 743 743 744 # Parameters with polydispersity 744 745 pd_param_txt = wx.StaticText(self, -1, 'Fit Parameters requiring ' + \ … … 755 756 self.pd_param_tcl.setDisplayLineNumbers(True) 756 757 self.pd_param_tcl.SetToolTipString(pd_param_tip) 757 758 758 759 self.param_sizer.AddMany([(pd_param_txt, 0, wx.LEFT, 10), 759 760 (self.pd_param_tcl, 1, wx.EXPAND | wx.ALL, 10)]) … … 995 996 info = 'Error' 996 997 color = 'red' 998 self.overwrite_cb.SetValue(True) 999 self.overwrite_name = True 997 1000 else: 998 1001 self._notes = result … … 1030 1033 if has_scipy: 1031 1034 lines.insert(0, 'import scipy') 1032 1033 # Think about 2D later 1035 1036 # Think about 2D later 1034 1037 #self.is_2d = func_str.count("#self.ndim = 2") 1035 1038 #line_2d = '' 1036 1039 #if self.is_2d: 1037 1040 # line_2d = CUSTOM_2D_TEMP.split('\n') 1038 1039 # Also think about test later 1041 1042 # Also think about test later 1040 1043 #line_test = TEST_TEMPLATE.split('\n') 1041 1044 #local_params = '' … … 1043 1046 spaces4 = ' '*4 1044 1047 spaces13 = ' '*13 1045 spaces16 = ' '*16 1048 spaces16 = ' '*16 1046 1049 param_names = [] # to store parameter names 1047 1050 has_scipy = func_str.count("scipy.") … … 1055 1058 out_f.write(line + '\n') 1056 1059 if line.count('#name'): 1057 out_f.write('name = "%s" \n' % name) 1060 out_f.write('name = "%s" \n' % name) 1058 1061 elif line.count('#title'): 1059 out_f.write('title = "User model for %s"\n' % name) 1062 out_f.write('title = "User model for %s"\n' % name) 1060 1063 elif line.count('#description'): 1061 out_f.write('description = "%s"\n' % desc_str) 1064 out_f.write('description = "%s"\n' % desc_str) 1062 1065 elif line.count('#parameters'): 1063 1066 out_f.write('parameters = [ \n') … … 1065 1068 p_line = param_line.lstrip().rstrip() 1066 1069 if p_line: 1067 pname, pvalue = self.get_param_helper(p_line)1070 pname, pvalue, desc = self.get_param_helper(p_line) 1068 1071 param_names.append(pname) 1069 out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], '', ' '],\n" % (spaces16, pname, pvalue))1072 out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], '', '%s'],\n" % (spaces16, pname, pvalue, desc)) 1070 1073 for param_line in pd_param_str.split('\n'): 1071 1074 p_line = param_line.lstrip().rstrip() 1072 1075 if p_line: 1073 pname, pvalue = self.get_param_helper(p_line)1076 pname, pvalue, desc = self.get_param_helper(p_line) 1074 1077 param_names.append(pname) 1075 out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], 'volume', ' '],\n" % (spaces16, pname, pvalue))1078 out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], 'volume', '%s'],\n" % (spaces16, pname, pvalue, desc)) 1076 1079 out_f.write('%s]\n' % spaces13) 1077 1080 1078 1081 # No form_volume or ER available in simple model editor 1079 1082 out_f.write('def form_volume(*arg): \n') … … 1082 1085 out_f.write('def ER(*arg): \n') 1083 1086 out_f.write(' return 1.0 \n') 1084 1087 1085 1088 # function to compute 1086 1089 out_f.write('\n') … … 1091 1094 for func_line in func_str.split('\n'): 1092 1095 out_f.write('%s%s\n' % (spaces4, func_line)) 1093 1096 1094 1097 Iqxy_string = 'return Iq(numpy.sqrt(x**2+y**2) ' 1095 1098 1096 1099 out_f.write('\n') 1097 1100 out_f.write('def Iqxy(x, y ') … … 1113 1116 items = line.split(";") 1114 1117 for item in items: 1115 name = item.split("=")[0].lstrip().rstrip() 1118 name = item.split("=")[0].strip() 1119 description = "" 1116 1120 try: 1117 value = item.split("=")[1].lstrip().rstrip() 1121 value = item.split("=")[1].strip() 1122 if value.count("#"): 1123 # If line ends in a comment, remove it before parsing float 1124 index = value.index("#") 1125 description = value[(index + 1):].strip() 1126 value = value[:value.index("#")].strip() 1118 1127 float(value) 1119 except :1128 except ValueError: 1120 1129 value = 1.0 # default 1121 1130 1122 return name, value 1131 return name, value, description 1123 1132 1124 1133 def set_function_helper(self, line): … … 1204 1213 import numpy 1205 1214 1206 #name 1215 #name 1207 1216 1208 1217 #title … … 1210 1219 #description 1211 1220 1212 #parameters 1221 #parameters 1213 1222 1214 1223 """ -
src/sas/sasgui/perspectives/calculator/pyconsole.py
r7432acb r4627657 37 37 Iqxy = model.evalDistribution([qx, qy]) 38 38 39 result = """ 40 Iq(%s) = %s 41 Iqxy(%s, %s) = %s 42 """%(q, Iq, qx, qy, Iqxy) 39 # check the model's unit tests run 40 from sasmodels.model_test import run_one 41 result = run_one(path) 43 42 44 43 return result … … 89 88 ok = wx.Button(self, wx.ID_OK, "OK") 90 89 91 # Mysterious constraint layouts from 90 # Mysterious constraint layouts from 92 91 # https://www.wxpython.org/docs/api/wx.lib.layoutf.Layoutf-class.html 93 92 lc = layoutf.Layoutf('t=t5#1;b=t5#2;l=l5#1;r=r5#1', (self,ok)) -
src/sas/sasgui/perspectives/calculator/media/density_calculator_help.rst
rd85c194 r6aad2e8 29 29 4) Click the 'Calculate' button to perform the calculation. 30 30 31 .. image:: density_tutor. gif31 .. image:: density_tutor.png 32 32 33 33 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -
src/sas/sasgui/perspectives/calculator/media/gen_sas_help.html
rd85c194 r6aad2e8 19 19 by the particle 20 20 <p> 21 <img src="gen_i. gif"/>21 <img src="gen_i.png"/> 22 22 </p> 23 23 <br> … … 26 26 of the j'th pixel respectively. And the total volume 27 27 <p> 28 <img src="v_j. gif"/>28 <img src="v_j.png"/> 29 29 </p> 30 30 <br> … … 44 44 scattering length. (Figure below). 45 45 <p> 46 <img src="mag_vector. bmp"/>46 <img src="mag_vector.png"/> 47 47 </p> 48 48 <br> 49 49 The magnetic scattering length density is then 50 50 <p> 51 <img src="dm_eq. gif"/>51 <img src="dm_eq.png"/> 52 52 </p> 53 53 <br> … … 66 66 <br> 67 67 <p> 68 <img src="gen_mag_pic. bmp"/>68 <img src="gen_mag_pic.png"/> 69 69 </p> 70 70 <br> … … 75 75 densities , including the nuclear scattering length density (β <sub>N</sub>) are given as, for non-spin-flips, 76 76 <p> 77 <img src="sld1. gif"/>77 <img src="sld1.png"/> 78 78 </p> 79 79 <br> … … 81 81 for spin-flips, 82 82 <p> 83 <img src="sld2. gif"/>83 <img src="sld2.png"/> 84 84 </p> 85 85 <br> … … 87 87 where 88 88 <p> 89 <img src="mxp. gif"/>89 <img src="mxp.png"/> 90 90 </p> 91 91 <p> 92 <img src="myp. gif"/>92 <img src="myp.png"/> 93 93 </p> 94 94 <p> 95 <img src="mzp. gif"/>95 <img src="mzp.png"/> 96 96 </p> 97 97 <p> 98 <img src="mqx. gif"/>98 <img src="mqx.png"/> 99 99 </p> 100 100 <p> 101 <img src="mqy. gif"/>101 <img src="mqy.png"/> 102 102 </p> 103 103 <br> … … 110 110 <br> 111 111 <p> 112 <img src="gen_gui_help. bmp"/>112 <img src="gen_gui_help.png"/> 113 113 </p> 114 114 <br> … … 136 136 in a 2D output, whileas the scattering calculation averaged over all the orientations uses the Debye equation providing a 1D output: 137 137 <p> 138 <img src="gen_debye_eq. gif"/>138 <img src="gen_debye_eq.png"/> 139 139 </p> 140 140 <br> -
src/sas/sasgui/perspectives/calculator/media/image_viewer_help.rst
rda456fb r6aad2e8 34 34 will be displayed. 35 35 36 .. image:: load_image. bmp36 .. image:: load_image.png 37 37 38 38 3) To save, print, or copy the image, or to apply a grid overlay, right-click 39 39 anywhere in the plot. 40 40 41 .. image:: pic_plot. bmp41 .. image:: pic_plot.png 42 42 43 43 4. If the image is taken from a 2D detector, SasView can attempt to convert … … 51 51 then click the OK. 52 52 53 .. image:: pic_convert. bmp53 .. image:: pic_convert.png 54 54 55 55 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -
src/sas/sasgui/perspectives/calculator/media/kiessig_calculator_help.rst
r7805458 r5ed76f8 10 10 ----------- 11 11 12 This tool is approximately estimates the thickness of a layer or the diameter13 of particles from the position of the Kiessig fringe/Bragg peak in NR/SAS data 14 usingthe relation12 This tool estimates real space dimensions from the position or spacing of 13 features in recipricol space. In particular a particle of size $d$ will 14 give rise to Bragg peaks with spacing $\Delta q$ according to the relation 15 15 16 (thickness *or* size) = 2 * |pi| / (fringe_width *or* peak position) 17 16 .. math:: 17 18 d = 2\pi / \Delta q 19 20 Similarly, the spacing between the peaks in Kiessig fringes in reflectometry 21 data arise from layers of thickness $d$. 22 18 23 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 19 24 … … 21 26 -------------- 22 27 23 To get a rough thickness or particle size, simply type the fringe or peak 28 To get a rough thickness or particle size, simply type the fringe or peak 24 29 position (in units of 1/|Ang|\) and click on the *Compute* button. 25 30 26 31 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 27 32 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
r7805458 r5ed76f8 10 10 ----------- 11 11 12 This tool is approximately estimates the resolution of Q from SAS instrumental13 parameter values assuming that the detector is flat and normal to the 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 14 14 incident beam. 15 15 … … 23 23 2) Select the source (Neutron or Photon) and source type (Monochromatic or TOF). 24 24 25 *NOTE! The computational difference between the sources is only the 25 *NOTE! The computational difference between the sources is only the 26 26 gravitational contribution due to the mass of the particles.* 27 27 28 3) Change the default values of the instrumental parameters as required. Be 28 3) Change the default values of the instrumental parameters as required. Be 29 29 careful to note that distances are specified in cm! 30 30 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 31 4) 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 35 35 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 40 40 will be used for the corresponding wavelength spread. 41 41 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 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 44 44 be loaded by selecting *Add new* in the combo box. 45 45 46 6) When ready, click the *Compute* button. Depending on the computation the 46 6) When ready, click the *Compute* button. Depending on the computation the 47 47 calculation time will vary. 48 48 49 7) 1D and 2D dQ values will be displayed at the bottom of the panel, and a 2D50 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 the49 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 52 52 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 accessible53 54 TOF only: green lines indicate the limits of the maximum $Q$ range accessible 55 55 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 Q58 region near the beam block/stop59 56 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})$] 61 61 62 62 the variance is slightly under estimated. 63 63 64 8) A summary of the calculation is written to the SasView *Console* at the 64 8) A summary of the calculation is written to the SasView *Console* at the 65 65 bottom of the main SasView window. 66 66 67 .. image:: resolution_tutor. gif67 .. image:: resolution_tutor.png 68 68 69 69 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 74 74 The scattering wave transfer vector is by definition 75 75 76 .. image:: q. gif76 .. image:: q.png 77 77 78 In the small-angle limit, the variance of Q is to a first-order78 In the small-angle limit, the variance of $Q$ is to a first-order 79 79 approximation 80 80 81 .. image:: sigma_q. gif81 .. image:: sigma_q.png 82 82 83 83 The geometric and gravitational contributions can then be summarised as 84 84 85 .. image:: sigma_table. gif85 .. image:: sigma_table.png 86 86 87 Finally, a Gaussian function is used to describe the 2D weighting distribution 88 of the uncertainty in Q.87 Finally, a Gaussian function is used to describe the 2D weighting distribution 88 of the uncertainty in $Q$. 89 89 90 90 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 93 93 ---------- 94 94 95 D.F.R. Mildner and J.M. Carpenter 95 D.F.R. Mildner and J.M. Carpenter 96 96 *J. Appl. Cryst.* 17 (1984) 249-256 97 97 98 D.F.R. Mildner, J.M. Carpenter and D.L. Worcester 98 D.F.R. Mildner, J.M. Carpenter and D.L. Worcester 99 99 *J. Appl. Cryst.* 19 (1986) 311-319 100 100 -
src/sas/sasgui/perspectives/calculator/media/sas_calculator_help.rst
rda456fb r5ed76f8 19 19 ------ 20 20 21 In general, a particle with a volume *V* can be described by an ensemble22 containing *N* 3-dimensional rectangular pixels where each pixel is much23 smaller than *V*.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$. 24 24 25 Assuming that all the pixel sizes are the same, the elastic scattering 25 Assuming that all the pixel sizes are the same, the elastic scattering 26 26 intensity from the particle is 27 27 28 .. image:: gen_i. gif28 .. image:: gen_i.png 29 29 30 30 Equation 1. 31 31 32 where |beta|\ :sub:`j` and *r*\ :sub:`j` are the scattering length density and33 the position of the j'thpixel respectively.32 where $\beta_j$ and $r_j$ are the scattering length density and 33 the position of the $j^\text{th}$ pixel respectively. 34 34 35 The total volume *V*35 The total volume $V$ 36 36 37 .. image:: v_j.gif37 .. math:: 38 38 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 41 for $\beta_j \ne 0$ where $v_j$ is the volume of the $j^\text{th}$ 42 pixel (or the $j^\text{th}$ natural atomic volume (= atomic mass / (natural molar 41 43 density * Avogadro number) for the atomic structures). 42 44 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 46 atomic structure (such as taken from a PDB file) to get the right normalization. 45 47 46 *NOTE! * |beta|\ :sub:`j` *displayed in the GUI may be incorrect but this will not48 *NOTE! $\beta_j$ displayed in the GUI may be incorrect but this will not 47 49 affect the scattering computation if the correction of the total volume V is made.* 48 50 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 51 The scattering length density (SLD) of each pixel, where the SLD is uniform, is 52 a combination of the nuclear and magnetic SLDs and depends on the spin states 51 53 of the neutrons as follows. 52 54 … … 54 56 ^^^^^^^^^^^^^^^^^^^ 55 57 56 For magnetic scattering, only the magnetization component, *M*\ :sub:`perp`\ ,57 perpendicular to the scattering vector *Q* contributes to the magnetic58 For magnetic scattering, only the magnetization component, $M_\perp$, 59 perpendicular to the scattering vector $Q$ contributes to the magnetic 58 60 scattering length. 59 61 60 .. image:: mag_vector. bmp62 .. image:: mag_vector.png 61 63 62 64 The magnetic scattering length density is then 63 65 64 .. image:: dm_eq. gif66 .. image:: dm_eq.png 65 67 66 where the gyromagnetic ratio |gamma| = -1.913, |mu|\ :sub:`B` is the Bohr67 magneton, *r*\ :sub:`0` is the classical radius of electron, and |sigma| is the68 where the gyromagnetic ratio is $\gamma = -1.913$, $\mu_B$ is the Bohr 69 magneton, $r_0$ is the classical radius of electron, and $\sigma$ is the 68 70 Pauli spin. 69 71 70 72 For a polarized neutron, the magnetic scattering is depending on the spin states. 71 73 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 74 Let us consider that the incident neutrons are polarised both parallel (+) and 75 anti-parallel (-) to the x' axis (see below). The possible states after 76 scattering from the sample are then 75 77 76 78 * Non-spin flips: (+ +) and (- -) 77 79 * Spin flips: (+ -) and (- +) 78 80 79 .. image:: gen_mag_pic. bmp81 .. image:: gen_mag_pic.png 80 82 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`\ )83 Now let us assume that the angles of the *Q* vector and the spin-axis (x') 84 to the x-axis are $\phi$ and $\theta_\text{up}$ respectively (see above). Then, 85 depending upon the polarization (spin) state of neutrons, the scattering 86 length densities, including the nuclear scattering length density ($\beta_N$) 85 87 are given as 86 88 87 89 * for non-spin-flips 88 90 89 .. image:: sld1. gif91 .. image:: sld1.png 90 92 91 93 * for spin-flips 92 94 93 .. image:: sld2. gif95 .. image:: sld2.png 94 96 95 97 where 96 98 97 .. image:: mxp. gif99 .. image:: mxp.png 98 100 99 .. image:: myp. gif101 .. image:: myp.png 100 102 101 .. image:: mzp. gif103 .. image:: mzp.png 102 104 103 .. image:: mqx. gif105 .. image:: mqx.png 104 106 105 .. image:: mqy. gif107 .. image:: mqy.png 106 108 107 Here the *M0*\ :sub:`x`\ , *M0*\ :sub:`y` and *M0*\ :sub:`z` are the x, y and z108 components of the magnetisation vector in the laboratory xyz frame.109 Here the $M0_x$, $M0_y$ and $M0_z$ are the $x$, $y$ and $z$ 110 components of the magnetisation vector in the laboratory $xyz$ frame. 109 111 110 112 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 113 115 -------------- 114 116 115 .. image:: gen_gui_help. bmp117 .. image:: gen_gui_help.png 116 118 117 After computation the result will appear in the *Theory* box in the SasView 119 After computation the result will appear in the *Theory* box in the SasView 118 120 *Data Explorer* panel. 119 121 120 *Up_frac_in* and *Up_frac_out* are the ratio 122 *Up_frac_in* and *Up_frac_out* are the ratio 121 123 122 124 (spin up) / (spin up + spin down) 123 125 124 126 of neutrons before the sample and at the analyzer, respectively. 125 127 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 127 129 0.0 to 1.0. Both values are 0.5 for unpolarized neutrons.* 128 130 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 130 132 in xyz coordinates. No angular orientational averaging is considered.* 131 133 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 133 135 is taken account.* 134 136 … … 139 141 140 142 The 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 143 polarized/magnetic scattering when doing so, thus related parameters such as 142 144 *Up_frac_in*, etc, will be ignored. 143 145 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 146 The calculation for fixed orientation uses Equation 1 above resulting in a 2D 147 output, whereas the scattering calculation averaged over all the orientations 146 148 uses the Debye equation below providing a 1D output 147 149 148 .. image:: gen_debye_eq. gif150 .. image:: gen_debye_eq.png 149 151 150 where *v*\ :sub:`j` |beta|\ :sub:`j` |equiv| *b*\ :sub:`j` is the scattering151 length of the j'th atom. The calculation output is passed to the *Data Explorer*152 where $v_j \beta_j \equiv b_j$ is the scattering 153 length of the $j^\text{th}$ atom. The calculation output is passed to the *Data Explorer* 152 154 for further use. 153 155 -
src/sas/sasgui/perspectives/calculator/media/sld_calculator_help.rst
rf93b473f r5ed76f8 10 10 ----------- 11 11 12 The neutron scattering length density (SLD ) is defined as12 The neutron scattering length density (SLD, $\beta_N$) is defined as 13 13 14 SLD = (b_c1 + b_c2 + ... + b_cn) / Vm 14 .. math:: 15 15 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 18 where $b_{ci}$ is the bound coherent scattering length of ith of n atoms in a molecule 19 with the molecular volume $V_m$. 18 20 19 21 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 22 24 ---------------------------- 23 25 24 To calculate scattering length densities enter the empirical formula of a 26 To calculate scattering length densities enter the empirical formula of a 25 27 compound and its mass density and click "Calculate". 26 28 27 Entering a wavelength value is optional (a default value of 6.0 |Ang| will 29 Entering a wavelength value is optional (a default value of 6.0 |Ang| will 28 30 be used). 29 31 … … 38 40 * Parentheses can be nested, such as "(CaCO3(H2O)6)1". 39 41 40 * Isotopes are represented by their atomic number in *square brackets*, such 42 * Isotopes are represented by their atomic number in *square brackets*, such 41 43 as "CaCO[18]3+6H2O", H[1], or H[2]. 42 44 43 45 * Numbers of atoms can be integer or decimal, such as "CaCO3+(3HO0.5)2". 44 46 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 46 48 mixture of H2O/D2O write "H14O7+D6O3" or more simply "H7D3O5" (i.e. this says 47 49 7 hydrogens, 3 deuteriums, and 5 oxygens) and enter a mass density calculated 48 50 on the percentages of H2O and D2O. 49 51 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 51 53 deuterium atoms, and 6 Oxygen-18 atoms). 52 54 53 55 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 54 56 55 .. note:: This help document was last changed by Steve King, 01May201557 .. note:: This help document was last changed by Paul Kienzle, 05Apr2017 56 58 -
src/sas/sasgui/perspectives/calculator/media/slit_calculator_help.rst
rf93b473f r5ed76f8 11 11 ----------- 12 12 13 This tool enables X-ray users to calculate the slit size (FWHM/2) for smearing 13 This tool enables X-ray users to calculate the slit size (FWHM/2) for smearing 14 14 based on their half beam profile data. 15 15 16 16 *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.* 17 only been tested with beam profile data from Anton-Paar SAXSess:sup:`TM` software.* 19 18 20 19 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 27 26 2) Load a beam profile file in the *Data* field using the *Browse* button. 28 27 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 30 29 beam profile.DAT in your {installation_directory}/SasView/test folder.* 31 30 32 3) Once a data is loaded, the slit size is automatically computed and displayed 31 3) Once a data is loaded, the slit size is automatically computed and displayed 33 32 in the tool window. 34 33 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 36 35 the Q data. This calculator assumes the data has units of 1/\ |Ang|\ . If the 37 36 data is not in these units it must be manually converted beforehand.*
Note: See TracChangeset
for help on using the changeset viewer.