Changes in / [4073633:d8ac2ad] in sasmodels


Ignore:
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • doc/guide/magnetism/magnetism.rst

    r4f5afc9 r2c108a3  
    55 
    66Models which define a scattering length density parameter can be evaluated 
    7 as magnetic models. In general, the scattering length density (SLD = 
    8 $\beta$) in each region where the SLD is uniform, is a combination of the 
    9 nuclear and magnetic SLDs and, for polarised neutrons, also depends on the 
    10 spin states of the neutrons. 
     7 as magnetic models. In general, the scattering length density (SLD = 
     8 $\beta$) in each region where the SLD is uniform, is a combination of the 
     9 nuclear and magnetic SLDs and, for polarised neutrons, also depends on the 
     10 spin states of the neutrons. 
    1111 
    1212For magnetic scattering, only the magnetization component $\mathbf{M_\perp}$ 
    1313perpendicular to the scattering vector $\mathbf{Q}$ contributes to the magnetic 
    1414scattering length. 
     15 
    1516 
    1617.. figure:: 
     
    2728is the Pauli spin. 
    2829 
    29 Assuming that incident neutrons are polarized parallel $(+)$ and anti-parallel 
    30 $(-)$ to the $x'$ axis, the possible spin states after the sample are then: 
     30Assuming that incident neutrons are polarized parallel (+) and anti-parallel (-) 
     31to the $x'$ axis, the possible spin states after the sample are then 
    3132 
    32 * Non spin-flip $(+ +)$ and $(- -)$ 
     33Non spin-flip (+ +) and (- -) 
    3334 
    34 * Spin-flip $(+ -)$ and $(- +)$ 
    35  
    36 Each measurement is an incoherent mixture of these spin states based on the 
    37 fraction of $+$ neutrons before ($u_i$) and after ($u_f$) the sample, 
    38 with weighting: 
    39  
    40 .. math:: 
    41     -- &= ((1-u_i)(1-u_f))^{1/4} \\ 
    42     -+ &= ((1-u_i)(u_f))^{1/4} \\ 
    43     +- &= ((u_i)(1-u_f))^{1/4} \\ 
    44     ++ &= ((u_i)(u_f))^{1/4} 
    45  
    46 Ideally the experiment would measure the pure spin states independently and 
    47 perform a simultaneous analysis of the four states, tying all the model 
    48 parameters together except $u_i$ and $u_f$. 
     35Spin-flip    (+ -) and (- +) 
    4936 
    5037.. figure:: 
     
    8976 
    9077===========   ================================================================ 
    91  M0:sld      $D_M M_0$ 
    92  mtheta:sld   $\theta_M$ 
    93  mphi:sld     $\phi_M$ 
    94  up:angle     $\theta_\mathrm{up}$ 
    95  up:frac_i    $u_i$ = (spin up)/(spin up + spin down) *before* the sample 
    96  up:frac_f    $u_f$ = (spin up)/(spin up + spin down) *after* the sample 
     78 M0_sld        = $D_M M_0$ 
     79 Up_theta      = $\theta_\mathrm{up}$ 
     80 M_theta       = $\theta_M$ 
     81 M_phi         = $\phi_M$ 
     82 Up_frac_i     = (spin up)/(spin up + spin down) neutrons *before* the sample 
     83 Up_frac_f     = (spin up)/(spin up + spin down) neutrons *after* the sample 
    9784===========   ================================================================ 
    9885 
    9986.. note:: 
    100     The values of the 'up:frac_i' and 'up:frac_f' must be in the range 0 to 1. 
     87    The values of the 'Up_frac_i' and 'Up_frac_f' must be in the range 0 to 1. 
    10188 
    10289*Document History* 
    10390 
    10491| 2015-05-02 Steve King 
    105 | 2017-11-15 Paul Kienzle 
     92| 2017-05-08 Paul Kienzle 
  • explore/check1d.py

    r1e867a4 ra5f91a7  
    2929        elif arg.startswith('-angle='): 
    3030            angle = float(arg[7:]) 
    31         elif arg != "-2d": 
     31        else: 
    3232            argv.append(arg) 
    3333    opts = compare.parse_opts(argv) 
  • sasmodels/models/bcc_paracrystal.py

    r1f159bd reda8b30  
    6969  The calculation of $Z(q)$ is a double numerical integral that 
    7070  must be carried out with a high density of points to properly capture 
    71   the sharp peaks of the paracrystalline scattering. 
    72   So be warned that the calculation is slow. Fitting of any experimental data 
     71  the sharp peaks of the paracrystalline scattering.      
     72  So be warned that the calculation is slow. Fitting of any experimental data  
    7373  must be resolution smeared for any meaningful fit. This makes a triple integral 
    7474  which may be very slow. 
    75  
     75   
    7676This example dataset is produced using 200 data points, 
    7777*qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above default values. 
     
    7979The 2D (Anisotropic model) is based on the reference below where $I(q)$ is 
    8080approximated for 1d scattering. Thus the scattering pattern for 2D may not 
    81 be accurate, particularly at low $q$. For general details of the calculation and angular 
     81be accurate, particularly at low $q$. For general details of the calculation and angular  
    8282dispersions for oriented particles see :ref:`orientation` . 
    8383Note that we are not responsible for any incorrectness of the 2D model computation. 
     
    158158# april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 
    159159# add 2d test later 
    160 # TODO: fix the 2d tests 
    161160q = 4.*pi/220. 
    162161tests = [ 
    163162    [{}, [0.001, q, 0.215268], [1.46601394721, 2.85851284174, 0.00866710287078]], 
    164     #[{'theta': 20.0, 'phi': 30, 'psi': 40.0}, (-0.017, 0.035), 2082.20264399], 
    165     #[{'theta': 20.0, 'phi': 30, 'psi': 40.0}, (-0.081, 0.011), 0.436323144781], 
     163    [{'theta': 20.0, 'phi': 30, 'psi': 40.0}, (-0.017, 0.035), 2082.20264399], 
     164    [{'theta': 20.0, 'phi': 30, 'psi': 40.0}, (-0.081, 0.011), 0.436323144781], 
    166165    ] 
  • sasmodels/models/core_shell_parallelepiped.py

    r1f159bd r393facf  
    221221         [{'theta':10.0, 'phi':20.0}, [(qx, qy)], [0.0853299803222]], 
    222222        ] 
    223 del tests  # TODO: fix the tests 
    224223del qx, qy  # not necessary to delete, but cleaner 
  • sasmodels/models/fcc_paracrystal.py

    r1f159bd reda8b30  
    6868  The calculation of $Z(q)$ is a double numerical integral that 
    6969  must be carried out with a high density of points to properly capture 
    70   the sharp peaks of the paracrystalline scattering. 
    71   So be warned that the calculation is slow. Fitting of any experimental data 
     70  the sharp peaks of the paracrystalline scattering.      
     71  So be warned that the calculation is slow. Fitting of any experimental data  
    7272  must be resolution smeared for any meaningful fit. This makes a triple integral 
    7373  which may be very slow. 
     
    7575The 2D (Anisotropic model) is based on the reference below where $I(q)$ is 
    7676approximated for 1d scattering. Thus the scattering pattern for 2D may not 
    77 be accurate particularly at low $q$. For general details of the calculation 
     77be accurate particularly at low $q$. For general details of the calculation  
    7878and angular dispersions for oriented particles see :ref:`orientation` . 
    7979Note that we are not responsible for any incorrectness of the 
     
    139139 
    140140# april 10 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 
    141 # TODO: fix the 2d tests 
    142141q = 4.*pi/220. 
    143142tests = [ 
    144143    [{}, [0.001, q, 0.215268], [0.275164706668, 5.7776842567, 0.00958167119232]], 
    145     #[{}, (-0.047, -0.007), 238.103096286], 
    146     #[{}, (0.053, 0.063), 0.863609587796], 
     144    [{}, (-0.047, -0.007), 238.103096286], 
     145    [{}, (0.053, 0.063), 0.863609587796], 
    147146] 
  • sasmodels/product.py

    r146793b rce99754  
    142142    def __init__(self, model_info, P, S): 
    143143        # type: (ModelInfo, KernelModel, KernelModel) -> None 
    144         #: Combined info plock for the product model 
    145144        self.info = model_info 
    146         #: Form factor modelling individual particles. 
    147145        self.P = P 
    148         #: Structure factor modelling interaction between particles. 
    149146        self.S = S 
    150         #: Model precision. This is not really relevant, since it is the 
    151         #: individual P and S models that control the effective dtype, 
    152         #: converting the q-vectors to the correct type when the kernels 
    153         #: for each are created. Ideally this should be set to the more 
    154         #: precise type to avoid loss of precision, but precision in q is 
    155         #: not critical (single is good enough for our purposes), so it just 
    156         #: uses the precision of the form factor. 
    157         self.dtype = P.dtype  # type: np.dtype 
     147        self.dtype = P.dtype 
    158148 
    159149    def make_kernel(self, q_vectors): 
Note: See TracChangeset for help on using the changeset viewer.