Changeset 1c8ff89 in sasmodels


Ignore:
Timestamp:
Mar 30, 2019 4:49:45 AM (5 years ago)
Author:
awashington
Branches:
master
Children:
da33725
Parents:
ccbbc3b
Message:

Apply Paul's suggested changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sesans.py

    r3f3df6c r1c8ff89  
    4242    _H0 = None  # type: np.ndarray 
    4343 
    44     def __init__(self, z, SElength, lam, zaccept, Rmax): 
     44    def __init__(self, z, SElength, lam, zaccept, Rmax, log_spacing=1.0003): 
    4545        # type: (np.ndarray, float, float) -> None 
    4646        self.q = z 
     47        self.log_spacing = log_spacing 
    4748        self._set_hankel(SElength, lam, zaccept, Rmax) 
    4849 
     
    6263        q_max = 2*pi / (SElength[1] - SElength[0]) 
    6364        q_min = 0.1 * 2*pi / (np.size(SElength) * SElength[-1]) 
    64         q = np.exp(np.arange(np.log(q_min), np.log(q_max), np.log(1.0003))) 
     65        q = np.exp(np.arange(np.log(q_min), np.log(q_max), 
     66                             np.log(self.log_spacing))) 
    6567 
    66         dq = q[1:]-q[:-1] 
    67         dq = np.hstack([[dq[0]], dq]) 
     68        dq = np.diff(q) 
     69        dq = np.insert(dq, 0, dq[0]) 
    6870 
    6971        H0 = dq/(2*pi) * q 
     
    7173        H = np.outer(q, SElength) 
    7274        j0(H, out=H) 
    73         H *= (dq * q).reshape((-1, 1)) 
    74         H /= 2*pi 
     75        H *= (dq * q / (2*pi)).reshape((-1, 1)) 
    7576 
    76         reptheta = np.outer(q, lam) 
    77         reptheta /= 2*np.pi 
     77        reptheta = np.outer(q, lam/2*pi) 
    7878        np.arcsin(reptheta, out=reptheta) 
    7979        mask = reptheta > zaccept 
Note: See TracChangeset for help on using the changeset viewer.