Changeset 3ee4d96 in sasview for sansmodels/src/sans/models
- Timestamp:
- Apr 18, 2012 12:54:57 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:
- 279e371
- Parents:
- 9e91546
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/DABModel.py
r8d97277 r3ee4d96 29 29 ## Name of the model 30 30 self.name = "DAB_Model" 31 self.description="""F(x) = scale*(L^3)/( 1 + (x*L)^2 )^(2) + background 31 self.description = """ 32 F(x) = scale*(L^3)/( 1 + (x*L)^2 )^(2) + background 32 33 33 34 The model has three parameters: … … 47 48 self.details['background'] = ['[1/cm]', None, None] 48 49 #list of parameter that cannot be fitted 49 self.fixed= [] 50 self.fixed = [] 51 50 52 def _DAB(self, x): 51 53 """ 52 54 Evaluate F(x) = (scale*L^3)/( 1 + (x*L)^2 )^(2) + background 53 54 55 """ 55 # According to SRK (Igor/NIST code: 6 JUL 2009 changed definition of 'scale' to be uncorrelated with 'length') 56 return self.params['scale']*math.pow(self.params['length'],3)/math.pow(( 1 + math.pow(x * self.params['length'],2)),2) \ 57 + self.params['background'] 58 56 # According to SRK (Igor/NIST code: 6 JUL 2009 changed definition 57 # of 'scale' to be uncorrelated with 'length') 58 return self.params['scale']*math.pow(self.params['length'], 3)/\ 59 math.pow(( 1 + math.pow(x * self.params['length'], 2)), 2) \ 60 + self.params['background'] 59 61 60 62 def run(self, x = 0.0): … … 66 68 return self._DAB(x[0]) 67 69 elif x.__class__.__name__ == 'tuple': 68 raise ValueError, "Tuples are not allowed as input to BaseComponentmodels"70 raise ValueError, "Tuples are not allowed as input to models" 69 71 else: 70 72 return self._DAB(x) … … 79 81 return self._DAB(q) 80 82 elif x.__class__.__name__ == 'tuple': 81 raise ValueError, "Tuples are not allowed as input to BaseComponentmodels"83 raise ValueError, "Tuples are not allowed as input to models" 82 84 else: 83 85 return self._DAB(x)
Note: See TracChangeset
for help on using the changeset viewer.