- Timestamp:
- Sep 2, 2016 9:30:49 AM (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:
- fe77343
- Parents:
- f49675c (diff), e822c97 (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
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/__init__.py
r40a87fa rb2377b0 14 14 defining new models. 15 15 """ 16 __version__ = "0.9 "16 __version__ = "0.93" 17 17 18 18 def data_files(): -
sasmodels/convert.py
r6dc78e4 r51241113 334 334 pars['n_shells'] = math.ceil(pars['n_shells']) 335 335 pars['n_steps'] = math.ceil(pars['n_steps']) 336 for k in range(1, 1 2):336 for k in range(1, 11): 337 337 pars['shape%d'%k] = math.trunc(pars['shape%d'%k]+0.5) 338 for k in range(2, 1 2):338 for k in range(2, 11): 339 339 pars['thickness%d_pd_n'%k] = 0 340 340 pars['interface%d_pd_n'%k] = 0 -
sasmodels/kernelcl.py
r0dc34c3 r14a15a3 568 568 if v is not None: v.release() 569 569 570 scale = values[0]/self.result[self.q_input.nq] 570 pd_norm = self.result[self.q_input.nq] 571 scale = values[0]/(pd_norm if pd_norm!=0.0 else 1.0) 571 572 background = values[1] 572 #print("scale",scale,values[0],self.result[self.q_input.nq] )573 #print("scale",scale,values[0],self.result[self.q_input.nq],background) 573 574 return scale*self.result[:self.q_input.nq] + background 574 575 # return self.result[:self.q_input.nq] -
sasmodels/kerneldll.py
r0dc34c3 r14a15a3 389 389 390 390 #print("returned",self.q_input.q, self.result) 391 scale = values[0]/self.result[self.q_input.nq] 391 pd_norm = self.result[self.q_input.nq] 392 scale = values[0]/(pd_norm if pd_norm!=0.0 else 1.0) 392 393 background = values[1] 393 394 #print("scale",scale,background) -
sasmodels/kernelpy.py
rbde38b5 r14a15a3 187 187 n_pars = len(parameters) 188 188 parameters[:] = values[2:n_pars+2] 189 scale, background = values[0], values[1]190 189 if call_details.num_active == 0: 191 norm = float(form_volume()) 192 if norm > 0.0: 193 return (scale/norm)*form() + background 194 else: 195 return np.ones(nq, 'd')*background 190 pd_norm = float(form_volume()) 191 scale = values[0]/(pd_norm if pd_norm != 0.0 else 1.0) 192 background = values[1] 193 return scale*form() + background 196 194 197 195 pd_value = values[2+n_pars:2+n_pars + call_details.num_weights] … … 245 243 pd_norm += weight * form_volume() 246 244 247 if pd_norm > 0.0: 248 return (scale/pd_norm)*total + background 249 else: 250 return np.ones(nq, 'd')*background 245 scale = values[0]/(pd_norm if pd_norm != 0.0 else 1.0) 246 background = values[1] 247 return scale*total + background 251 248 252 249 -
sasmodels/models/core_multi_shell.py
r9a4811a r8c6fbbc 116 116 117 117 # add in the shells 118 for k in range( n):118 for k in range(int(n)): 119 119 # Left side of each shells 120 120 z.append(z[-1]) -
sasmodels/models/onion.py
r40a87fa r3cd1001 337 337 338 338 # add in the shells 339 for k in range( n_shells):339 for k in range(int(n_shells)): 340 340 # Left side of each shells 341 341 z_current = z[-1] -
sasmodels/models/unified_power_Rg.py
r40a87fa reb574d7 8 8 has been added which simply calculates 9 9 10 .. math: 10 .. math:: 11 11 12 12 I(q) = \text{scale} / q + \text{background} … … 16 16 (Debye equation), ellipsoidal particles, etc. 17 17 18 The empirical fit function is (eq 9'):18 The empirical fit function is: 19 19 20 .. math: 20 .. math:: 21 21 22 22 I(q) = \text{background} 23 + \ Sum_{i=1}^N \left[24 G_i \exp\ left(-\frac{q^2R_{gi}^2}{3}\right)25 + B_i \exp\ left(-\frac{q^2R_{g(i+1)}^2}{3}\right)26 \ left(\frac{1}{q_i^*}\right)^{P_i}23 + \sum_{i=1}^N \Bigl[ 24 G_i \exp\Bigl(-\frac{q^2R_{gi}^2}{3}\Bigr) 25 + B_i \exp\Bigl(-\frac{q^2R_{g(i+1)}^2}{3}\Bigr) 26 \Bigl(\frac{1}{q_i^*}\Bigr)^{P_i} \Bigr] 27 27 28 28 where 29 29 30 .. math: 30 .. math:: 31 31 32 32 q_i^* = \frac{q}{\operatorname{erf}^3(q R_{gi}/\sqrt{6}} … … 45 45 where the $q$ vector is defined as 46 46 47 .. math: 47 .. math:: 48 48 49 49 q = \sqrt{q_x^2 + q_y^2} … … 66 66 67 67 category = "shape-independent" 68 name = "unified_power_Rg" 69 title = "Unified Power Rg" 70 description = """ 71 The Beaucage model employs the empirical multiple level unified 72 Exponential/Power-law fit method developed by G. Beaucage. Four functions 73 are included so that 1, 2, 3, or 4 levels can be used. 74 """ 68 75 69 76 # pylint: disable=bad-whitespace, line-too-long -
sasmodels/compare.py
rb32dafd r8407d8c 563 563 elif dtype.endswith('!'): 564 564 return eval_ctypes(model_info, data, dtype=dtype[:-1], cutoff=cutoff) 565 elif not model_info.opencl: 566 return eval_ctypes(model_info, data, dtype=dtype, cutoff=cutoff) 565 567 else: 566 568 return eval_opencl(model_info, data, dtype=dtype, cutoff=cutoff) -
sasmodels/core.py
r725ee36 rf49675c 46 46 # build_model 47 47 48 KINDS = ("all", "py", "c", "double", "single", " 1d", "2d",48 KINDS = ("all", "py", "c", "double", "single", "opencl", "1d", "2d", 49 49 "nonmagnetic", "magnetic") 50 50 def list_models(kind=None): … … 60 60 * single: models which support single precision 61 61 * double: models which require double precision 62 * opencl: controls if OpenCL is supperessed 62 63 * 1d: models which are 1D only, or 2D using abs(q) 63 64 * 2d: models which can be 2D … … 85 86 return True 86 87 elif kind == "single" and info.single: 88 return True 89 elif kind == "opencl" and info.opencl: 87 90 return True 88 91 elif kind == "2d" and any(p.type == 'orientation' for p in pars): … … 215 218 """ 216 219 # Assign default platform, overriding ocl with dll if OpenCL is unavailable 220 # If opencl=False OpenCL is switched off 221 # Finally one can force OpenCL calculation even if HAVE_OPENCL=False 217 222 if platform is None: 218 223 platform = "ocl" 219 if platform == "ocl" and not HAVE_OPENCL :224 if platform == "ocl" and not HAVE_OPENCL or not model_info.opencl: 220 225 platform = "dll" 226 #if model_info.opencl and not HAVE_OPENCL: 227 # platform = "ocl" 221 228 222 229 # Check if type indicates dll regardless of which platform is given -
sasmodels/modelinfo.py
r40a87fa r8407d8c 731 731 info.category = getattr(kernel_module, 'category', None) 732 732 info.single = getattr(kernel_module, 'single', True) 733 info.opencl = getattr(kernel_module, 'opencl', True) 733 734 info.structure_factor = getattr(kernel_module, 'structure_factor', False) 734 735 info.profile_axes = getattr(kernel_module, 'profile_axes', ['x', 'y'])
Note: See TracChangeset
for help on using the changeset viewer.