Changes in / [fdd56a1:f40064d] in sasmodels
- Location:
- sasmodels
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/parallelepiped.py
r9802ab3 r34a9e4e 22 22 .. note:: 23 23 24 The edge of the solid used to have to satisfy the condition that $A < B < C$. 25 After some improvements to the effective radius calculation, used with 26 an S(Q), it is beleived that this is no longer the case. 24 The three dimensions of the parallelepiped (strictly here a cuboid) may be given in 25 $any$ size order. To avoid multiple fit solutions, especially 26 with Monte-Carlo fit methods, it may be advisable to restrict their ranges. There may 27 be a number of closely similar "best fits", so some trial and error, or fixing of some 28 dimensions at expected values, may help. 27 29 28 30 The 1D scattering intensity $I(q)$ is calculated as: -
sasmodels/models/spherical_sld.py
r3330bb4 r63a7fe8 199 199 category = "shape:sphere" 200 200 201 SHAPES = [ ["erf(|nu|*z)", "Rpow(z^|nu|)", "Lpow(z^|nu|)",202 "Rexp(-|nu|z)", "Lexp(-|nu|z)"]]201 SHAPES = ["erf(|nu|*z)", "Rpow(z^|nu|)", "Lpow(z^|nu|)", 202 "Rexp(-|nu|z)", "Lexp(-|nu|z)"] 203 203 204 204 # pylint: disable=bad-whitespace, line-too-long … … 209 209 ["thickness[n_shells]", "Ang", 100.0, [0, inf], "volume", "thickness shell"], 210 210 ["interface[n_shells]", "Ang", 50.0, [0, inf], "volume", "thickness of the interface"], 211 ["shape[n_shells]", "", 0, SHAPES,"", "interface shape"],211 ["shape[n_shells]", "", 0, [SHAPES], "", "interface shape"], 212 212 ["nu[n_shells]", "", 2.5, [0, inf], "", "interface shape exponent"], 213 213 ["n_steps", "", 35, [0, inf], "", "number of steps in each interface (must be an odd integer)"], -
sasmodels/models/triaxial_ellipsoid.py
re645373 r34a9e4e 66 66 r^2 &= b^2(p_a \sin^2(\phi)(1 - u^2) + 1 + p_c u^2) 67 67 68 Though for convenience we describe the three radii of the ellipsoid as equatorial 69 and polar, they may be given in $any$ size order. To avoid multiple solutions, especially 70 with Monte-Carlo fit methods, it may be advisable to restrict their ranges. For typical 71 small angle diffraction situations there may be a number of closely similar "best fits", 72 so some trial and error, or fixing of some radii at expected values, may help. 73 68 74 To provide easy access to the orientation of the triaxial ellipsoid, 69 75 we define the axis of the cylinder using the angles $\theta$, $\phi$ 70 and $\psi$. These angles are defined analogously to the elliptical_cylinder below 76 and $\psi$. These angles are defined analogously to the elliptical_cylinder below, note that 77 angle $\phi$ is now NOT the same as in the equations above. 71 78 72 79 .. figure:: img/elliptical_cylinder_angle_definition.png 73 80 74 Definition of angles for oriented triaxial ellipsoid, where radii shown 75 here are $a < b << c$ and angle $\Psi$ is a rotation around the axis 76 of the particle. 81 Definition of angles for oriented triaxial ellipsoid, where radii are for illustration here 82 $a < b << c$ and angle $\Psi$ is a rotation around the axis of the particle. 77 83 78 84 For oriented ellipsoids the *theta*, *phi* and *psi* orientation parameters will appear when fitting 2D data, … … 83 89 .. figure:: img/triaxial_ellipsoid_angle_projection.png 84 90 85 Some example angles for orientedellipsoid.91 Some examples for an oriented triaxial ellipsoid. 86 92 87 93 The radius-of-gyration for this system is $R_g^2 = (R_a R_b R_c)^2/5$. … … 92 98 93 99 NB: The 2nd virial coefficient of the triaxial solid ellipsoid is 94 calculated based on the polar radius $R_p = R_c$ and equatorial 95 radius $R_e = \sqrt{R_a R_b}$, and used as the effective radius for 100 calculated after sorting the three radii to give the most appropriate 101 prolate or oblate form, from the new polar radius $R_p = R_c$ and effective equatorial 102 radius, $R_e = \sqrt{R_a R_b}$, to then be used as the effective radius for 96 103 $S(q)$ when $P(q) \cdot S(q)$ is applied. 97 104 … … 125 132 126 133 description = """ 127 Note - fitting ensure that the inequality ra<rb<rc is not 128 violated. Otherwise the calculation may not be correct. 134 Triaxial ellipsoid - see main documentation. 129 135 """ 130 136 category = "shape:ellipsoid" -
sasmodels/rst2html.py
rc4e3215 rf2f5413 155 155 return frame 156 156 157 def view_html_wxapp(html, url=""): 158 import wx # type: ignore 159 app = wx.App() 160 frame = wxview(html, url) 161 app.MainLoop() 162 163 def view_url_wxapp(url): 164 import wx # type: ignore 165 from wx.html2 import WebView 166 app = wx.App() 167 frame = wx.Frame(None, -1, size=(850, 540)) 168 view = WebView.New(frame) 169 view.LoadURL(url) 170 frame.Show() 171 app.MainLoop() 172 157 173 def qtview(html, url=""): 158 174 try: … … 167 183 return helpView 168 184 169 def view_html_wxapp(html, url=""):170 import wx # type: ignore171 app = wx.App()172 frame = wxview(html, url)173 app.MainLoop()174 175 185 def view_html_qtapp(html, url=""): 176 186 import sys … … 183 193 sys.exit(app.exec_()) 184 194 185 def view_rst_app(filename, qt=False): 195 def view_url_qtapp(url): 196 import sys 197 try: 198 from PyQt5.QtWidgets import QApplication 199 except ImportError: 200 from PyQt4.QtGui import QApplication 201 app = QApplication([]) 202 try: 203 from PyQt5.QtWebKitWidgets import QWebView 204 from PyQt5.QtCore import QUrl 205 except ImportError: 206 from PyQt4.QtWebkit import QWebView 207 from PyQt4.QtCore import QUrl 208 frame = QWebView() 209 frame.load(QUrl(url)) 210 frame.show() 211 sys.exit(app.exec_()) 212 213 def view_help(filename, qt=False): 186 214 import os 187 html = load_rst_as_html(filename) 188 url="file://"+os.path.abspath(filename)+"/" 189 if qt: 190 view_html_qtapp(html, url) 215 url="file:///"+os.path.abspath(filename).replace("\\","/") 216 if filename.endswith('.rst'): 217 html = load_rst_as_html(filename) 218 if qt: 219 view_html_qtapp(html, url) 220 else: 221 view_html_wxapp(html, url) 191 222 else: 192 view_html_wxapp(html, url) 223 if qt: 224 view_url_qtapp(url) 225 else: 226 view_url_wxapp(url) 193 227 194 228 if __name__ == "__main__": 195 229 import sys 196 view_ rst_app(sys.argv[1], qt=True)197 230 view_help(sys.argv[1], qt=True) 231
Note: See TracChangeset
for help on using the changeset viewer.