Changeset 43dc17e in sasmodels
- Timestamp:
- Mar 16, 2016 1:07:50 PM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 5be92e8
- Parents:
- 092933d (diff), 2f0c07d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 1 added
- 2 deleted
- 25 edited
- 23 moved
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
r91c5fdc r2f0c07d 672 672 * *tests* is a set of tests that must pass 673 673 * *source* is the list of library files to include in the C model build 674 * *Iq*, *Iqxy*, *form_volume*, *ER*, and *VR* are python functions674 * *Iq*, *Iqxy*, *form_volume*, *ER*, *VR* and *sesans* are python functions 675 675 implementing the kernel for the module, or None if they are not 676 676 defined in python … … 682 682 *model_info* blocks for the composition objects. This allows us to 683 683 build complete product and mixture models from just the info. 684 684 685 """ 685 686 # TODO: maybe turn model_info into a class ModelDefinition … … 710 711 ) 711 712 process_parameters(model_info) 712 # Fill in availablefunctions713 model_info.update((k, getattr(kernel_module, k, None))714 for k in ('ER', 'VR', 'form_volume', 'Iq', 'Iqxy'))713 # Check for optional functions 714 functions = "ER VR form_volume Iq Iqxy shape sesans".split() 715 model_info.update((k, getattr(kernel_module, k, None)) for k in functions) 715 716 return model_info 716 717 -
sasmodels/models/_onion.py
rfdb1487 r2f0c07d 146 146 \frac{j_1(qr_\text{in})}{qr_\text{in}} 147 147 148 .. figure:: img/onion_ annotated_profile.gif148 .. figure:: img/onion_geometry.gif 149 149 150 150 Example of an onion model profile. … … 159 159 NB: The outer most radius is used as the effective radius for $S(q)$ 160 160 when $P(q) S(q)$ is applied. 161 162 .. figure:: img/onion_1d.jpg163 164 1D plot using the default values (w/400 point)165 166 .. figure:: img/onion_profile.jpg167 168 SLD profile from the default values.169 161 170 162 References … … 321 313 322 314 323 def profile(core_sld, core_radius, solvent_sld, n, in_sld, out_sld, thickness, A):315 def shape(core_sld, core_radius, solvent_sld, n, in_sld, out_sld, thickness, A): 324 316 """ 325 Get SLD profile 326 327 Returns *(r, rho(r))* where *r* is the radius (Ang) and *rho(r)* is the 328 SLD (1/Ang^2). 317 SLD profile 329 318 """ 330 319 -
sasmodels/models/adsorbed_layer.py
rcf95788 r2f0c07d 20 20 21 21 Note that all parameters except the |sigma| are correlated so fitting more than one of these parameters will generally fail. Also note that unlike other shape models, no volume normalization is applied to this model (the calculation is exact). 22 23 .. figure:: img/adsorbed_layer_1d.jpg24 25 1D plot using the default values.26 22 27 23 References -
sasmodels/models/barbell.py
r50e1e40 r2f0c07d 68 68 up to you to restrict this during analysis. 69 69 70 .. figure:: img/barbell_1d.jpg 70 The 2D scattering intensity is calculated similar to the 2D cylinder model. 71 71 72 1D plot using the default values (w/256 data point). 73 74 For 2D data, the scattering intensity is calculated similar to the 2D 75 cylinder model. 76 77 .. figure:: img/barbell_2d.jpg 78 79 2D plot (w/(256X265) data points) for $\theta = 45^\circ$ and 80 $\phi = 0^\circ$ with default values for the remaining parameters. 81 82 .. figure:: img/orientation.jpg 72 .. figure:: img/cylinder_angle_definition.jpg 83 73 84 74 Definition of the angles for oriented 2D barbells. 85 75 86 .. figure:: img/ orientation2.jpg76 .. figure:: img/cylinder_angle_projection.jpg 87 77 88 78 Examples of the angles for oriented pp against the detector plane. -
sasmodels/models/bcc.py
rad90df9 r2f0c07d 45 45 46 46 47 .. figure:: img/bcc_ lattice.jpg47 .. figure:: img/bcc_geometry.jpg 48 48 49 49 Body-centered cubic lattice. … … 77 77 *qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above default values. 78 78 79 .. figure:: img/bcc_1d.jpg80 81 1D plot in the linear scale using the default values (w/200 data point).82 83 79 The 2D (Anisotropic model) is based on the reference below where $I(q)$ is 84 80 approximated for 1d scattering. Thus the scattering pattern for 2D may not … … 86 82 model computation. 87 83 88 .. figure:: img/ crystal_orientation.png84 .. figure:: img/bcc_angle_definition.png 89 85 90 86 Orientation of the crystal with respect to the scattering plane. 91 92 .. figure:: img/bcc_2d.jpg93 94 2D plot using the default values (w/200X200 pixels).*95 87 96 88 References -
sasmodels/models/be_polyelectrolyte.py
r0e86967 r2f0c07d 30 30 q = \sqrt{q_x^2 + q_y^2} 31 31 32 33 .. figure:: img/be_polyelectrolyte_1d.jpg34 35 1D plot using the default values (w/500 data point).36 32 37 33 NB: $1 barn = 10^{-24} cm^2$ -
sasmodels/models/broad_peak.py
rdcdf29d r2f0c07d 28 28 q = \sqrt{q_x^2 + q_y^2} 29 29 30 31 .. figure:: img/broad_peak_1d.jpg32 33 1D plot using the default values (w/200 data point).34 30 35 31 References -
sasmodels/models/capped_cylinder.py
r50e1e40 r2f0c07d 69 69 It is up to you to restrict this during analysis. 70 70 71 :num:`Figure #capped-cylinder-1d` shows the output produced by 72 a running the 1D capped cylinder model, using *qmin* = 0.001 |Ang^-1|, 73 *qmax* = 0.7 |Ang^-1| and the default values of the parameters. 71 The 2D scattering intensity is calculated similar to the 2D cylinder model. 74 72 75 .. _capped-cylinder-1d: 76 77 .. figure:: img/capped_cylinder_1d.jpg 78 79 1D plot using the default values (w/256 data point). 80 81 The 2D scattering intensity is calculated similar to the 2D cylinder model. 82 :num:`Figure #capped-cylinder-2d` shows the output for $\theta=45^\circ$ 83 and $\phi=0^\circ$ with default values for the other parameters. 84 85 .. _capped-cylinder-2d: 86 87 .. figure:: img/capped_cylinder_2d.jpg 88 89 2D plot (w/(256X265) data points). 90 91 .. figure:: img/orientation.jpg 73 .. figure:: img/cylinder_angle_definition.jpg 92 74 93 75 Definition of the angles for oriented 2D cylinders. 94 76 95 .. figure:: img/ orientation2.jpg77 .. figure:: img/cylinder_angle_projection.jpg 96 78 97 Examples of the angles for oriented ppagainst the detector plane.79 Examples of the angles for oriented 2D cylinders against the detector plane. 98 80 99 81 References -
sasmodels/models/core_shell_bicelle.py
re7678b2 r2f0c07d 4 4 ---------- 5 5 This model provides the form factor for a circular cylinder with a core-shell 6 scattering length density profile. 7 The form factor is normalized by theparticle volume.6 scattering length density profile. The form factor is normalized by the 7 particle volume. 8 8 9 9 .. _core-shell-bicelle-geometry: … … 21 21 use the c-library from NIST. 22 22 23 .. figure:: img/c ore_shell_bicelle_1d.jpg23 .. figure:: img/cylinder_angle_definition.jpg 24 24 25 1D plot using the default values (w/200 data point).25 Definition of the angles for the oriented core shell bicelle tmodel. 26 26 27 .. figure:: img/core_shell_bicelle_fig1.jpg 28 29 Definition of the angles for the oriented CoreShellBicelleModel. 30 31 .. figure:: img/core_shell_bicelle_fig2.jpg 27 .. figure:: img/cylinder_angle_projection.jpg 32 28 33 29 Examples of the angles for oriented pp against the detector plane. -
sasmodels/models/core_shell_cylinder.py
rf0aa7f8 r2f0c07d 67 67 Validation of our code was done by comparing the output of the 1D model to 68 68 the output of the software provided by the NIST (Kline, 2006). 69 :num:`Figure #core-shell-cylinder-1d` shows a comparison70 of the 1D output of our model and the output of the NIST software.71 72 .. _core-shell-cylinder-1d:73 74 .. figure:: img/core_shell_cylinder_1d.jpg75 76 Comparison of the SasView scattering intensity for a core-shell cylinder77 with the output of the NIST SANS analysis software. The parameters were78 set to: *scale* = 1.0 |Ang|, *radius* = 20 |Ang|, *thickness* = 10 |Ang|,79 *length* =400 |Ang|, *core_sld* =1e-6 |Ang^-2|, *shell_sld* = 4e-6 |Ang^-2|,80 *solvent_sld* = 1e-6 |Ang^-2|, and *background* = 0.01 |cm^-1|.81 69 82 70 Averaging over a distribution of orientation is done by evaluating the 83 71 equation above. Since we have no other software to compare the 84 implementation of the intensity for fully oriented cylinders, we can85 compare the result of averaging our 2D output using a uniform72 implementation of the intensity for fully oriented cylinders, we 73 compared the result of averaging our 2D output using a uniform 86 74 distribution $p(\theta,\phi) = 1.0$. 87 :num:`Figure #core-shell-cylinder-2d` shows the result88 of such a cross-check.89 90 .. _core-shell-cylinder-2d:91 92 .. figure:: img/core_shell_cylinder_2d.jpg93 94 Comparison of the intensity for uniformly distributed core-shell95 cylinders calculated from our 2D model and the intensity from the96 NIST SANS analysis software. The parameters used were: *scale* = 1.0,97 *radius* = 20 |Ang|, *thickness* = 10 |Ang|, *length* = 400 |Ang|,98 *core_sld* = 1e-6 |Ang^-2|, *shell_sld* = 4e-6 |Ang^-2|,99 *solvent_sld* = 1e-6 |Ang^-2|, and *background* = 0.0 |cm^-1|.100 75 101 76 2013/11/26 - Description reviewed by Heenan, R. -
sasmodels/models/core_shell_ellipsoid.py
r177c1a1 r2f0c07d 10 10 applied over all orientations for 1D. 11 11 12 .. figure:: img/core_shell_ellipsoid_ fig1.gif12 .. figure:: img/core_shell_ellipsoid_geometry.gif 13 13 14 14 The returned value is in units of $cm^{-1}$, on absolute scale. … … 36 36 To provide easy access to the orientation of the core-shell ellipsoid, 37 37 we define the axis of the solid ellipsoid using two angles $\theta$ and $\phi$. 38 These angles are defined on Figure 2 of the CylinderModel. 38 These angles are defined as for 39 :ref:`cylinder orientation <cylinder-angle-definition>`. 39 40 The contrast is defined as SLD(core) - SLD(shell) and SLD(shell) - SLD(solvent). 40 41 … … 48 49 and used as the effective radius for *S(Q)* when $P(Q) * S(Q)$ is applied. 49 50 50 .. figure:: img/core_shell_ellipsoid_1d.jpg 51 52 1D plot using the default values (w/200 data point). 53 54 .. figure:: img/core_shell_ellipsoid_fig2.jpg 51 .. figure:: img/core_shell_ellipsoid_angle_projection.jpg 55 52 56 53 The angles for oriented core_shell_ellipsoid. -
sasmodels/models/core_shell_ellipsoid_xt.py
r3882eeb r2f0c07d 10 10 ---------- 11 11 12 .. figure:: img/core_shell_ellipsoid_fig1.gif 13 12 .. figure:: img/core_shell_ellipsoid_geometry.gif 14 13 15 14 The geometric parameters of this model are -
sasmodels/models/core_shell_parallelepiped.py
r44bd2be r2f0c07d 22 22 *A* < *B* < *C*. 23 23 24 .. image:: img/core_shell_parallelepiped .jpg24 .. image:: img/core_shell_parallelepiped_geometry.jpg 25 25 26 26 There are rectangular "slabs" of thickness $t_A$ that add to the *A* dimension … … 72 72 To provide easy access to the orientation of the parallelepiped, we define the 73 73 axis of the cylinder using three angles |theta|, |phi| and |bigpsi|. 74 These angles are defined on Figure 2 of the :ref:`cylinder` model.74 (see :ref:`cylinder orientation <cylinder-angle-definition>`). 75 75 The angle |bigpsi| is the rotational angle around the *long_c* axis against the 76 76 *q* plane. For example, |bigpsi| = 0 when the *short_b* axis is parallel to the 77 77 *x*-axis of the detector. 78 78 79 .. figure:: img/parallelepiped_angle s_definition.jpg79 .. figure:: img/parallelepiped_angle_definition.jpg 80 80 81 81 Definition of the angles for oriented core-shell parallelepipeds. 82 82 83 .. figure:: img/parallelepiped_angle s_examples.jpg83 .. figure:: img/parallelepiped_angle_projection.jpg 84 84 85 85 Examples of the angles for oriented core-shell parallelepipeds against the -
sasmodels/models/cylinder.py
r50e1e40 r2f0c07d 31 31 To provide easy access to the orientation of the cylinder, we define the 32 32 axis of the cylinder using two angles $\theta$ and $\phi$. Those angles 33 are defined in :num:`figure #cylinder- orientation`.33 are defined in :num:`figure #cylinder-angle-definition`. 34 34 35 .. _cylinder- orientation:35 .. _cylinder-angle-definition: 36 36 37 .. figure:: img/ orientation.jpg37 .. figure:: img/cylinder_angle_definition.jpg 38 38 39 39 Definition of the angles for oriented cylinders. 40 40 41 .. figure:: img/ orientation2.jpg41 .. figure:: img/cylinder_angle_projection.jpg 42 42 43 43 Examples of the angles for oriented cylinders against the detector plane. -
sasmodels/models/ellipsoid.py
r431caae r2f0c07d 47 47 $S(q)$ when $P(q) \cdot S(q)$ is applied. 48 48 49 .. _ellipsoid-1d:50 51 .. figure:: img/ellipsoid_1d.jpg52 53 The output of the 1D scattering intensity function for randomly oriented54 ellipsoids given by the equation above.55 56 49 57 50 The $\theta$ and $\phi$ parameters are not used for the 1D output. … … 59 52 .. _ellipsoid-geometry: 60 53 61 .. figure:: img/ellipsoid_ geometry.jpg54 .. figure:: img/ellipsoid_angle_projection.jpg 62 55 63 56 The angles for oriented ellipsoid. -
sasmodels/models/elliptical_cylinder.py
rfa8011eb r2f0c07d 43 43 44 44 To provide easy access to the orientation of the elliptical cylinder, we define the axis of the cylinder using two 45 angles |theta|, |phi| and |bigpsi| . As for the case of the cylinder, the angles |theta| and |phi| are defined on46 Figure 2 of CylinderModel.The angle |bigpsi| is the rotational angle around its own long_c axis against the *q* plane.45 angles |theta|, |phi| and |bigpsi| (see :ref:`cylinder orientation <cylinder-angle-definition>`). 46 The angle |bigpsi| is the rotational angle around its own long_c axis against the *q* plane. 47 47 For example, |bigpsi| = 0 when the *r_minor* axis is parallel to the *x*\ -axis of the detector. 48 48 49 49 All angle parameters are valid and given only for 2D calculation; ie, an oriented system. 50 50 51 .. figure:: img/elliptical_cylinder_ geometry_2d.jpg51 .. figure:: img/elliptical_cylinder_angle_definition.jpg 52 52 53 53 Definition of angles for 2D 54 54 55 .. figure:: img/c ore_shell_bicelle_fig2.jpg55 .. figure:: img/cylinder_angle_projection.jpg 56 56 57 57 Examples of the angles for oriented elliptical cylinders against the detector plane. … … 60 60 and length values, and used as the effective radius for *S(Q)* when *P(Q)* \* *S(Q)* is applied. 61 61 62 63 .. figure:: img/elliptical_cylinder_comparison_1d.jpg64 65 1D plot using the default values (w/1000 data point).66 62 67 63 Validation -
sasmodels/models/fcc.py
rad90df9 r2f0c07d 43 43 where $g$ is a fractional distortion based on the nearest neighbor distance. 44 44 45 .. figure:: img/fcc_ lattice.jpg45 .. figure:: img/fcc_geometry.jpg 46 46 47 47 Face-centered cubic lattice. … … 71 71 integral. Very, very slow. Go get lunch! 72 72 73 This example dataset is produced using 200 data points, *qmin* = 0.01 |Ang^-1|,74 *qmax* = 0.1 |Ang^-1| and the above default values.75 76 .. figure:: img/fcc_1d.jpg77 78 1D plot in the linear scale using the default values (w/200 data point).79 80 73 The 2D (Anisotropic model) is based on the reference below where $I(q)$ is 81 74 approximated for 1d scattering. Thus the scattering pattern for 2D may not … … 83 76 2D model computation. 84 77 85 .. figure:: img/ crystal_orientation.png78 .. figure:: img/bcc_angle_definition.png 86 79 87 80 Orientation of the crystal with respect to the scattering plane. 88 89 .. figure:: img/fcc_2d.jpg90 91 2D plot using the default values (w/200X200 pixels).92 81 93 82 References -
sasmodels/models/hollow_cylinder.py
re0fd913 r2f0c07d 34 34 Bessel function. 35 35 36 To provide easy access to the orientation of the core-shell cylinder, we define37 the axis of the cylinder using two angles $\theta$ and $\phi$. As for the case38 of the cylinder, those angles are defined in Figure 2 of the CylinderModel.39 40 36 **NB**: The 2nd virial coefficient of the cylinder is calculated 41 37 based on the radius and 2 length values, and used as the effective radius … … 45 41 and the *radius* is $R_\text{shell}$ while *core_radius* is $R_\text{core}$. 46 42 47 .. figure:: img/hollow_cylinder_1d.jpg 48 49 1D plot using the default values (w/1000 data point). 50 51 .. figure:: img/orientation.jpg 52 53 Definition of the angles for the oriented hollow_cylinder model. 54 55 .. figure:: img/orientation2.jpg 56 57 Examples of the angles for oriented pp against the detector plane. 43 To provide easy access to the orientation of the core-shell cylinder, we define 44 the axis of the cylinder using two angles $\theta$ and $\phi$ 45 (see :ref:`cylinder model <cylinder-angle-definition>`). 58 46 59 47 References -
sasmodels/models/linear_pearls.py
r32c743d r2f0c07d 5 5 The thickness of each string is assumed to be negligible. 6 6 7 .. figure:: img/linear_pearls_ fig1.jpg7 .. figure:: img/linear_pearls_geometry.jpg 8 8 9 9 … … 25 25 The 2D scattering intensity is the same as P(q) above, 26 26 regardless of the orientation of the q vector. 27 28 .. figure:: img/linear_pearls_1d.jpg29 30 1D plot using the default values (w/500 data point).31 27 32 28 References -
sasmodels/models/multi_shell.py
rd51ea74 r2f0c07d 19 19 parameters fixed as possible. 20 20 21 .. figure:: img/multi_shell_ fig1.jpg21 .. figure:: img/multi_shell_geometry.jpg 22 22 23 23 The 2D scattering intensity is the same as 1D, regardless of the orientation … … 33 33 is used as the effective radius for *S(Q)* when $P(Q) * S(Q)$ is applied. 34 34 35 36 .. figure:: img/multi_shell_1d.jpg37 38 1D plot using the default values (with 200 data point).39 35 40 36 Our model uses the form factor calculations implemented in a c-library provided -
sasmodels/models/parallelepiped.py
rdeb7ee0 r2f0c07d 99 99 .. _parallelepiped-orientation: 100 100 101 .. figure:: img/parallelepiped_angle s_definition.jpg101 .. figure:: img/parallelepiped_angle_definition.jpg 102 102 103 103 Definition of the angles for oriented parallelepipeds. 104 104 105 .. figure:: img/parallelepiped_angle s_examples.jpg105 .. figure:: img/parallelepiped_angle_projection.jpg 106 106 107 107 Examples of the angles for oriented parallelepipeds against the detector plane. … … 156 156 This model is based on form factor calculations implemented in a c-library 157 157 provided by the NIST Center for Neutron Research (Kline, 2006). 158 159 158 """ 160 159 -
sasmodels/models/pearl_necklace.py
rd18582e r2f0c07d 6 6 (= *A* - 2\ *R*)). *A* is the center-to-center pearl separation distance. 7 7 8 .. figure:: img/pearl_ fig.jpg8 .. figure:: img/pearl_necklace_geometry.jpg 9 9 10 10 Pearl Necklace schematic … … 48 48 NB: *number_of_pearls* must be an integer. 49 49 50 .. figure:: img/pearl_plot.jpg 51 52 1D plot using the default values (w/1000 data point). 53 54 REFERENCE 50 References 51 ---------- 55 52 56 53 R Schweins and K Huber, *Particle Scattering Factor of Pearl Necklace Chains*, -
sasmodels/models/sc_crystal.py
rad90df9 r2f0c07d 41 41 The simple cubic lattice is 42 42 43 .. figure:: img/sc_crystal_ fig1.jpg43 .. figure:: img/sc_crystal_geometry.jpg 44 44 45 45 For a crystal, diffraction peaks appear at reduced q-values given by … … 77 77 Go get lunch! 78 78 79 This example dataset is produced using 200 data points,80 $q_{min} = 0.01A^{-1}, q_{max} = 0.1A^{-1}$ and the above default values.81 82 .. figure:: img/sc_crystal_1d.jpg83 84 1D plot in the linear scale using the default values (w/200 data point).85 86 79 The 2D (Anisotropic model) is based on the reference below where *I(q)* is 87 80 approximated for 1d scattering. Thus the scattering pattern for 2D may not … … 89 82 model computation. 90 83 91 .. figure:: img/sc_crystal_fig2.jpg 92 .. figure:: img/sc_crystal_fig3.jpg 93 94 2D plot using the default values (w/200X200 pixels). 84 .. figure:: img/sc_crystal_angle_definition.jpg 95 85 96 86 Reference -
sasmodels/models/stacked_disks.py
rd507c3a r2f0c07d 21 21 ---------- 22 22 23 .. figure:: img/stacked_disks_ fig1.gif23 .. figure:: img/stacked_disks_geometry.gif 24 24 25 25 The scattered intensity $I(q)$ is calculated as … … 68 68 and $\sigma_D$ = the Gaussian standard deviation of the d-spacing (sigma_d). 69 69 70 To provide easy access to the orientation of the stacked disks, we define71 the axis of the cylinder using two angles $\theta$ and $\varphi$.72 These angles are defined on Figure 2 of cylinder_model.73 74 70 .. note:: 75 71 The 2nd virial coefficient of the cylinder is calculated based on the … … 78 74 is applied. 79 75 80 .. figure:: img/stacked_disks_1d.jpg 81 82 1D plot using the default values (w/1000 data point). 83 84 .. figure:: img/stacked_disks_fig2.jpg 76 To provide easy access to the orientation of the stacked disks, we define 77 the axis of the cylinder using two angles $\theta$ and $\varphi$. 78 79 .. figure:: img/stacked_disks_angle_definition.jpg 85 80 86 81 Examples of the angles for oriented stacked disks against 87 82 the detector plane. 88 83 89 .. figure:: img/stacked_disks_ fig3.jpg84 .. figure:: img/stacked_disks_angle_projection.jpg 90 85 91 86 Examples of the angles for oriented pp against the detector plane. -
sasmodels/models/triaxial_ellipsoid.py
r469e763 r2f0c07d 43 43 .. _triaxial-ellipsoid-angles: 44 44 45 .. figure:: img/triaxial_ellipsoid_angle s.jpg45 .. figure:: img/triaxial_ellipsoid_angle_projection.jpg 46 46 47 47 The angles for oriented ellipsoid. … … 57 57 radius $R_e = \sqrt{R_a R_b}$, and used as the effective radius for 58 58 $S(q)$ when $P(q) \cdot S(q)$ is applied. 59 60 .. figure:: img/triaxial_ellipsoid_1d.jpg61 62 1D plot using the default values (w/1000 data point).63 59 64 60 Validation
Note: See TracChangeset
for help on using the changeset viewer.