Changeset 7b7fcf0 in sasmodels


Ignore:
Timestamp:
Feb 7, 2017 5:55:02 PM (4 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
0813a99
Parents:
1105286
Message:

allow negative q in resolution calculation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/resolution.py

    rb397165 r7b7fcf0  
    8484        self.weight_matrix = pinhole_resolution(self.q_calc, self.q, 
    8585                                np.maximum(q_width, MINIMUM_RESOLUTION)) 
     86        self.q_calc = abs(self.q_calc) 
    8687 
    8788    def apply(self, theory): 
     
    125126        self.weight_matrix = \ 
    126127            slit_resolution(self.q_calc, self.q, qx_width, qy_width) 
     128        self.q_calc = abs(self.q_calc) 
    127129 
    128130    def apply(self, theory): 
     
    153155    # neither trapezoid nor Simpson's rule improved the accuracy. 
    154156    edges = bin_edges(q_calc) 
    155     edges[edges < 0.0] = 0.0 # clip edges below zero 
     157    #edges[edges < 0.0] = 0.0 # clip edges below zero 
    156158    cdf = erf((edges[:, None] - q[None, :]) / (sqrt(2.0)*q_width)[None, :]) 
    157159    weights = cdf[1:] - cdf[:-1] 
     
    286288    # The current algorithm is a midpoint rectangle rule. 
    287289    q_edges = bin_edges(q_calc) # Note: requires q > 0 
    288     q_edges[q_edges < 0.0] = 0.0 # clip edges below zero 
     290    #q_edges[q_edges < 0.0] = 0.0 # clip edges below zero 
    289291    weights = np.zeros((len(q), len(q_calc)), 'd') 
    290292 
Note: See TracChangeset for help on using the changeset viewer.