Changeset 87964ac in sasmodels
 Timestamp:
 May 17, 2018 9:10:20 PM (9 months ago)
 Branches:
 master, F1F2models_grethe, beta_approx, cudatest, py3, ticket1015gpumemerror, ticket1015quickfix, ticket1022sum_multiplicity, ticket1157, ticket608userdefinedweights, ticket_1156, webgl_jitter_viewer
 Children:
 65fbf7c
 Parents:
 df0d2ca
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sasmodels/resolution.py
rdf0d2ca r87964ac 106 106 *q* points at which the data is measured. 107 107 108 * dqx* slit width in qx109 110 * dqy* slit height in qy108 *qx_width* slit width in qx 109 110 *qy_width* slit height in qy 111 111 112 112 *q_calc* is the list of points to calculate, or None if this should … … 513 513 514 514 515 def gaussian(q, q0, dq ):516 """ 517 Return the Gaussian resolution function.515 def gaussian(q, q0, dq, nsigma=2.5): 516 """ 517 Return the truncated Gaussian resolution function. 518 518 519 519 *q0* is the center, *dq* is the width and *q* are the points to evaluate. 520 520 """ 521 return exp(0.5*((qq0)/dq)**2)/(sqrt(2*pi)*dq) 521 # Calculate the density of the tails; the resulting gaussian needs to be 522 # scaled by this amount in ordere to integrate to 1.0 523 two_tail_density = 2 * (1 + erf(nsigma/sqrt(2)))/2 524 return exp(0.5*((qq0)/dq)**2)/(sqrt(2*pi)*dq)/(1two_tail_density) 522 525 523 526 … … 696 699 output = resolution.apply(theory) 697 700 np.testing.assert_equal(output, self.y) 701 702 # TODO: turn pinhole/slit demos into tests 698 703 699 704 def test_pinhole(self): … … 1104 1109 1105 1110 if isinstance(resolution, Slit1D): 1106 width, height = resolution. dqx, resolution.dqy1111 width, height = resolution.qx_width, resolution.qy_width 1107 1112 Iq_romb = romberg_slit_1d(resolution.q, width, height, model, pars) 1108 1113 else:
Note: See TracChangeset
for help on using the changeset viewer.