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


Ignore:
Timestamp:
Aug 1, 2017 4: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/parallelepiped.py

    r34a9e4e r31df0c9  
    2222.. note:: 
    2323 
    24 The three dimensions of the parallelepiped (strictly here a cuboid) may be given in  
     24The three dimensions of the parallelepiped (strictly here a cuboid) may be given in 
    2525$any$ size order. To avoid multiple fit solutions, especially 
    26 with Monte-Carlo fit methods, it may be advisable to restrict their ranges. There may  
    27 be a number of closely similar "best fits", so some trial and error, or fixing of some  
     26with Monte-Carlo fit methods, it may be advisable to restrict their ranges. There may 
     27be a number of closely similar "best fits", so some trial and error, or fixing of some 
    2828dimensions at expected values, may help. 
    2929 
     
    115115 
    116116On introducing "Orientational Distribution" in the angles, "distribution of theta" and "distribution of phi" parameters will 
    117 appear. These are actually rotations about axes $\delta_1$ and $\delta_2$ of the parallelepiped, perpendicular to the $a$ x $c$ and $b$ x $c$ faces.  
    118 (When $\theta = \phi = 0$ these are parallel to the $Y$ and $X$ axes of the instrument.) The third orientation distribution, in $\psi$, is  
    119 about the $c$ axis of the particle, perpendicular to the $a$ x $b$ face. Some experimentation may be required to  
    120 understand the 2d patterns fully. (Earlier implementations had numerical integration issues in some circumstances when orientation  
    121 distributions passed through 90 degrees, such situations, with very broad distributions, should still be approached with care.)  
    122  
    123      
     117appear. These are actually rotations about axes $\delta_1$ and $\delta_2$ of the parallelepiped, perpendicular to the $a$ x $c$ and $b$ x $c$ faces. 
     118(When $\theta = \phi = 0$ these are parallel to the $Y$ and $X$ axes of the instrument.) The third orientation distribution, in $\psi$, is 
     119about the $c$ axis of the particle, perpendicular to the $a$ x $b$ face. Some experimentation may be required to 
     120understand the 2d patterns fully. (Earlier implementations had numerical integration issues in some circumstances when orientation 
     121distributions passed through 90 degrees, such situations, with very broad distributions, should still be approached with care.) 
     122 
     123 
    124124For a given orientation of the parallelepiped, the 2D form factor is 
    125125calculated as 
     
    241241 
    242242# VR defaults to 1.0 
     243 
     244 
     245def random(): 
     246    import numpy as np 
     247    a, b, c = 10**np.random.uniform(1, 4.7, size=3) 
     248    pars = dict( 
     249        length_a=a, 
     250        length_b=b, 
     251        length_c=c, 
     252    ) 
     253    return pars 
     254 
    243255 
    244256# parameters for demo 
Note: See TracChangeset for help on using the changeset viewer.