Changeset 31df0c9 in sasmodels for sasmodels/models/cylinder.py


Ignore:
Timestamp:
Aug 1, 2017 2:38:47 PM (7 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:
1511c37c
Parents:
d49ca5c
Message:

tuned random model generation for more models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/cylinder.py

    r9802ab3 r31df0c9  
    6363.. figure:: img/cylinder_angle_definition.png 
    6464 
    65     Definition of the $\theta$ and $\phi$ orientation angles for a cylinder relative  
    66     to the beam line coordinates, plus an indication of their orientation distributions  
    67     which are described as rotations about each of the perpendicular axes $\delta_1$ and $\delta_2$  
     65    Definition of the $\theta$ and $\phi$ orientation angles for a cylinder relative 
     66    to the beam line coordinates, plus an indication of their orientation distributions 
     67    which are described as rotations about each of the perpendicular axes $\delta_1$ and $\delta_2$ 
    6868    in the frame of the cylinder itself, which when $\theta = \phi = 0$ are parallel to the $Y$ and $X$ axes. 
    6969 
     
    7272    Examples for oriented cylinders. 
    7373 
    74 The $\theta$ and $\phi$ parameters to orient the cylinder only appear in the model when fitting 2d data.  
     74The $\theta$ and $\phi$ parameters to orient the cylinder only appear in the model when fitting 2d data. 
    7575On introducing "Orientational Distribution" in the angles, "distribution of theta" and "distribution of phi" parameters will 
    76 appear. These are actually rotations about the axes $\delta_1$ and $\delta_2$ of the cylinder, which when $\theta = \phi = 0$ are parallel  
     76appear. These are actually rotations about the axes $\delta_1$ and $\delta_2$ of the cylinder, which when $\theta = \phi = 0$ are parallel 
    7777to the $Y$ and $X$ axes of the instrument respectively. Some experimentation may be required to understand the 2d patterns fully. 
    78 (Earlier implementations had numerical integration issues in some circumstances when orientation distributions passed through 90 degrees, such  
    79 situations, with very broad distributions, should still be approached with care.)  
     78(Earlier implementations had numerical integration issues in some circumstances when orientation distributions passed through 90 degrees, such 
     79situations, with very broad distributions, should still be approached with care.) 
    8080 
    8181Validation 
     
    150150    return 0.5 * (ddd) ** (1. / 3.) 
    151151 
     152def random(): 
     153    import numpy as np 
     154    V = 10**np.random.uniform(5, 12) 
     155    length = 10**np.random.uniform(-2, 2)*V**0.333 
     156    radius = np.sqrt(V/length/np.pi) 
     157    pars = dict( 
     158        #scale=1, 
     159        #background=0, 
     160        length=length, 
     161        radius=radius, 
     162    ) 
     163    return pars 
     164 
     165 
    152166# parameters for demo 
    153167demo = dict(scale=1, background=0, 
Note: See TracChangeset for help on using the changeset viewer.