Changeset 9c1a59c in sasmodels
- Timestamp:
- Sep 27, 2016 9:49:19 AM (8 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:
- 6cefbc9
- Parents:
- 52ec91e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sasview_model.py
r3bcb88c r9c1a59c 565 565 parameters = self._model_info.parameters 566 566 pairs = [self._get_weights(p) for p in parameters.call_parameters] 567 #weights.plot_weights(self._model_info, pairs) 567 568 call_details, values, is_magnetic = make_kernel_args(calculator, pairs) 568 569 #call_details.show() … … 618 619 # remember them is kind of funky. 619 620 # Note: can't seem to get disperser parameters from sasview 620 # (1) Could create a sasview model that has not yet #been621 # (1) Could create a sasview model that has not yet been 621 622 # converted, assign the disperser to one of its polydisperse 622 623 # parameters, then retrieve the disperser parameters from the 623 # sasview model. (2) Could write a disperser parameter retriever624 # in sasview. (3) Could modify sasview to use sasmodels.weights625 # dispersers.624 # sasview model. 625 # (2) Could write a disperser parameter retriever in sasview. 626 # (3) Could modify sasview to use sasmodels.weights dispersers. 626 627 # For now, rely on the fact that the sasview only ever uses 627 628 # new dispersers in the set_dispersion call and create a new 628 629 # one instead of trying to assign parameters. 629 dispersion = weights.MODELS[dispersion.type]()630 630 self.dispersion[parameter] = dispersion.get_pars() 631 631 else: … … 658 658 elif par.polydisperse: 659 659 dis = self.dispersion[par.name] 660 value, weight = weights.get_weights( 661 dis['type'], dis['npts'], dis['width'], dis['nsigmas'], 662 self.params[par.name], par.limits, par.relative_pd) 660 if dis['type'] == 'array': 661 value, weight = dis['values'], dis['weights'] 662 else: 663 value, weight = weights.get_weights( 664 dis['type'], dis['npts'], dis['width'], dis['nsigmas'], 665 self.params[par.name], par.limits, par.relative_pd) 663 666 return value, weight / np.sum(weight) 664 667 else:
Note: See TracChangeset
for help on using the changeset viewer.