14. GSAS-II Small Angle Scattering Submodules

14.1. GSASII small angle calculation module

GSASIIsasd.CylinderARFF(Q, R, args)[source]

Compute form factor for cylinders - can use numpy arrays param float Q: Q value array (A-1) param float R: cylinder radius (A) param array args: [float AR]: cylinder aspect ratio = L/D = L/2R returns float: form factor

GSASIIsasd.CylinderARVol(R, args)[source]

Compute cylinder volume for radius & aspect ratio = L/D - numpy array friendly param float: R radius (A) param array args: [float AR]: =L/D=L/2R aspect ratio returns float:volume

GSASIIsasd.CylinderDFF(Q, L, args)[source]

Compute form factor for cylinders - can use numpy arrays param float Q: Q value array (A-1) param float L: cylinder half length (A) param array args: [float R]: cylinder radius (A) returns float: form factor

GSASIIsasd.CylinderDVol(L, args)[source]

Compute cylinder volume for length & diameter - numpy array friendly param float: L half length (A) param array args: [float D]: diameter (A) returns float:volume (A^3)

GSASIIsasd.CylinderFF(Q, R, args)[source]

Compute form factor for cylinders - can use numpy arrays param float Q: Q value array (A-1) param float R: cylinder radius (A) param array args: [float L]: cylinder length (A) returns float: form factor

GSASIIsasd.CylinderVol(R, args)[source]

Compute cylinder volume for radius & length - numpy array friendly param float R: diameter (A) param array args: [float L]: length (A) returns float:volume (A^3)

GSASIIsasd.DiluteSF(Q, args=[])[source]

Default: no structure factor correction for dilute system

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)

GSASIIsasd.GaussCume(x, pos, args)[source]

Standard Normal cumulative distribution - numpy friendly on x axis param float x: independent axis (can be numpy array) param float pos: location of distribution param float scale: width of distribution (sigma) param float shape: not used returns float: Normal cumulative distribution

GSASIIsasd.GaussDist(x, pos, args)[source]

Standard Normal distribution - numpy friendly on x axis param float x: independent axis (can be numpy array) param float pos: location of distribution param float scale: width of distribution (sigma) param float shape: not used returns float: Normal distribution

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)

param float Q: Q value array (A-1) param array args: [float R, float VolFrac]: interparticle distance & volume fraction returns numpy array S(Q)

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) :param float datum[]: :param float sigma[]: :param float[][] G: transformation matrix :param int IterMax: :param float Qvec: data positions for Power = 0-4 :param float approach: 0.8 default fitting parameter :param int Power: 0-4 for Q^Power weighting, -1 to use input sigma

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 param float Q: Q value array (A-1) param array args: [float R, float VolFr]: “radius” & volume fraction returns numpy array S(Q)

GSASIIsasd.LSWCume(x, pos, args=[])[source]

Lifshitz-Slyozov-Wagner Ostwald ripening cumulative distribution - numpy friendly on x axis param float x: independent axis (can be numpy array) param float pos: location of distribution param float scale: not used param float shape: not used returns float: LSW cumulative distribution

GSASIIsasd.LSWDist(x, pos, args=[])[source]

Lifshitz-Slyozov-Wagner Ostwald ripening distribution - numpy friendly on x axis ref: param float x: independent axis (can be numpy array) param float pos: location of distribution param float scale: not used param float shape: not used returns float: LSW distribution

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 param float x: independent axis (can be numpy array) param float pos: location of distribution param float scale: width of distribution (sigma) param float shape: shape parameter returns float: LogNormal cumulative distribution

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 param float x: independent axis (can be numpy array) param float pos: location of distribution param float scale: width of distribution (m) param float shape: shape - (sigma of log(LogNormal)) returns float: LogNormal distribution

exception GSASIIsasd.MaxEntException[source]

Any exception from this module

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\)

GSASIIsasd.SchulzZimmCume(x, pos, args)[source]

Schulz-Zimm cumulative distribution - numpy friendly on x axis param float x: independent axis (can be numpy array) param float pos: location of distribution param float scale: width of distribution (sigma) param float shape: not used returns float: Normal distribution

GSASIIsasd.SchulzZimmDist(x, pos, args)[source]

