Changeset 0c7b8d8 in sasmodels


Ignore:
Timestamp:
Mar 28, 2019 6:33:05 AM (6 years ago)
Author:
awashington
Branches:
master
Children:
3f3df6c
Parents:
d522352
Message:

Use 64 bit floats in SesansTransform?

The new log spacing creates small matrices, so there's no longer a
reason not to use full double precision values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sesans.py

    rd522352 r0c7b8d8  
    5959    def _set_hankel(self, SElength, lam, zaccept, Rmax): 
    6060        # type: (np.ndarray, float, float) -> None 
    61         # Force float32 arrays, otherwise run into memory problems on 
    62         # some machines 
    63         SElength = np.asarray(SElength, dtype='float32') 
     61        SElength = np.asarray(SElength, dtype='float64') 
    6462 
    6563        # Rmax = #value in text box somewhere in FitPage? 
     
    7068        #                      dtype=np.float32)) 
    7169        q = np.exp(np.linspace(np.log(q_min), np.log(q_max), 10*SElength.size, 
    72                                dtype=np.float32)) 
     70                               dtype=np.float64)) 
    7371        q = np.hstack([[0], q]) 
    7472 
     
    8280        H /= 2 * np.pi * SElength 
    8381 
    84         lam = np.asarray(lam, dtype=np.float32) 
     82        lam = np.asarray(lam, dtype=np.float64) 
    8583        reptheta = np.outer(q[1:], lam) 
    86         reptheta /= np.float32(2*np.pi) 
     84        reptheta /= np.float64(2*np.pi) 
    8785        np.arcsin(reptheta, out=reptheta) 
    8886        # reptheta = np.arcsin(repq*replam/2*np.pi) 
Note: See TracChangeset for help on using the changeset viewer.