Changeset e47b06b in sasmodels


Ignore:
Timestamp:
Jul 26, 2017 9:42:25 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
acc6c8f
Parents:
1dd7a45f
Message:

explore: code cleanup in long cylinder accuracy assessment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • explore/symint.py

    r1dd7a45f re47b06b  
    3232    return norm, cylinder 
    3333 
    34 def make_inf_cylinder(radius, length): 
    35     def inf_cylinder(q): 
     34def make_long_cylinder(radius, length): 
     35    def long_cylinder(q): 
    3636        return norm/q * sas_2J1x_x(q*radius)**2 
    37     inf_cylinder.__doc__ = "inf cylinder radius=%g, length=%g"%(radius, length) 
     37    long_cylinder.__doc__ = "long cylinder radius=%g, length=%g"%(radius, length) 
    3838    volume = pi*radius**2*length 
    3939    norm = 1e-4*volume*CONTRAST**2*pi/length 
    40     return inf_cylinder 
     40    return long_cylinder 
    4141 
    4242def make_sphere(radius): 
     
    135135length = 1e5 
    136136NORM, KERNEL = make_cylinder(radius=radius, length=length) 
    137 inf_cyl = make_inf_cylinder(radius=radius, length=length) 
     137long_cyl = make_long_cylinder(radius=radius, length=length) 
    138138#NORM, KERNEL = make_sphere(radius=50.) 
    139139 
     
    145145    for k in (8, 10, 13, 16, 19): 
    146146        gridded_integrals(Q, n=2**k+1) 
    147     #print("inf cyl", 0, inf_cyl(Q)) 
     147    #print("inf cyl", 0, long_cyl(Q)) 
    148148    #scipy_romberg(Q) 
    149149 
     
    155155 
    156156    q = np.logspace(-3, 0, 400) 
    157     I1 = inf_cyl(q) 
     157    I1 = long_cyl(q) 
    158158    I2 = plot_Iq(q, n=2**19+1, form="trapz") 
    159159    #plot_Iq(q, n=2**16+1, form="trapz") 
     
    163163    #plot_Iq(q, n=150, form="gauss") 
    164164    #plot_Iq(q, n=76, form="gauss") 
    165     pylab.loglog(q, inf_cyl(q), label="limit") 
     165    pylab.loglog(q, long_cyl(q), label="limit") 
    166166    pylab.legend() 
    167167 
Note: See TracChangeset for help on using the changeset viewer.