Changeset 3a1afed in sasmodels
 Timestamp:
 Feb 20, 2019 1:32:04 PM (5 years ago)
 Branches:
 master, core_shell_microgels, magnetic_model, ticket1257vesicleproduct, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
 Children:
 cd28947
 Parents:
 119073a
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sasmodels/sasview_model.py
r5024a56 r3a1afed 695 695 return self._calculate_Iq(qx, qy) 696 696 697 def _calculate_Iq(self, qx, qy=None , Fq=False, effective_radius_type=1):697 def _calculate_Iq(self, qx, qy=None): 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)721 717 result = calculator(call_details, values, cutoff=self.cutoff, 722 718 magnetic=is_magnetic) … … 736 732 Calculate the effective radius for P(q)*S(q) 737 733 734 *mode* is the R_eff type, which defaults to 1 to match the ER 735 calculation for sasview models from version 3.x. 736 738 737 :return: the value of the effective radius 739 738 """ 740 Fq = self._calculate_Iq([0.1], True, mode) 741 return Fq[2] 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.") 742 759 743 760 def calculate_VR(self): … … 748 765 :return: the value of the form:shell volume ratio 749 766 """ 750 Fq = self._calculate_Iq([0.1], True, mode)751 r eturn Fq[4]767 # See comments in calculate_ER. 768 raise NotImplementedError("VR function is no longer available.") 752 769 753 770 def set_dispersion(self, parameter, dispersion):
Note: See TracChangeset
for help on using the changeset viewer.