Changeset 39a06c9 in sasmodels for sasmodels/sasview_model.py


Ignore:
Timestamp:
Oct 25, 2018 5:58:26 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

Remove references to ER and VR from sasmodels. Refs #1202.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    rbe43e39 r39a06c9  
    695695            return self._calculate_Iq(qx, qy) 
    696696 
    697     def _calculate_Iq(self, qx, qy=None): 
     697    def _calculate_Iq(self, qx, qy=None, Fq=False, effective_radius_type=1): 
    698698        if self._model is None: 
    699699            self._model = core.build_model(self._model_info) 
     
    715715        #print("values", values) 
    716716        #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) 
    717721        result = calculator(call_details, values, cutoff=self.cutoff, 
    718722                            magnetic=is_magnetic) 
     
    726730        return result, lazy_results 
    727731 
    728     def calculate_ER(self): 
     732 
     733    def calculate_ER(self, mode=1): 
    729734        # type: () -> float 
    730735        """ 
     
    733738        :return: the value of the effective radius 
    734739        """ 
    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] 
    742742 
    743743    def calculate_VR(self): 
     
    746746        Calculate the volf ratio for P(q)*S(q) 
    747747 
    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] 
    756752 
    757753    def set_dispersion(self, parameter, dispersion): 
Note: See TracChangeset for help on using the changeset viewer.