Changeset cfbcb6a in sasview
- Timestamp:
- Oct 8, 2009 4:47:31 PM (15 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:
- 515cc389
- Parents:
- a99a29ac
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DataLoader/invariant.py
ra99a29ac rcfbcb6a 130 130 131 131 q_star= 2*(pi*contrast)**2* volume( 1- volume) 132 for k = q_star/(2*(pi*|contrast|)**2)132 for k = 10^(8)*q_star/(2*(pi*|contrast|)**2) 133 133 we get 2 values of volume: 134 134 volume1 = (1- sqrt(1- 4*k))/2 135 135 volume2 = (1+ sqrt(1- 4*k))/2 136 136 contrast unit is 1/A^(2)= 10^(16)cm^(2) 137 q_star unit 1/A^(3)*1/cm 138 137 139 the result returned will be 0<= volume <= 1 or None 138 140 … … 140 142 @return None : if the invariant Calculator does not a computed 141 143 q_star already stored 144 @note: volume fraction must have no unit 142 145 """ 143 146 if contrast ==None: … … 154 157 155 158 #compute intermediate constant 156 k = self.q_star /(2*(math.pi* math.fabs(float(contrast)))**2)159 k = 1.e-8*self.q_star /(2*(math.pi* math.fabs(float(contrast)))**2) 157 160 #check discriminant value 158 161 discrim= 1 - 4*k … … 168 171 print "volume1",volume1 169 172 print "volume2",volume2 170 if 0<= volume1<= 1: 173 174 if 0<= volume1 and volume1 <= 1: 171 175 return volume1 172 elif 0<= volume2 <= 1:176 elif 0<= volume2 and volume2<= 1: 173 177 return volume2 174 178 return
Note: See TracChangeset
for help on using the changeset viewer.