Changeset 411d8bf in sasview
- Timestamp:
- Apr 12, 2012 3:38:37 PM (13 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:
- 92a52ff2
- Parents:
- 2e9c3ea
- Location:
- sansmodels/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/python_wrapper/modelTemplate.txt
re08bd5b r411d8bf 27 27 from sans.models.BaseComponent import BaseComponent 28 28 from sans.models.sans_extension.c_models import [CPYTHONCLASS] 29 import copy30 29 31 30 def create_[PYTHONCLASS](): 31 """ 32 Create a model instance 33 """ 32 34 obj = [PYTHONCLASS]() 33 35 #[CPYTHONCLASS].__init__(obj) is called by [PYTHONCLASS] constructor … … 54 56 self.name = "[PYTHONCLASS]" 55 57 ## Model description 56 self.description = """[DESCRIPTION]"""58 self.description = """[DESCRIPTION]""" 57 59 58 60 [PAR_DETAILS] 59 61 ## fittable parameters 60 self.fixed =[FIXED]62 self.fixed = [FIXED] 61 63 62 64 ## non-fittable parameters … … 78 80 """ 79 81 state = (self.__dict__, self.params, self.dispersion) 80 return (create_[PYTHONCLASS], tuple(), state, None, None)82 return (create_[PYTHONCLASS], tuple(), state, None, None) 81 83 82 84 def clone(self): -
sansmodels/src/sans/models/BroadPeakModel.py
r5385a9e r411d8bf 5 5 6 6 from sans.models.BaseComponent import BaseComponent 7 from math import fabs 7 import math 8 8 from numpy import power 9 9 … … 23 23 ## Name of the model 24 24 self.name = "BroadPeak" 25 self.description ="""I(q) = scale_p/pow(q,exponent)+scale_l/25 self.description = """I(q) = scale_p/pow(q,exponent)+scale_l/ 26 26 (1.0 + pow((fabs(q-q_peak)*length_l),exponent_l) )+ background 27 27 List of default parameters: … … 54 54 55 55 #list of parameter that cannot be fitted 56 self.fixed = []56 self.fixed = [] 57 57 def _broadpeak(self, x): 58 58 """ … … 61 61 inten = self.params['scale_p']/pow(x,self.params['exponent_p']) 62 62 inten += self.params['scale_l']/(1.0 + \ 63 power(( fabs(x-self.params['q_peak'])*self.params['length_l']),\63 power((math.fabs(x-self.params['q_peak'])*self.params['length_l']),\ 64 64 self.params['exponent_l'])) 65 65 -
sansmodels/src/sans/models/CorrLengthModel.py
r18695bf r411d8bf 6 6 from sans.models.BaseComponent import BaseComponent 7 7 from numpy import power 8 import math 8 9 9 10 class CorrLengthModel(BaseComponent): … … 22 23 ## Name of the model 23 24 self.name = "CorrLength" 24 self.description ="""I(q) = scale_p/pow(q,exponent)+scale_l/25 self.description = """I(q) = scale_p/pow(q,exponent)+scale_l/ 25 26 (1.0 + pow((q*length_l),exponent_l) )+ background 26 27 List of default parameters: … … 50 51 51 52 #list of parameter that cannot be fitted 52 self.fixed = []53 self.fixed = [] 53 54 def _corrlength(self, x): 54 55 """ -
sansmodels/src/sans/models/PeakLorentzModel.py
r27fea3f r411d8bf 31 31 ## Name of the model 32 32 self.name = "Peak Lorentz Model" 33 self.description =""" F(q) = scale/(1+[(q-q0)/B]^2 ) + background33 self.description = """ F(q) = scale/(1+[(q-q0)/B]^2 ) + background 34 34 35 35 The model has three parameters: … … 52 52 self.details['background'] = ['[1/cm]', None, None] 53 53 #list of parameter that cannot be fitted 54 self.fixed = []54 self.fixed = [] 55 55 56 56 def _PeakLorentz(self, x): -
sansmodels/src/sans/models/PorodModel.py
r9ce41c6 r411d8bf 36 36 self.details['background'] = ['[1/cm]', None, None] 37 37 #list of parameter that cannot be fitted 38 self.fixed = []38 self.fixed = [] 39 39 40 40 def _porod(self, x): -
sansmodels/src/sans/models/TwoLorentzianModel.py
r18695bf r411d8bf 6 6 from sans.models.BaseComponent import BaseComponent 7 7 from numpy import power 8 import math 8 9 9 10 class TwoLorentzianModel(BaseComponent): … … 22 23 ## Name of the model 23 24 self.name = "TwoLorentzian" 24 self.description ="""I(q) = scale_1/(1.0 + pow((q*length_1),exponent_1))25 self.description = """I(q) = scale_1/(1.0 + pow((q*length_1),exponent_1)) 25 26 + scale_2/(1.0 + pow((q*length_2),exponent_2) )+ background 26 27 List of default parameters: … … 53 54 54 55 #list of parameter that cannot be fitted 55 self.fixed = []56 self.fixed = [] 56 57 def _twolorentzian(self, x): 57 58 """
Note: See TracChangeset
for help on using the changeset viewer.