Changeset 4c2c535 in sasmodels
- Timestamp:
- Dec 21, 2015 12:26:36 PM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- cade620
- Parents:
- c138211
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernelpy.py
r9404dd3 r4c2c535 203 203 args[pd_index[0]] = fast_value[fast_index] 204 204 weight[0] = fast_weight[fast_index] 205 # This computes the weight, and if it is sufficient, calls the 206 # scattering function and adds it to the total. If there is a volume 207 # normalization, it will also be added here. 208 # Note: make sure this is consistent with the code in PY_LOOP_BODY!! 209 # Note: can precompute w1*w2*...*wn 205 206 # Computes the weight, and if it is not sufficient then ignore this 207 # parameter set. 208 # Note: could precompute w1*...*wn so we only need to multiply by w0 210 209 w = np.prod(weight) 211 210 if w > cutoff: 212 I = form(*args)213 #positive = (I >= 0.0)214 215 211 # Note: can precompute spherical correction if theta_index is not 216 212 # the fast index. Correction factor for spherical integration … … 219 215 if theta_index >= 0 else 1.0) 220 216 #spherical_correction = 1.0 221 ret += w * I * spherical_correction #* positive 222 norm += w #* positive 217 218 # Call the scattering function and adds it to the total. 219 I = form(*args) 220 if np.isnan(I).any(): continue 221 ret += w * I * spherical_correction 222 norm += w 223 223 224 224 # Volume normalization. … … 230 230 vol_args = [args[index] for index in vol_index] 231 231 vol_weight = np.prod(weight[vol_weight_index]) 232 vol += vol_weight * form_volume(*vol_args) #* positive233 vol_norm += vol_weight #* positive232 vol += vol_weight * form_volume(*vol_args) 233 vol_norm += vol_weight 234 234 235 235 positive = (vol * vol_norm != 0.0)
Note: See TracChangeset
for help on using the changeset viewer.