Changeset 8b9adb5 in sasmodels
- Timestamp:
- Feb 24, 2016 4:50:09 AM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- b7529e2
- Parents:
- c9f885e (diff), 94bd809 (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:
- sasmodels/models
- Files:
-
- 6 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/be_polyelectrolyte.py
r168052c r0e86967 127 127 :return: 2D-Intensity 128 128 """ 129 i q= Iq(sqrt(qx**2 + qy**2), *args)130 return i q129 intensity = Iq(sqrt(qx**2 + qy**2), *args) 130 return intensity 131 131 132 132 Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values -
sasmodels/models/core_shell_cylinder.py
reb69cce rf0aa7f8 155 155 156 156 def ER(radius, thickness, length): 157 """ 158 Returns the effective radius used in the S*P calculation 159 """ 157 160 radius = radius + thickness 158 161 length = length + 2 * thickness … … 161 164 162 165 def VR(radius, thickness, length): 166 """ 167 Returns volume ratio 168 """ 163 169 whole = pi * (radius + thickness) ** 2 * (length + 2 * thickness) 164 170 core = pi * radius ** 2 * length -
sasmodels/models/correlation_length.py
r5054e80 r3e6c5c1 78 78 # names and the target sasview model name. 79 79 oldname = 'CorrLengthModel' 80 # pylint: disable=bad-continuation 81 oldpars = dict( 82 lorentz_scale='scale_l', porod_scale='scale_p', 80 81 oldpars = dict(lorentz_scale='scale_l', porod_scale='scale_p', 83 82 cor_length='length_l', exponent_p='exponent_p', 84 exponent_l='exponent_l' 85 ) 83 exponent_l='exponent_l') 86 84 87 tests = [ 88 [{}, 0.001, 1009.98], 85 tests = [[{}, 0.001, 1009.98], 89 86 [{}, 0.150141, 0.174645], 90 [{}, 0.442528, 0.0203957] 91 ] 92 # pylint: enable=bad-continuation 87 [{}, 0.442528, 0.0203957]] -
sasmodels/models/cylinder.py
reb69cce r0c3a226 144 144 145 145 def ER(radius, length): 146 """ 147 Return equivalent radius (ER) 148 """ 146 149 ddd = 0.75 * radius * (2 * radius * length + (length + radius) * (length + pi * radius)) 147 150 return 0.5 * (ddd) ** (1. / 3.) -
sasmodels/models/dab.py
reb69cce r94bd809 1 1 r""" 2 3 2 Calculates the scattering from a randomly distributed, two-phase system based on 4 3 the Debye-Anderson-Brumberger (DAB) model for such systems. The two-phase system -
sasmodels/models/fcc.py
r9aac25d rc0ccea8 114 114 single = False 115 115 116 # pylint: disable=bad-whitespace, line-too-long 116 117 # ["name", "units", default, [lower, upper], "type","description"], 117 118 parameters = [["dnn", "Ang", 220, [-inf, inf], "", "Nearest neighbour distance"], … … 124 125 ["psi", "degrees", 60, [-inf, inf], "orientation", "Out of plane angle"] 125 126 ] 127 # pylint: enable=bad-whitespace, line-too-long 126 128 127 129 source = ["lib/J1.c", "lib/gauss150.c", "lib/sphere_form.c", "fcc.c"] -
sasmodels/models/guinier.py
reb69cce r723cebe 36 36 37 37 # ["name", "units", default, [lower, upper], "type","description"], 38 parameters = [ 39 ["rg", "Ang", 60.0, [0, inf], "", "Radius of Gyration"], 40 ] 38 parameters = [["rg", "Ang", 60.0, [0, inf], "", "Radius of Gyration"]] 41 39 42 40 Iq = """ … … 51 49 52 50 # parameters for demo 53 demo = dict(scale=1.0, rg=60.0)51 demo = dict(scale=1.0, rg=60.0) 54 52 55 53 # For testing against the old sasview models, include the converted parameter … … 59 57 60 58 # parameters for unit tests 61 tests = [ 62 [{'rg' : 31.5}, 0.005, 0.991756] 63 ] 59 tests = [[{'rg' : 31.5}, 0.005, 0.991756]] -
sasmodels/models/hollow_cylinder.py
rec2ca99 re0fd913 93 93 source = ["lib/J1.c", "lib/gauss76.c", "hollow_cylinder.c"] 94 94 95 # pylint: disable=W0613 95 96 def ER(radius, core_radius, length): 96 97 """ -
sasmodels/models/lamellarCailleHG.py
r13ed84c r652a78a 146 146 solvent_sld='sld_solvent') 147 147 # 148 tests = [ 149 [ {'scale': 1.0, 'background' : 0.0, 'tail_length' : 10.0, 'head_length' : 2.0,'Nlayers' : 30.0, 'spacing' : 40., 150 'Caille_parameter' : 0.001, 'sld' : 0.4, 'head_sld' : 2.0, 'solvent_sld' : 6.0, 151 'tail_length_pd' : 0.0, 'head_length_pd' : 0.0, 'spacing_pd' : 0.0 }, [0.001], [6838238.571488]] 152 ] 148 tests = [[{'scale': 1.0, 'background': 0.0, 'tail_length': 10.0, 'head_length': 2.0, 149 'Nlayers': 30.0, 'spacing': 40., 'Caille_parameter': 0.001, 'sld': 0.4, 150 'head_sld': 2.0, 'solvent_sld': 6.0, 'tail_length_pd': 0.0, 151 'head_length_pd': 0.0, 'spacing_pd': 0.0}, [0.001], [6838238.571488]]] -
sasmodels/models/lamellarFFHG.py
r7f47777 r3eb6b90 68 68 category = "shape:lamellae" 69 69 70 # pylint: disable=bad-whitespace, line-too-long 70 71 # ["name", "units", default, [lower, upper], "type","description"], 71 parameters = [["tail_length", "Ang", 15, [0, inf], "volume", 72 "Tail thickness"], 73 ["head_length", "Ang", 10, [0, inf], "volume", 74 "head thickness"], 75 ["sld", "1e-6/Ang^2", 0.4, [-inf,inf], "", 76 "Tail scattering length density"], 77 ["head_sld", "1e-6/Ang^2", 3.0, [-inf,inf], "", 78 "Head scattering length density"], 79 ["solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "", 80 "Solvent scattering length density"], 81 ] 72 parameters = [["tail_length", "Ang", 15, [0, inf], "volume", "Tail thickness"], 73 ["head_length", "Ang", 10, [0, inf], "volume", "head thickness"], 74 ["sld", "1e-6/Ang^2", 0.4, [-inf,inf], "", "Tail scattering length density"], 75 ["head_sld", "1e-6/Ang^2", 3.0, [-inf,inf], "", "Head scattering length density"], 76 ["solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "", "Solvent scattering length density"]] 77 # pylint: enable=bad-whitespace, line-too-long 82 78 83 79 # No volume normalization despite having a volume parameter … … 113 109 114 110 demo = dict(scale=1, background=0, 115 tail_length=15, head_length=10,111 tail_length=15, head_length=10, 116 112 sld=0.4, head_sld=3.0, solvent_sld=6.0, 117 tail_length_pd= 118 head_length_pd= 113 tail_length_pd=0.2, tail_length_pd_n=40, 114 head_length_pd=0.01, head_length_pd_n=40) 119 115 120 116 oldname = 'LamellarFFHGModel' … … 122 118 sld='sld_tail', head_sld='sld_head', solvent_sld='sld_solvent') 123 119 # 124 tests = [ 125 [ {'scale': 1.0, 'background' : 0.0, 'tail_length' : 15.0, 'head_length' : 10.0,'sld' : 0.4, 126 'head_sld' : 3.0, 'solvent_sld' : 6.0, }, [0.001], [653143.9209]] 127 ] 128 129 120 tests = [[{'scale': 1.0, 'background': 0.0, 'tail_length': 15.0, 'head_length': 10.0, 121 'sld': 0.4, 'head_sld': 3.0, 'solvent_sld': 6.0}, [0.001], [653143.9209]]] -
sasmodels/models/lorentz.py
reb69cce reb5901b 56 56 57 57 # parameters for demo 58 demo = dict(scale=1.0, background=0.0,cor_length=50.0)58 demo = dict(scale=1.0, background=0.0, cor_length=50.0) 59 59 60 60 # For testing against the old sasview models, include the converted parameter … … 64 64 65 65 # parameters for unit tests 66 tests = [ 67 [{'cor_length' : 250},0.01,0.137931] 68 ] 66 tests = [[{'cor_length': 250}, 0.01, 0.137931]] -
sasmodels/models/peak_lorentz.py
r14ba6f6 r04b0b30 11 11 I(q) = \frac{scale}{\bigl(1+\bigl(\frac{q-q_0}{B}\bigr)^2\bigr)} + background 12 12 13 with the peak having height of $I_0$ centered at $q_0$ and having a HWHM (half-width half-maximum) of B. 13 with the peak having height of $I_0$ centered at $q_0$ and having 14 a HWHM (half-width half-maximum) of B. 14 15 15 16 For 2D data the scattering intensity is calculated in the same way as 1D, … … 55 56 56 57 def Iq(q, peak_pos, peak_hwhm): 58 """ 59 Return I(q) 60 """ 57 61 inten = (1/(1+((q-peak_pos)/peak_hwhm)**2)) 58 62 return inten … … 60 64 61 65 def Iqxy(qx, qy, *args): 66 """ 67 Return I(qx, qy) 68 """ 62 69 return Iq(sqrt(qx ** 2 + qy ** 2), *args) 63 70 Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values -
sasmodels/models/porod.py
r16bb433 r1ce6e82 13 13 of the sample, and $\Delta\rho$ is the contrast factor. 14 14 15 For 2D data: The 2D scattering intensity is calculated in the same way as 1D, 15 For 2D data: The 2D scattering intensity is calculated in the same way as 1D, 16 16 where the q vector is defined as 17 17 -
sasmodels/models/rpa.py
r82c299f r8dd6914 89 89 # ["name", "units", default, [lower, upper], "type","description"], 90 90 parameters = [ 91 ["case_num", CASES, 0, [0, 10], "", "Component organization" 91 ["case_num", CASES, 0, [0, 10], "", "Component organization"], 92 92 93 93 ["Na", "", 1000.0, [1, inf], "", "Degree of polymerization"], -
sasmodels/models/sphere.py
r9c461c7 rc691551 100 100 101 101 def ER(radius): 102 """ 103 Return equivalent radius (ER) 104 """ 102 105 return radius 103 106 -
sasmodels/models/triaxial_ellipsoid.py
r9c461c7 r469e763 82 82 ---------- 83 83 84 L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray and Neutron Scattering*, Plenum,85 New York, 1987.84 L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray 85 and Neutron Scattering*, Plenum, New York, 1987. 86 86 """ 87 87 … … 120 120 121 121 def ER(req_minor, req_major, rpolar): 122 """ 123 Returns the effective radius used in the S*P calculation 124 """ 122 125 import numpy as np 123 126 from .ellipsoid import ER as ellipsoid_ER -
sasmodels/models/vesicle.py
r216fa6d r068cebd 60 60 """ 61 61 62 import numpy as np63 62 from numpy import pi, inf 64 63 … … 131 130 # NOTE: test results taken from values returned by SasView 3.1.2 132 131 tests = [[{}, 0.0010005303255, 17139.8268799], 133 [{}, 0.200027832249, 0.130387268704 132 [{}, 0.200027832249, 0.130387268704], 134 133 [{}, 'ER', 130.], 135 134 [{}, 'VR', 0.54483386436],
Note: See TracChangeset
for help on using the changeset viewer.