Changeset 9f91afe in sasmodels


Ignore:
Timestamp:
Apr 6, 2017 5:23:08 AM (7 years ago)
Author:
Adam Washington <adam.washington@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
668c38b
Parents:
cb0dc22
Message:

Mask out invlid q values for TOF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sesans.py

    r94d13f1 r9f91afe  
    4141    _H0 = None # type: np.ndarray 
    4242 
    43     def __init__(self, z, SElength, zaccept, Rmax): 
     43    def __init__(self, z, SElength, lam, zaccept, Rmax): 
    4444        # type: (np.ndarray, float, float) -> None 
    4545        #import logging; logging.info("creating SESANS transform") 
    4646        self.q = z 
    47         self._set_hankel(SElength, zaccept, Rmax) 
     47        self._set_hankel(SElength, lam, zaccept, Rmax) 
    4848 
    4949    def apply(self, Iq): 
     
    5454        return P 
    5555 
    56     def _set_hankel(self, SElength, zaccept, Rmax): 
     56    def _set_hankel(self, SElength, lam, zaccept, Rmax): 
    5757        # type: (np.ndarray, float, float) -> None 
    5858        # Force float32 arrays, otherwise run into memory problems on some machines 
     
    7171        H = np.float32(dq/(2*pi)) * j0(repSE*repq) * repq 
    7272 
     73        replam = np.tile(lam, (q.size, 1)) 
     74        reptheta = np.arcsin(repq*replam/2*np.pi) 
     75        mask = reptheta > zaccept 
     76        H[mask] = 0 
     77 
    7378        self.q_calc = q 
    7479        self._H, self._H0 = H, H0 
Note: See TracChangeset for help on using the changeset viewer.