Changes in sasmodels/sasview_model.py [3a1afed:5024a56] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sasview_model.py
r3a1afed r5024a56 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) … … 732 736 Calculate the effective radius for P(q)*S(q) 733 737 734 *mode* is the R_eff type, which defaults to 1 to match the ER735 calculation for sasview models from version 3.x.736 737 738 :return: the value of the effective radius 738 739 """ 739 # ER and VR are only needed for old multiplication models, based on 740 # sas.sascalc.fit.MultiplicationModel. Fail for now. If we want to 741 # continue supporting them then add some test cases so that the code 742 # is exercised. We can access ER/VR using the kernel Fq function by 743 # extending _calculate_Iq so that it calls: 744 # if er_mode > 0: 745 # res = calculator.Fq(call_details, values, cutoff=self.cutoff, 746 # magnetic=False, effective_radius_type=mode) 747 # R_eff, form_shell_ratio = res[2], res[4] 748 # return R_eff, form_shell_ratio 749 # Then use the following in calculate_ER: 750 # ER, VR = self._calculate_Iq(q=[0.1], er_mode=mode) 751 # return ER 752 # Similarly, for calculate_VR: 753 # ER, VR = self._calculate_Iq(q=[0.1], er_mode=1) 754 # return VR 755 # Obviously a combined calculate_ER_VR method would be better, but 756 # we only need them to support very old models, so ignore the 2x 757 # performance hit. 758 raise NotImplementedError("ER function is no longer available.") 740 Fq = self._calculate_Iq([0.1], True, mode) 741 return Fq[2] 759 742 760 743 def calculate_VR(self): … … 765 748 :return: the value of the form:shell volume ratio 766 749 """ 767 # See comments in calculate_ER.768 r aise NotImplementedError("VR function is no longer available.")750 Fq = self._calculate_Iq([0.1], True, mode) 751 return Fq[4] 769 752 770 753 def set_dispersion(self, parameter, dispersion):
Note: See TracChangeset
for help on using the changeset viewer.