Changeset cd8dde1 in sasmodels


Ignore:
Timestamp:
Sep 1, 2015 1:25:48 PM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
eff3d66, 3d5c6f8
Parents:
3e6aaad
Message:

fix resolution for simulated 2D data

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/bumps_model.py

    r3e6aaad rcd8dde1  
    153153    # 5% dQ/Q resolution 
    154154    if resolution != 0: 
    155         data.dqx_data = resolution * Qx 
    156         data.dqy_data = resolution * Qy 
     155        # https://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_15.pdf 
     156        # Should have an additional constant which depends on distances and 
     157        # radii of the aperture, pixel dimensions and wavelength spread 
     158        # Instead, assume radial dQ/Q is constant, and perpendicular matches 
     159        # radial (which instead it should be inverse). 
     160        Q = np.sqrt(Qx**2 + Qy**2) 
     161        data.dqx_data = resolution * Q 
     162        data.dqy_data = resolution * Q 
    157163 
    158164    detector = Detector() 
  • sasmodels/resolution2d.py

    r3e6aaad rcd8dde1  
    1818NSIGMA = 3.0 
    1919## Defaults 
    20 NR = {'Xhigh':10, 'High':5, 'Med':5, 'Low':3} 
    21 NPHI ={'Xhigh':20, 'High':12, 'Med':6, 'Low':4} 
     20NR = {'xhigh':10, 'high':5, 'med':5, 'low':3} 
     21NPHI ={'xhigh':20, 'high':12, 'med':6, 'low':4} 
    2222 
    2323class Pinhole2D(Resolution): 
     
    4141        ## of r and phi. 
    4242        ## number of bins in r axis for over-sampling 
    43         self.nr = NR[accuracy] 
     43        self.nr = NR[accuracy.lower()] 
    4444        ## number of bins in phi axis for over-sampling  
    45         self.nphi = NPHI[accuracy] 
     45        self.nphi = NPHI[accuracy.lower()] 
    4646        ## maximum nsigmas 
    4747        self.nsigma= nsigma 
Note: See TracChangeset for help on using the changeset viewer.