Changes in / [352494a:37c7d5e] in sasmodels
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/ref/index.rst
r9f12fbe rc34a31f 10 10 refs.rst 11 11 gpu/gpu_computations.rst 12 gpu/opencl_installation.rst13 12 magnetism/magnetism.rst 14 13 sesans/sans_to_sesans.rst -
sasmodels/models/core_shell_parallelepiped.py
rcb0dc22 r5810f00 4 4 5 5 Calculates the form factor for a rectangular solid with a core-shell structure. 6 The thickness and the scattering length density of the shell or 7 "rim" can be different on each (pair) of faces. However at this time 8 the model does **NOT** actually calculate a c face rim despite the presence of 9 the parameter. 10 11 .. note:: 12 This model was originally ported from NIST IGOR macros. However,t is not 13 yet fully understood by the SasView developers and is currently review. 6 **The thickness and the scattering length density of the shell or "rim" 7 can be different on all three (pairs) of faces.** 14 8 15 9 The form factor is normalized by the particle volume $V$ such that … … 41 35 V = ABC + 2t_ABC + 2t_BAC + 2t_CAB 42 36 43 **meaning that there are "gaps" at the corners of the solid.** Again note that 44 $t_C = 0$ currently. 37 **meaning that there are "gaps" at the corners of the solid.** 45 38 46 39 The intensity calculated follows the :ref:`parallelepiped` model, with the … … 48 41 amplitudes of the core and shell, in the same manner as a core-shell model. 49 42 43 .. math:: 44 45 F_{a}(Q,\alpha,\beta)= 46 \Bigg(\frac{sin(Q(L_A+2t_A)/2sin\alpha sin\beta)}{Q(L_A+2t_A)/2sin\alpha 47 sin\beta)} 48 - \frac{sin(QL_A/2sin\alpha sin\beta)}{QL_A/2sin\alpha sin\beta)} \Bigg) 49 + \frac{sin(QL_B/2sin\alpha sin\beta)}{QL_B/2sin\alpha sin\beta)} 50 + \frac{sin(QL_C/2sin\alpha sin\beta)}{QL_C/2sin\alpha sin\beta)} 50 51 51 52 .. note:: … … 92 93 detector plane. 93 94 95 Validation 96 ---------- 97 98 The model uses the form factor calculations implemented in a c-library provided 99 by the NIST Center for Neutron Research (Kline, 2006). 100 94 101 References 95 102 ---------- … … 106 113 107 114 * **Author:** NIST IGOR/DANSE **Date:** pre 2010 108 * **Converted to sasmodels by:** Miguel Gonzales **Date:** February 26, 2016 109 * **Last Modified by:** Wojciech Potrzebowski **Date:** January 11, 2017 110 * **Currently Under review by:** Paul Butler 115 * **Last Modified by:** Paul Butler **Date:** September 30, 2016 116 * **Last Reviewed by:** Miguel Gonzales **Date:** March 21, 2016 111 117 """ 112 118 -
sasmodels/models/fractal.c
r4788822 r925ad6e 1 1 #define INVALID(p) (p.fractal_dim < 0.0) 2 3 static double4 form_volume(double radius)5 {6 return M_4PI_3 * cube(radius);7 }8 2 9 3 static double … … 19 13 20 14 //calculate P(q) for the spherical subunits 21 const double pq = square(form_volume(radius) * (sld_block-sld_solvent)22 15 const double V = M_4PI_3*cube(radius); 16 const double pq = V * square((sld_block-sld_solvent)*sas_3j1x_x(q*radius)); 23 17 24 18 // scale to units cm-1 sr-1 (assuming data on absolute scale) -
sasmodels/models/fractal.py
rdf89d77 r925ad6e 20 20 .. math:: 21 21 22 P(q)&= F(qR_0)^2 \\ 23 F(q)&= \frac{3 (\sin x - x \cos x)}{x^3} \\ 24 V_\text{particle} &= \frac{4}{3}\ \pi R_0 \\ 22 P(q)&= F(qR_0)^2 23 24 F(q)&= \frac{3 (\sin x - x \cos x)}{x^3} 25 26 V_\text{particle} &= \frac{4}{3}\ \pi R_0 27 25 28 S(q) &= 1 + \frac{D_f\ \Gamma\!(D_f-1)}{[1+1/(q \xi)^2\ ]^{(D_f -1)/2}} 26 29 \frac{\sin[(D_f-1) \tan^{-1}(q \xi) ]}{(q R_0)^{D_f}} … … 29 32 is the fractal dimension, representing the self similarity of the structure. 30 33 Note that S(q) here goes negative if $D_f$ is too large, and the Gamma function 31 diverges at $D_f =0$ and $D_f=1$.34 diverges at $D_f$=0 and $D_f$=1. 32 35 33 36 **Polydispersity on the radius is provided for.** … … 44 47 ---------- 45 48 46 .. [#]J Teixeira, *J. Appl. Cryst.*, 21 (1988) 781-78549 J Teixeira, *J. Appl. Cryst.*, 21 (1988) 781-785 47 50 48 Authorship and Verification 49 ---------------------------- 51 **Author:** NIST IGOR/DANSE **on:** pre 2010 50 52 51 * **Author:** NIST IGOR/DANSE **Date:** pre 2010 52 * **Converted to sasmodels by:** Paul Butler **Date:** March 19, 2016 53 * **Last Modified by:** Paul Butler **Date:** March 12, 2017 54 * **Last Reviewed by:** Paul Butler **Date:** March 12, 2017 53 **Last Modified by:** Paul Butler **on:** March 20, 2016 54 55 **Last Reviewed by:** Paul Butler **on:** March 20, 2016 55 56 56 57 """ … … 83 84 parameters = [["volfraction", "", 0.05, [0.0, 1], "", 84 85 "volume fraction of blocks"], 85 ["radius", "Ang", 5.0, [0.0, inf], " volume",86 ["radius", "Ang", 5.0, [0.0, inf], "", 86 87 "radius of particles"], 87 88 ["fractal_dim", "", 2.0, [0.0, 6.0], "", -
sasmodels/resolution.py
rb32caab rb397165 17 17 18 18 MINIMUM_RESOLUTION = 1e-8 19 MINIMUM_ABSOLUTE_Q = 0.02 # relative to the minimum q in the data 19 20 21 # When extrapolating to -q, what is the minimum positive q relative to q_min 22 # that we wish to calculate? 23 MIN_Q_SCALE_FOR_NEGATIVE_Q_EXTRAPOLATION = 0.01 20 24 21 25 class Resolution(object): … … 78 82 self.q_calc = (pinhole_extend_q(q, q_width, nsigma=nsigma) 79 83 if q_calc is None else np.sort(q_calc)) 80 81 # Protect against models which are not defined for very low q. Limit82 # the smallest q value evaluated (in absolute) to 0.02*min83 cutoff = MINIMUM_ABSOLUTE_Q*np.min(self.q)84 self.q_calc = self.q_calc[abs(self.q_calc) >= cutoff]85 86 # Build weight matrix from calculated q values87 84 self.weight_matrix = pinhole_resolution(self.q_calc, self.q, 88 85 np.maximum(q_width, MINIMUM_RESOLUTION)) 89 self.q_calc = abs(self.q_calc)90 86 91 87 def apply(self, theory): … … 127 123 self.q_calc = slit_extend_q(q, qx_width, qy_width) \ 128 124 if q_calc is None else np.sort(q_calc) 129 130 # Protect against models which are not defined for very low q. Limit131 # the smallest q value evaluated (in absolute) to 0.02*min132 cutoff = MINIMUM_ABSOLUTE_Q*np.min(self.q)133 self.q_calc = self.q_calc[abs(self.q_calc) >= cutoff]134 135 # Build weight matrix from calculated q values136 125 self.weight_matrix = \ 137 126 slit_resolution(self.q_calc, self.q, qx_width, qy_width) 138 self.q_calc = abs(self.q_calc)139 127 140 128 def apply(self, theory): … … 165 153 # neither trapezoid nor Simpson's rule improved the accuracy. 166 154 edges = bin_edges(q_calc) 167 #edges[edges < 0.0] = 0.0 # clip edges below zero155 edges[edges < 0.0] = 0.0 # clip edges below zero 168 156 cdf = erf((edges[:, None] - q[None, :]) / (sqrt(2.0)*q_width)[None, :]) 169 157 weights = cdf[1:] - cdf[:-1] … … 298 286 # The current algorithm is a midpoint rectangle rule. 299 287 q_edges = bin_edges(q_calc) # Note: requires q > 0 300 #q_edges[q_edges < 0.0] = 0.0 # clip edges below zero288 q_edges[q_edges < 0.0] = 0.0 # clip edges below zero 301 289 weights = np.zeros((len(q), len(q_calc)), 'd') 302 290 … … 404 392 interval. 405 393 406 Note that extrapolated values may be negative.394 if *q_min* is zero or less then *q[0]/10* is used instead. 407 395 """ 408 396 q = np.sort(q) 409 397 if q_min + 2*MINIMUM_RESOLUTION < q[0]: 398 if q_min <= 0: q_min = q_min*MIN_Q_SCALE_FOR_NEGATIVE_Q_EXTRAPOLATION 410 399 n_low = np.ceil((q[0]-q_min) / (q[1]-q[0])) if q[1] > q[0] else 15 411 400 q_low = np.linspace(q_min, q[0], n_low+1)[:-1] … … 459 448 log_delta_q = log(10.) / points_per_decade 460 449 if q_min < q[0]: 461 if q_min < 0: q_min = q[0]*MIN IMUM_ABSOLUTE_Q450 if q_min < 0: q_min = q[0]*MIN_Q_SCALE_FOR_NEGATIVE_Q_EXTRAPOLATION 462 451 n_low = log_delta_q * (log(q[0])-log(q_min)) 463 452 q_low = np.logspace(log10(q_min), log10(q[0]), np.ceil(n_low)+1)[:-1]
Note: See TracChangeset
for help on using the changeset viewer.