Changeset 39a06c9 in sasmodels for sasmodels/sasview_model.py
- Timestamp:
- Oct 25, 2018 5:58:26 PM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 81751c2
- Parents:
- 304c775
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sasview_model.py
rbe43e39 r39a06c9 695 695 return self._calculate_Iq(qx, qy) 696 696 697 def _calculate_Iq(self, qx, qy=None ):697 def _calculate_Iq(self, qx, qy=None, Fq=False, effective_radius_type=1): 698 698 if self._model is None: 699 699 self._model = core.build_model(self._model_info) … … 715 715 #print("values", values) 716 716 #print("is_mag", is_magnetic) 717 if Fq: 718 result = calculator.Fq(call_details, values, cutoff=self.cutoff, 719 magnetic=is_magnetic, 720 effective_radius_type=effective_radius_type) 717 721 result = calculator(call_details, values, cutoff=self.cutoff, 718 722 magnetic=is_magnetic) … … 726 730 return result, lazy_results 727 731 728 def calculate_ER(self): 732 733 def calculate_ER(self, mode=1): 729 734 # type: () -> float 730 735 """ … … 733 738 :return: the value of the effective radius 734 739 """ 735 if self._model_info.ER is None: 736 return 1.0 737 else: 738 value, weight = self._dispersion_mesh() 739 fv = self._model_info.ER(*value) 740 #print(values[0].shape, weights.shape, fv.shape) 741 return np.sum(weight * fv) / np.sum(weight) 740 Fq = self._calculate_Iq([0.1], True, mode) 741 return Fq[2] 742 742 743 743 def calculate_VR(self): … … 746 746 Calculate the volf ratio for P(q)*S(q) 747 747 748 :return: the value of the volf ratio 749 """ 750 if self._model_info.VR is None: 751 return 1.0 752 else: 753 value, weight = self._dispersion_mesh() 754 whole, part = self._model_info.VR(*value) 755 return np.sum(weight * part) / np.sum(weight * whole) 748 :return: the value of the form:shell volume ratio 749 """ 750 Fq = self._calculate_Iq([0.1], True, mode) 751 return Fq[4] 756 752 757 753 def set_dispersion(self, parameter, dispersion):
Note: See TracChangeset
for help on using the changeset viewer.