Changeset 18695bf in sasview for sansmodels/src
- Timestamp:
- Jan 18, 2011 10:38:36 AM (14 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 18b89c4
- Parents:
- 1b02da1d
- Location:
- sansmodels/src/sans/models
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/BroadPeakModel.py
r8f20419d r18695bf 5 5 6 6 from sans.models.BaseComponent import BaseComponent 7 from math import pow, fabs 7 from math import fabs 8 from numpy import power 8 9 9 10 class BroadPeakModel(BaseComponent): … … 19 20 # Initialize BaseComponent first, then sphere 20 21 BaseComponent.__init__(self) 21 22 self.counter = 0 22 23 ## Name of the model 23 24 self.name = "BroadPeak" … … 60 61 inten = self.params['scale_p']/pow(x,self.params['exponent_p']) 61 62 inten += self.params['scale_l']/(1.0 + \ 62 pow((fabs(x-self.params['q_peak'])*self.params['length_l']),self.params['exponent_l'])) 63 power((fabs(x-self.params['q_peak'])*self.params['length_l']),\ 64 self.params['exponent_l'])) 65 63 66 inten += self.params['background'] 64 67 65 68 return inten 66 69 -
sansmodels/src/sans/models/CorrLengthModel.py
r8f20419d r18695bf 5 5 6 6 from sans.models.BaseComponent import BaseComponent 7 from math import pow7 from numpy import power 8 8 9 9 class CorrLengthModel(BaseComponent): … … 57 57 inten = self.params['scale_p']/pow(x,self.params['exponent_p']) 58 58 inten += self.params['scale_l']/(1.0 + \ 59 pow ((x*self.params['length_l']),self.params['exponent_l']))59 power((x*self.params['length_l']),self.params['exponent_l'])) 60 60 inten += self.params['background'] 61 61 -
sansmodels/src/sans/models/FractalCoreShellModel.py
r8f20419d r18695bf 3 3 from sans.models.CoreShellModel import CoreShellModel 4 4 from scipy.special import gammaln 5 from math import exp, pow, sin, atan 5 from math import exp, sin, atan 6 from numpy import power 6 7 from copy import deepcopy 7 8 … … 79 80 #calculate S(q) 80 81 sq = Df*exp(gammaln(Df-1.0))*sin((Df-1.0)*atan(x*corr)) 81 sq /= pow ((x*r0),Df) * pow((1.0 + 1.0/(x*corr*x*corr)),((Df-1)/2))82 sq /= power((x*r0),Df) * power((1.0 + 1.0/(x*corr*x*corr)),((Df-1)/2)) 82 83 sq += 1.0 83 84 return sq -
sansmodels/src/sans/models/TwoLorentzianModel.py
r8f20419d r18695bf 5 5 6 6 from sans.models.BaseComponent import BaseComponent 7 from math import pow7 from numpy import power 8 8 9 9 class TwoLorentzianModel(BaseComponent): … … 59 59 """ 60 60 inten = self.params['scale_1']/(1.0 + \ 61 pow ((x*self.params['length_1']),self.params['exponent_1']))61 power((x*self.params['length_1']),self.params['exponent_1'])) 62 62 inten += self.params['scale_2']/(1.0 + \ 63 pow ((x*self.params['length_2']),self.params['exponent_2']))63 power((x*self.params['length_2']),self.params['exponent_2'])) 64 64 inten += self.params['background'] 65 65 -
sansmodels/src/sans/models/TwoPowerLawModel.py
r8f20419d r18695bf 7 7 8 8 from sans.models.BaseComponent import BaseComponent 9 from math import pow9 from numpy import power 10 10 11 11 class TwoPowerLawModel(BaseComponent): … … 65 65 qc= self.params['qc'] 66 66 if(x<=qc): 67 inten = self.params['coef_A']*pow (x,-1.0*self.params['power1'])67 inten = self.params['coef_A']*power(x,-1.0*self.params['power1']) 68 68 else: 69 scale = self.params['coef_A']*pow (qc,-1.0*self.params['power1']) \70 / pow (qc,-1.0*self.params['power2'])71 inten = scale*pow (x,-1.0*self.params['power2'])69 scale = self.params['coef_A']*power(qc,-1.0*self.params['power1']) \ 70 / power(qc,-1.0*self.params['power2']) 71 inten = scale*power(x,-1.0*self.params['power2']) 72 72 inten += self.params['background'] 73 73 -
sansmodels/src/sans/models/UnifiedPowerRgModel.py
r29100cb r18695bf 1 1 2 2 from sans.models.BaseComponent import BaseComponent 3 from math import pow,exp, sqrt 3 from math import exp, sqrt 4 from numpy import power 4 5 from scipy.special import erf 5 6 max_level_n = 7 … … 74 75 for ind in range(1,l_num+1): 75 76 # get exp term 76 exp_now = exp(-pow (x*self.params['Rg%s'% ind],2)/3.0)77 exp_now = exp(-power(x*self.params['Rg%s'% ind],2)/3.0) 77 78 # get erf term 78 79 erf_now = erf(x*self.params['Rg%s'% ind]/sqrt(6.0)) 79 80 # get power term 80 pow_now = pow ((erf_now*erf_now*erf_now/x),self.params['power%s'% ind])81 pow_now = power((erf_now*erf_now*erf_now/x),self.params['power%s'% ind]) 81 82 # get next exp term only if it exists 82 83 try: 83 exp_next = exp(-pow (x*self.params['Rg%s'% (ind+1)],2)/3.0)84 exp_next = exp(-power(x*self.params['Rg%s'% (ind+1)],2)/3.0) 84 85 except: 85 86 exp_next = 1.0
Note: See TracChangeset
for help on using the changeset viewer.