Changeset 5399809 in sasmodels for sasmodels/kernel.py


Ignore:
Timestamp:
Aug 21, 2018 1:32:40 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:
2a12351b
Parents:
c57ee9e
Message:

fix R_eff support infrastructure so more tests pass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernel.py

    r6e7ba14 r5399809  
    4444        # type: (CallDetails, np.ndarray, np.ndarray, float, bool) -> np.ndarray 
    4545        Pq, Reff = self.Pq_Reff(call_details, values, cutoff, magnetic, effective_radius_type=0) 
    46         scale = values[0] 
    47         background = values[1] 
    48         return scale*Pq + background 
     46        return Pq 
    4947    __call__ = Iq 
    5048 
     
    5351        self._call_kernel(call_details, values, cutoff, magnetic, effective_radius_type) 
    5452        #print("returned",self.q_input.q, self.result) 
    55         nout = 2 if self.info.have_Fq else 1 
     53        nout = 2 if self.info.have_Fq and self.dim == '1d' else 1 
    5654        total_weight = self.result[nout*self.q_input.nq + 0] 
    5755        if total_weight == 0.: 
     
    6361        #           = scale*(sum(w*F^2)/sum w)/(sum (w*V)/sum w) + background 
    6462        #           = scale/sum (w*V) * sum(w*F^2) + background 
     63        F2 = self.result[0:nout*self.q_input.nq:nout] 
    6564        scale = values[0]/(weighted_volume if weighted_volume != 0.0 else 1.0) 
    6665        background = values[1] 
     66        Pq = scale*F2 + background 
    6767        #print("scale",scale,background) 
    68         return self.result[0:nout*self.q_input.nq:nout], effective_radius 
     68        return Pq, effective_radius 
    6969 
    7070    def beta(self, call_details, values, cutoff, magnetic, effective_radius_type): 
Note: See TracChangeset for help on using the changeset viewer.