Changeset 2d81cfe in sasmodels for sasmodels/models/cylinder.py


Ignore:
Timestamp:
Nov 29, 2017 11:13:23 AM (6 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:
237b800f
Parents:
a839b22
Message:

lint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/cylinder.py

    reda8b30 r2d81cfe  
    6464 
    6565    Angles $\theta$ and $\phi$ orient the cylinder relative 
    66     to the beam line coordinates, where the beam is along the $z$ axis. Rotation $\theta$, initially  
     66    to the beam line coordinates, where the beam is along the $z$ axis. Rotation $\theta$, initially 
    6767    in the $xz$ plane, is carried out first, then rotation $\phi$ about the $z$ axis. Orientation distributions 
    6868    are described as rotations about two perpendicular axes $\delta_1$ and $\delta_2$ 
     
    133133              ["theta", "degrees", 60, [-360, 360], "orientation", 
    134134               "cylinder axis to beam angle"], 
    135               ["phi", "degrees",   60, [-360, 360], "orientation", 
     135              ["phi", "degrees", 60, [-360, 360], "orientation", 
    136136               "rotation about beam"], 
    137137             ] 
    138138 
    139 source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c",  "cylinder.c"] 
     139source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "cylinder.c"] 
    140140 
    141141def ER(radius, length): 
     
    147147 
    148148def random(): 
    149     import numpy as np 
    150     V = 10**np.random.uniform(5, 12) 
    151     length = 10**np.random.uniform(-2, 2)*V**0.333 
    152     radius = np.sqrt(V/length/np.pi) 
     149    volume = 10**np.random.uniform(5, 12) 
     150    length = 10**np.random.uniform(-2, 2)*volume**0.333 
     151    radius = np.sqrt(volume/length/np.pi) 
    153152    pars = dict( 
    154153        #scale=1, 
     
    172171qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
    173172# After redefinition of angles, find new tests values.  Was 10 10 in old coords 
    174 tests = [[{}, 0.2, 0.042761386790780453], 
    175         [{}, [0.2], [0.042761386790780453]], 
    176 #  new coords 
    177         [{'theta':80.1534480601659, 'phi':10.1510817110481}, (qx, qy), 0.03514647218513852], 
    178         [{'theta':80.1534480601659, 'phi':10.1510817110481}, [(qx, qy)], [0.03514647218513852]], 
    179 # old coords   [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03514647218513852], 
    180 #              [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03514647218513852]], 
    181         ] 
     173tests = [ 
     174    [{}, 0.2, 0.042761386790780453], 
     175    [{}, [0.2], [0.042761386790780453]], 
     176    #  new coords 
     177    [{'theta':80.1534480601659, 'phi':10.1510817110481}, (qx, qy), 0.03514647218513852], 
     178    [{'theta':80.1534480601659, 'phi':10.1510817110481}, [(qx, qy)], [0.03514647218513852]], 
     179    # old coords 
     180    #[{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03514647218513852], 
     181    #[{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03514647218513852]], 
     182] 
    182183del qx, qy  # not necessary to delete, but cleaner 
    183184# ADDED by:  RKH  ON: 18Mar2016 renamed sld's etc 
Note: See TracChangeset for help on using the changeset viewer.