Schulz-Zimm macromolecule distribution - numpy friendly on x axis ref: http://goldbook.iupac.org/S05502.html param float x: independent axis (can be numpy array) param float pos: location of distribution param float scale: width of distribution (sigma) param float shape: not used returns float: Schulz-Zimm distribution

GSASIIsasd.SphereFF(Q, R, args=())[source]

Compute hard sphere form factor - can use numpy arrays :param float Q: Q value array (usually in A-1) :param float R: sphere radius (Usually in A - must match Q-1 units) :param array args: ignored :returns: form factors as array as needed (float)

GSASIIsasd.SphereVol(R, args=())[source]

Compute volume of sphere - numpy array friendly param float R: sphere radius param array args: ignored returns float: volume

GSASIIsasd.SphericalShellFF(Q, R, args=())[source]

Compute spherical shell form factor - can use numpy arrays :param float Q: Q value array (usually in A-1) :param float R: sphere radius (Usually in A - must match Q-1 units) :param array args: [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
GSASIIsasd.SphericalShellVol(R, args)[source]

Compute volume of spherical shell - numpy array friendly param float R: sphere radius param array args: [float r]: controls shell thickness, see SphericalShellFF description returns float: volume

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 param float Q : Q value array (usually in A-1) param float R: radius along 2 axes of spheroid param array args: [float AR]: aspect ratio so 3rd axis = R*AR returns float: form factors as array as needed

GSASIIsasd.SpheroidVol(R, args)[source]

Compute volume of cylindrically symmetric ellipsoid (spheroid) - numpy array friendly param float R: radius along 2 axes of spheroid param array args: [float AR]: aspect ratio so radius of 3rd axis = R*AR returns float: volume

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

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)

param float Q: Q value array (A-1) param array args: [float R, float VolFrac]: sphere radius & volume fraction returns numpy array S(Q)

GSASIIsasd.UniDiskFF(Q, R, args)[source]

Compute form factor for unified disk - can use numpy arrays param float Q: Q value array (A-1) param float R: cylinder radius (A) param array args: [float T]: disk thickness (A) returns float: form factor

GSASIIsasd.UniDiskVol(R, args)[source]

Compute disk volume for radius & thickness - numpy array friendly param float R: diameter (A) param array args: [float T]: thickness returns float:volume (A^3)

GSASIIsasd.UniRodARFF(Q, R, args)[source]

Compute form factor for unified rod of fixed aspect ratio - can use numpy arrays param float Q: Q value array (A-1) param float R: cylinder radius (A) param array args: [float AR]: cylinder aspect ratio = L/D = L/2R returns float: form factor

GSASIIsasd.UniRodARVol(R, args)[source]

Compute rod volume for radius & aspect ratio - numpy array friendly param float R: diameter (A) param array args: [float AR]: =L/D=L/2R aspect ratio returns float:volume (A^3)

GSASIIsasd.UniRodFF(Q, R, args)[source]

Compute form factor for unified rod - can use numpy arrays param float Q: Q value array (A-1) param float R: cylinder radius (A) param array args: [float R]: cylinder radius (A) returns float: form factor

GSASIIsasd.UniRodVol(R, args)[source]

Compute cylinder volume for radius & length - numpy array friendly param float R: diameter (A) param array args: [float L]: length (A) returns float:volume (A^3)

GSASIIsasd.UniSphereFF(Q, R, args=0)[source]

Compute form factor for unified sphere - can use numpy arrays param float Q: Q value array (A-1) param float R: cylinder radius (A) param array args: ignored returns float: form factor

GSASIIsasd.UniSphereVol(R, args=())[source]

Compute volume of sphere - numpy array friendly param float R: sphere radius param array args: ignored returns float: volume

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 param float Q: Q value array (A-1) param float R: cylinder radius (A) param array args: [float L,T]: tube length & wall thickness(A) returns float: form factor

GSASIIsasd.UniTubeVol(R, args)[source]

Compute tube volume for radius, length & wall thickness - numpy array friendly param float R: diameter (A) param array args: [float L,T]: tube length & wall thickness(A) returns float: volume (A^3) of tube wall

GSASIIsasd.print_arr(text, a)[source]

print the contents of an array to the console

GSASIIsasd.print_vec(text, a)[source]

print the contents of a vector to the console

14.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 10A^3 for each atom, Density is calculated from that Volume. See examples below for what is needed.