Changeset ff7119b in sasmodels for sasmodels/weights.py
- Timestamp:
- Aug 26, 2014 10:27:06 PM (10 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:
- 5d4777d
- Parents:
- a7684e5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/weights.py
r1780d59 rff7119b 1 """ 2 SAS distributions for polydispersity. 3 """ 1 4 # TODO: include dispersion docs with the disperser models 2 5 from math import sqrt … … 116 119 117 120 121 # dispersion name -> disperser lookup table. 118 122 models = dict((d.type,d) for d in ( 119 123 GaussianDispersion, RectangleDispersion, … … 123 127 124 128 def get_weights(disperser, n, width, nsigmas, value, limits, relative): 129 """ 130 Return the set of values and weights for a polydisperse parameter. 131 132 *disperser* is the name of the disperser. 133 134 *n* is the number of points in the weight vector. 135 136 *width* is the width of the disperser distribution. 137 138 *nsigmas* is the number of sigmas to span for the dispersion convolution. 139 140 *value* is the value of the parameter in the model. 141 142 *limits* is [lb, ub], the lower and upper bound of the weight value. 143 144 *relative* is true if *width* is defined in proportion to the value 145 of the parameter, and false if it is an absolute width. 146 147 Returns *(value,weight)*, where *value* and *weight* are vectors. 148 """ 125 149 cls = models[disperser] 126 150 obj = cls(n, width, nsigmas)
Note: See TracChangeset
for help on using the changeset viewer.