Changeset 77bfb5f in sasmodels
- Timestamp:
- Apr 13, 2017 9:52:23 AM (8 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- eaa4458
- Parents:
- 597878a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/details.py
rd4c33d6 r77bfb5f 232 232 nvalues = kernel.info.parameters.nvalues 233 233 scalars = [(v[0] if len(v) else np.NaN) for v, w in pairs] 234 # skipping scale and background when building values and weights 234 235 values, weights = zip(*pairs[2:npars+2]) if npars else ((), ()) 235 236 weights = correct_theta_weights(kernel.info.parameters, values, weights) … … 253 254 evaluation strictly at the pole, which would otherwise send the weight to 254 255 zero. 255 """ 256 257 Note: values and weights do not include scale and background 258 """ 259 # TODO: document code, explaining why scale and background are skipped 260 # given that we don't have scale and background in the list, we 261 # should be calling the variables something other than values and weights 262 # Apparently the parameters.theta_offset similarly skips scale and 263 # and background, so the indexing works out. 256 264 if parameters.theta_offset >= 0: 257 index = parameters.theta_offset +len(parameters.COMMON)265 index = parameters.theta_offset 258 266 theta = values[index] 259 267 theta_weight = np.minimum(cos(radians(theta)), 1e-6) 260 268 # copy the weights list so we can update it 261 269 weights = list(weights) 262 weights[index] = theta_weight* weights[index]270 weights[index] = theta_weight*np.asarray(weights[index]) 263 271 weights = tuple(weights) 264 272 return weights
Note: See TracChangeset
for help on using the changeset viewer.