Changeset 6f0e04f in sasmodels for sasmodels/models/core_multi_shell.py
- Timestamp:
- Mar 30, 2016 5:14:38 PM (8 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:
- 204fd9b
- Parents:
- b7172bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_multi_shell.py
rb274bec r6f0e04f 89 89 parameters = [["volfraction", "", 0.05, [0,1],"", 90 90 "volume fraction of spheres"], 91 ["sld ", "1e-6/Ang^2", 1.0, [-inf, inf], "",91 ["sld_core", "1e-6/Ang^2", 1.0, [-inf, inf], "", 92 92 "Core scattering length density"], 93 ["radius", "Ang", 200., [0, inf], " ",93 ["radius", "Ang", 200., [0, inf], "volume", 94 94 "Radius of the core"], 95 95 ["sld_solvent", "1e-6/Ang^2", 6.4, [-inf, inf], "", … … 97 97 ["n", "", 1, [0, 10], "volume", 98 98 "number of shells"], 99 ["sld _shell[n]", "1e-6/Ang^2", 1.7, [-inf, inf], "",99 ["sld[n]", "1e-6/Ang^2", 1.7, [-inf, inf], "", 100 100 "scattering length density of shell k"], 101 ["thick _shell[n]", "Ang", 40., [0, inf], "volume",101 ["thickness[n]", "Ang", 40., [0, inf], "volume", 102 102 "Thickness of shell k"], 103 103 ] … … 112 112 113 113 114 def shape(core_sld, core_radius, solvent_sld, n, in_sld, out_sld, thickness, A):114 def profile(volfraction, sld_core, radius, sld_solvent, n, sld, thickness): 115 115 """ 116 116 SLD profile … … 153 153 # cut an the onion. Seems like we should be consistant? 154 154 155 total_radius = 1.25*(sum(thickness[:n]) + core_radius + 1) 156 dr = total_radius/400 # 400 points for a smooth plot 155 total_radius = 1.25*(sum(thickness[:n]) + radius + 1) 157 156 158 157 r = [] … … 170 169 r0 = r[-1] 171 170 r.append(r0) 172 beta.append(sld _shell[k])171 beta.append(sld[k]) 173 172 r.append(r0 + thickness[k]) 174 beta.append(sld _shell[k])173 beta.append(sld[k]) 175 174 # add in the solvent 176 175 r.append(r[-1]) 177 beta.append(s olvent_sld)176 beta.append(sld_solvent) 178 177 r.append(total_radius) 179 beta.append(s olvent_sld)178 beta.append(sld_solvent) 180 179 181 180 return np.asarray(r), np.asarray(beta) 182 181 183 def ER(radius, n, thick_shell): 184 return np.sum(thick_shell[:n], axis=0) + core_radius 182 def ER(radius, n, thickness): 183 n = n[0] # n cannot be polydisperse 184 return np.sum(thickness[:n], axis=0) + radius 185 185 186 186 def VR(radius, n, thick_shell): 187 return 1.0 188 189 parameters = [["volfraction", "", 0.05, [0,1],"", 190 "volume fraction of spheres"], 191 ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", 192 "Core scattering length density"], 193 ["radius", "Ang", 200., [0, inf], "", 194 "Radius of the core"], 195 ["sld_solvent", "1e-6/Ang^2", 6.4, [-inf, inf], "", 196 "Solvent scattering length density"], 197 ["n", "", 1, [0, 10], "volume", 198 "number of shells"], 199 ["sld_shell[n]", "1e-6/Ang^2", 1.7, [-inf, inf], "", 200 "scattering length density of shell k"], 201 ["thick_shell[n]", "Ang", 40., [0, inf], "volume", 202 "Thickness of shell k"], 203 ] 187 return 1.0, 1.0 204 188 205 189 demo = dict(volfraction = 1.0,
Note: See TracChangeset
for help on using the changeset viewer.