Changeset a7107a6 in sasview for sansmodels/src/sans/models
- Timestamp:
- Sep 26, 2010 9:53:21 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:
- 65a8b34
- Parents:
- 7381f34
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/SphereExpShellModel.py
ra1b2471 ra7107a6 139 139 : return: (r, beta) where r is a list of radius of the transition points 140 140 beta is a list of the corresponding SLD values 141 : Note: This works only for func_shell# = 2.142 141 """ 143 142 # max_pts for each shells … … 157 156 r0 = r[len(r)-1] 158 157 r.append(r0) 159 exec "beta.append(self.params['sld_in_shell%s'% str(n)])"158 beta.append(self.params['sld_in_shell%s'% str(n)]) 160 159 161 exec "A = self.params['A_shell%s'% str(n)]"160 A = self.params['A_shell%s'% str(n)] 162 161 if A ==0: 163 162 # Right side of each shells 164 exec "r0 += self.params['thick_shell%s'% str(n)]"163 r0 += self.params['thick_shell%s'% str(n)] 165 164 r.append(r0) 166 exec "beta.append(self.params['sld_in_shell%s'% str(n)])"165 beta.append(self.params['sld_in_shell%s'% str(n)]) 167 166 else: 168 167 from math import exp … … 170 169 for n_sub in range(0,max_pts): 171 170 # Right side of each sub_shells 172 exec "rn += self.params['thick_shell%s'% str(n)]/10.0"171 rn += self.params['thick_shell%s'% str(n)]/10.0 173 172 r.append(rn) 174 exec "slope = (self.params['sld_out_shell%s'% str(n)] \173 slope = (self.params['sld_out_shell%s'% str(n)] \ 175 174 -self.params['sld_in_shell%s'% str(n)]) \ 176 /(exp(self.params['A_shell%s'% str(n)])-1) "177 exec "const = (self.params['sld_in_shell%s'% str(n)]-slope)"178 exec "beta_n = slope*exp((self.params['A_shell%s'% str(n)]*(rn-r0) \179 /self.params['thick_shell%s'% str(n)])) + const "175 /(exp(self.params['A_shell%s'% str(n)])-1) 176 const = (self.params['sld_in_shell%s'% str(n)]-slope) 177 beta_n = slope*exp((self.params['A_shell%s'% str(n)]*(rn-r0) \ 178 /self.params['thick_shell%s'% str(n)])) + const 180 179 beta.append(beta_n) 181 180 … … 246 245 247 246 : param x: input q-value (float or [float, float] as [r, theta]) 248 : return: ( DABvalue)247 : return: (I value) 249 248 """ 250 249 … … 256 255 257 256 : param x: input q-value (float or [float, float] as [qx, qy]) 258 : return: DABvalue257 : return: I value 259 258 """ 260 259
Note: See TracChangeset
for help on using the changeset viewer.