\(\renewcommand\AA{\text{Å}}\)
17. GSAS-II Small Angle Scattering
17.1. GSASII small angle calculation module
Classes and routines defined in GSASIIsasd follow.
- GSASII.GSASIIsasd.CylinderARFF(Q, R, args)[source]
Compute form factor for cylinders - can use numpy arrays
- Parameters:
Q (float) – Q value array (A-1)
R (float) – cylinder radius (A)
args (array) – [float AR]: cylinder aspect ratio = L/D = L/2R
- Returns float:
form factor
- GSASII.GSASIIsasd.CylinderARVol(R, args)[source]
Compute cylinder volume for radius & aspect ratio = L/D - numpy array friendly
- Parameters:
float – R radius (A)
args (array) – [float AR]: =L/D=L/2R aspect ratio
- Returns float:
volume
- GSASII.GSASIIsasd.CylinderDFF(Q, L, args)[source]
Compute form factor for cylinders - can use numpy arrays
- Parameters:
Q (float) – Q value array (A-1)
L (float) – cylinder half length (A)
args (array) – [float R]: cylinder radius (A)
- Returns float:
form factor
- GSASII.GSASIIsasd.CylinderDVol(L, args)[source]
Compute cylinder volume for length & diameter - numpy array friendly
- Parameters:
float – L half length (A)
args (array) – [float D]: diameter (A)
- Returns float:
volume (A^3)
- GSASII.GSASIIsasd.CylinderFF(Q, R, args)[source]
Compute form factor for cylinders - can use numpy arrays
- Parameters:
Q (float) – Q value array (A-1)
R (float) – cylinder radius (A)
args (array) – [float L]: cylinder length (A)
- Returns float:
form factor
- GSASII.GSASIIsasd.CylinderVol(R, args)[source]
Compute cylinder volume for radius & length - numpy array friendly
- Parameters:
R (float) – diameter (A)
args (array) – [float L]: length (A)
- Returns float:
volume (A^3)
- GSASII.GSASIIsasd.DiluteSF(Q, args=[])[source]
Default: no structure factor correction for dilute system
- GSASII.GSASIIsasd.G_matrix(q, r, contrast, FFfxn, Volfxn, args=())[source]
Calculates the response matrix \(G(Q,r)\)
- Parameters:
q (float) – \(Q\)
r (float) – \(r\)
contrast (float) – \(|\Delta\rho|^2\), the scattering contrast
FFfxn (function) – form factor function FF(q,r,args)
Volfxn (function) – volume function Vol(r,args)
- Returns float:
G(Q,r)
- GSASII.GSASIIsasd.GaussCume(x, pos, args)[source]
Standard Normal cumulative distribution - numpy friendly on x axis
- Parameters:
x (float) – independent axis (can be numpy array)
pos (float) – location of distribution
scale (float) – width of distribution (sigma)
shape (float) – not used
- Returns float:
Normal cumulative distribution
- GSASII.GSASIIsasd.GaussDist(x, pos, args)[source]
Standard Normal distribution - numpy friendly on x axis
- Parameters:
x (float) – independent axis (can be numpy array)
pos (float) – location of distribution
scale (float) – width of distribution (sigma)
shape (float) – not used
- Returns float:
Normal distribution
- GSASII.GSASIIsasd.HardSpheresSF(Q, args)[source]
Computes structure factor for not dilute monodisperse hard spheres Refs.: PERCUS,YEVICK PHYS. REV. 110 1 (1958),THIELE J. CHEM PHYS. 39 474 (1968), WERTHEIM PHYS. REV. LETT. 47 1462 (1981)
- Parameters:
Q (float) – Q value array (A-1)
args (array) – [float R, float VolFrac]: interparticle distance & volume fraction
- Returns numpy array:
S(Q)
- GSASII.GSASIIsasd.IPG(datum, sigma, G, Bins, Dbins, IterMax, Qvec=[], approach=0.8, Power=-1, report=False)[source]
An implementation of the Interior-Point Gradient method of Michael Merritt & Yin Zhang, Technical Report TR04-08, Dept. of Comp. and Appl. Math., Rice Univ., Houston, Texas 77005, U.S.A. found on the web at http://www.caam.rice.edu/caam/trs/2004/TR04-08.pdf Problem addressed: Total Non-Negative Least Squares (TNNLS)
- Parameters:
datum (float[])
sigma (float[])
G (float[][]) – transformation matrix
IterMax (int)
Qvec (float) – data positions for Power = 0-4
approach (float) – 0.8 default fitting parameter
Power (int) – 0-4 for Q^Power weighting, -1 to use input sigma
- GSASII.GSASIIsasd.InterPrecipitateSF(Q, args)[source]
Computes structure factor for precipitates in a matrix Refs.: E-Wen Huang, Peter K. Liaw, Lionel Porcar, Yun Liu, Yee-Lang Liu, Ji-Jung Kai, and Wei-Ren Chen,APPLIED PHYSICS LETTERS 93, 161904 (2008) R. Giordano, A. Grasso, and J. Teixeira, Phys. Rev. A 43, 6894 1991
- Parameters:
Q (float) – Q value array (A-1)
args (array) – [float R, float VolFr]: “radius” & volume fraction
- Returns numpy array:
S(Q)
- GSASII.GSASIIsasd.LSWCume(x, pos, args=[])[source]
Lifshitz-Slyozov-Wagner Ostwald ripening cumulative distribution - numpy friendly on x axis
- Parameters:
x (float) – independent axis (can be numpy array)
pos (float) – location of distribution
scale (float) – not used
shape (float) – not used
- Returns float:
LSW cumulative distribution
- GSASII.GSASIIsasd.LSWDist(x, pos, args=[])[source]
Lifshitz-Slyozov-Wagner Ostwald ripening distribution - numpy friendly on x axis ref:
- Parameters:
x (float) – independent axis (can be numpy array)
pos (float) – location of distribution
scale (float) – not used
shape (float) – not used
- Returns float:
LSW distribution
- GSASII.GSASIIsasd.LogNormalCume(x, pos, args)[source]
Standard LogNormal cumulative distribution - numpy friendly on x axis ref: http://www.itl.nist.gov/div898/handbook/index.htm 1.3.6.6.9
- Parameters:
x (float) – independent axis (can be numpy array)
pos (float) – location of distribution
scale (float) – width of distribution (sigma)
shape (float) – shape parameter
- Returns float:
LogNormal cumulative distribution
- GSASII.GSASIIsasd.LogNormalDist(x, pos, args)[source]
Standard LogNormal distribution - numpy friendly on x axis ref: http://www.itl.nist.gov/div898/handbook/index.htm 1.3.6.6.9
- Parameters:
x (float) – independent axis (can be numpy array)
pos (float) – location of distribution
scale (float) – width of distribution (m)
shape (float) – shape - (sigma of log(LogNormal))
- Returns float:
LogNormal distribution
- GSASII.GSASIIsasd.MaxEnt_SB(datum, sigma, G, base, IterMax, image_to_data=None, data_to_image=None, report=False)[source]
do the complete Maximum Entropy algorithm of Skilling and Bryan
- Parameters:
datum[] (float)
sigma[] (float)
G (float[][]) – transformation matrix
base[] (float)
IterMax (int)
image_to_data (obj) – opus function (defaults to opus)
data_to_image (obj) – tropus function (defaults to tropus)
- Returns float[]:
\(f(r) dr\)
- GSASII.GSASIIsasd.SchulzZimmCume(x, pos, args)[source]
Schulz-Zimm cumulative distribution - numpy friendly on x axis
- Parameters:
x (float) – independent axis (can be numpy array)
pos (float) – location of distribution
scale (float) – width of distribution (sigma)
shape (float) – not used
- Returns float:
Normal distribution
- GSASII.GSASIIsasd.SchulzZimmDist(x, pos, args)[source]
Schulz-Zimm macromolecule distribution - numpy friendly on x axis ref: http://goldbook.iupac.org/S05502.html
- Parameters:
x (float) – independent axis (can be numpy array)
pos (float) – location of distribution
scale (float) – width of distribution (sigma)
shape (float) – not used
- Returns float:
Schulz-Zimm distribution
- GSASII.GSASIIsasd.SphereFF(Q, R, args=())[source]
Compute hard sphere form factor - can use numpy arrays
- Parameters:
Q (float) – Q value array (usually in A-1)
R (float) – sphere radius (Usually in A - must match Q-1 units)
args (array) – ignored
- Returns:
form factors as array as needed (float)
- GSASII.GSASIIsasd.SphereVol(R, args=())[source]
Compute volume of sphere - numpy array friendly
- Parameters:
R (float) – sphere radius
args (array) – ignored
- Returns float:
volume
- GSASII.GSASIIsasd.SphericalShellFF(Q, R, args=())[source]
Compute spherical shell form factor - can use numpy arrays
- Parameters:
Q (float) – Q value array (usually in A-1)
R (float) – sphere radius (Usually in A - must match Q-1 units)
args (array) – [float r]: controls the shell thickness: R_inner = min(r*R,R), R_outer = max(r*R,R)
- Returns float:
form factors as array as needed
Contributed by: L.A. Avakyan, Southern Federal University, Russia
- GSASII.GSASIIsasd.SphericalShellVol(R, args)[source]
Compute volume of spherical shell - numpy array friendly
- Parameters:
R (float) – sphere radius
args (array) – [float r]: controls shell thickness, see SphericalShellFF description
- Returns float:
volume
- GSASII.GSASIIsasd.SpheroidFF(Q, R, args)[source]
Compute form factor of cylindrically symmetric ellipsoid (spheroid) - can use numpy arrays for R & AR; will return corresponding numpy array
- Parameters:
Q (float) – Q value array (usually in A-1)
R (float) – radius along 2 axes of spheroid
args (array) – [float AR]: aspect ratio so 3rd axis = R*AR
- Returns float:
form factors as array as needed
- GSASII.GSASIIsasd.SpheroidVol(R, args)[source]
Compute volume of cylindrically symmetric ellipsoid (spheroid) - numpy array friendly
- Parameters:
R (float) – radius along 2 axes of spheroid
args (array) – [float AR]: aspect ratio so radius of 3rd axis = R*AR
- Returns float:
volume
- GSASII.GSASIIsasd.SquareWellSF(Q, args)[source]
Computes structure factor for not dilute monodisperse hard sphere with a square well potential interaction. Refs.: SHARMA,SHARMA, PHYSICA 89A,(1977),213-
- Parameters:
Q (float) – Q value array (A-1)
args (array) – [float R, float VolFrac, float depth, float width]: interparticle distance, volume fraction (<0.08), well depth (e/kT<1.5kT), well width
- Returns:
numpy array: S(Q) well depth > 0 attractive & values outside above limits nonphysical cf. Monte Carlo simulations
- GSASII.GSASIIsasd.StickyHardSpheresSF(Q, args)[source]
Computes structure factor for not dilute monodisperse hard spheres Refs.: PERCUS,YEVICK PHYS. REV. 110 1 (1958),THIELE J. CHEM PHYS. 39 474 (1968), WERTHEIM PHYS. REV. LETT. 47 1462 (1981)
- Parameters:
Q (float) – Q value array (A-1)
args (array) – [float R, float VolFrac]: sphere radius & volume fraction
- Returns numpy array:
S(Q)
- GSASII.GSASIIsasd.UniDiskFF(Q, R, args)[source]
Compute form factor for unified disk - can use numpy arrays
- Parameters:
Q (float) – Q value array (A-1)
R (float) – cylinder radius (A)
args (array) – [float T]: disk thickness (A)
- Returns float:
form factor
- GSASII.GSASIIsasd.UniDiskVol(R, args)[source]
Compute disk volume for radius & thickness - numpy array friendly
- Parameters:
R (float) – diameter (A)
args (array) – [float T]: thickness
- Returns float:
volume (A^3)
- GSASII.GSASIIsasd.UniRodARFF(Q, R, args)[source]
Compute form factor for unified rod of fixed aspect ratio - can use numpy arrays
- Parameters:
Q (float) – Q value array (A-1)
R (float) – cylinder radius (A)
args (array) – [float AR]: cylinder aspect ratio = L/D = L/2R
- Returns float:
form factor
- GSASII.GSASIIsasd.UniRodARVol(R, args)[source]
Compute rod volume for radius & aspect ratio - numpy array friendly
- Parameters:
R (float) – diameter (A)
args (array) – [float AR]: =L/D=L/2R aspect ratio
- Returns float:
volume (A^3)
- GSASII.GSASIIsasd.UniRodFF(Q, R, args)[source]
Compute form factor for unified rod - can use numpy arrays
- Parameters:
Q (float) – Q value array (A-1)
R (float) – cylinder radius (A)
args (array) – [float R]: cylinder radius (A)
- Returns float:
form factor
- GSASII.GSASIIsasd.UniRodVol(R, args)[source]
Compute cylinder volume for radius & length - numpy array friendly
- Parameters:
R (float) – diameter (A)
args (array) – [float L]: length (A)
- Returns float:
volume (A^3)
- GSASII.GSASIIsasd.UniSphereFF(Q, R, args=0)[source]
Compute form factor for unified sphere - can use numpy arrays
- Parameters:
Q (float) – Q value array (A-1)
R (float) – cylinder radius (A)
args (array) – ignored
- Returns float:
form factor
- GSASII.GSASIIsasd.UniSphereVol(R, args=())[source]
Compute volume of sphere - numpy array friendly
- Parameters:
R (float) – sphere radius
args (array) – ignored
- Returns float:
volume
- GSASII.GSASIIsasd.UniTubeFF(Q, R, args)[source]
Compute form factor for unified tube - can use numpy arrays assumes that core of tube is same as the matrix/solvent so contrast is from tube wall vs matrix
- Parameters:
Q (float) – Q value array (A-1)
R (float) – cylinder radius (A)
args (array) – [float L,T]: tube length & wall thickness(A)
- Returns float:
form factor
17.2. Substances: Define Materials
Defines materials commonly found in small angle & reflectometry experiments. GSASII substances as a dictionary ‘’Substances.Substances’’ with these materials.
Each entry in ‘’Substances’’ consists of:
'key':{'Elements':{element:{'Num':float number in formula},...},'Density':value, 'Volume':,value}
Density & Volume are optional, if one missing it is calculated from the other; if both are missing then Volume is estimated from composition & assuming 10 AA^3 for each atom. Density is calculated from that Volume. See examples below for what is needed.