Changeset 3c56da87 in sasmodels for sasmodels/models/broad_peak.py
- Timestamp:
- Mar 5, 2015 12:55:38 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:
- 3a45c2c
- Parents:
- b89f519
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/broad_peak.py
ra5d0d00 r3c56da87 6 6 layered structures, etc. 7 7 8 The d-spacing corresponding to the broad peak is a characteristic distance 9 between the scattering inhomogeneities (such as in lamellar, cylindrical, or 8 The d-spacing corresponding to the broad peak is a characteristic distance 9 between the scattering inhomogeneities (such as in lamellar, cylindrical, or 10 10 spherical morphologies, or for bicontinuous structures). 11 11 … … 44 44 """ 45 45 46 import numpy as np 47 from numpy import pi, inf, sin, cos, sqrt, exp, log, fabs 46 from numpy import inf, sqrt 48 47 49 48 name = "broad_peak" … … 82 81 83 82 84 #def form_volume():85 # return 186 87 83 def Iq(q, porod_scale, porod_exp, lorentz_scale, lorentz_length, peak_pos, lorentz_exp): 88 inten = porod_scale/pow(q,porod_exp) + lorentz_scale/(1.0 \ 89 + pow((fabs(q-peak_pos)*lorentz_length),lorentz_exp)) 90 return inten 91 92 # FOR VECTORIZED VERSION, UNCOMMENT THE NEXT LINE 93 Iq.vectorized = True 84 inten = (porod_scale/q**porod_exp + lorentz_scale 85 / (1.0 + (abs(q-peak_pos)*lorentz_length)**lorentz_exp)) 86 return inten 87 Iq.vectorized = True # Iq accepts an array of Q values 94 88 95 89 def Iqxy(qx, qy, *args): 96 90 return Iq(sqrt(qx**2 + qy**2), *args) 97 98 # FOR VECTORIZED VERSION, UNCOMMENT THE NEXT LINE 99 Iqxy.vectorized = True 91 Iqxy.vectorized = True # Iqxy accepts an array of Qx, Qy values 100 92 101 93 … … 105 97 lorentz_scale=10,lorentz_length=50, peak_pos=0.1, lorentz_exp=2, 106 98 ) 99 107 100 oldname = "BroadPeakModel" 108 oldpars = dict(porod_scale='scale_p', porod_exp='exponent_p', 109 lorentz_scale='scale_l', lorentz_length='length_l', peak_pos='q_peak', 101 oldpars = dict(porod_scale='scale_p', porod_exp='exponent_p', 102 lorentz_scale='scale_l', lorentz_length='length_l', peak_pos='q_peak', 110 103 lorentz_exp='exponent_l', scale=None)
Note: See TracChangeset
for help on using the changeset viewer.