\(\renewcommand\AA{\text{Å}}\)

3. GSASIIobj: Data objects & Docs

3.1. Summary/Contents

This module defines and/or documents the data structures used in GSAS-II, as well as provides misc. support routines.

3.2. Variable names in GSAS-II

Parameter are named using the following pattern, p:h:<var>:n, where <var> is a variable name, as shown in the following table. Also, p is the phase number, h is the histogram number, and n is the atom parameter number If a parameter does not depend on a histogram, phase or atom, h, p and/or n will be omitted, so p::<var>:n, :h:<var> and p:h:<var> are all valid names.

Naming for GSAS-II parameter names, p:h:<var>:n

<var>

usage

\(\scriptstyle K\) (example: a)

Lattice parameter, \(\scriptstyle K\), from Ai and Djk; where \(\scriptstyle K\) is one of the characters a, b or c.

α

Lattice parameter, α, computed from both Ai and Djk.

β

Lattice parameter, β, computed from both Ai and Djk.

γ

Lattice parameter, γ, computed from both Ai and Djk.

Scale

Phase fraction (as p:h:Scale) or Histogram scale factor (as :h:Scale).

A\(\scriptstyle I\) (example: A0)

Reciprocal metric tensor component \(\scriptstyle I\); where \(\scriptstyle I\) is a digit between 0 and 5.

\(\scriptstyle L\)ol (example: vol)

Unit cell volume; where \(\scriptstyle L\) is one of the characters v or V.

dA\(\scriptstyle M\) (example: dAx)

Refined change to atomic coordinate, \(\scriptstyle M\); where \(\scriptstyle M\) is one of the characters x, y or z.

A\(\scriptstyle M\) (example: Ax)

Fractional atomic coordinate, \(\scriptstyle M\); where \(\scriptstyle M\) is one of the characters x, y or z.

AUiso

Atomic isotropic displacement parameter.

AU\(\scriptstyle N_0\)\(\scriptstyle N_1\) (example: AU11)

Atomic anisotropic displacement parameter U\(\scriptstyle N_0\)\(\scriptstyle N_1\); where \(\scriptstyle N_0\) is one of the characters 1, 2 or 3 and \(\scriptstyle N_1\) is one of the characters 1, 2 or 3.

Afrac

Atomic site fraction parameter.

Amul

Atomic site multiplicity value.

AM\(\scriptstyle M\) (example: AMx)

Atomic magnetic moment parameter, \(\scriptstyle M\); where \(\scriptstyle M\) is one of the characters x, y or z.

Akappa\(\scriptstyle O\) (example: Akappa0)

Atomic orbital softness for orbital, \(\scriptstyle O\); where \(\scriptstyle O\) is one of the characters 0, - or 6.

ANe\(\scriptstyle P\) (example: ANe0)

Atomic <j0> orbital population for orbital, \(\scriptstyle P\); where \(\scriptstyle P\) is one of the characters 0 or 1.

AD\(\scriptstyle O_0\),\(\scriptstyle O_1\)\(\scriptstyle O_0\) (example: AD0,00)

Atomic sp. harm. coeff for orbital, 1; where \(\scriptstyle O_0\) is one of the characters 0, - or 6 and \(\scriptstyle O_1\) is one of the characters 0, - or 6 and \(\scriptstyle O_0\) is one of the characters 0, - or 6.

AD\(\scriptstyle O_0\),-\(\scriptstyle O_1\)\(\scriptstyle O_0\) (example: AD0,-00)

Atomic sp. harm. coeff for orbital, 1; where \(\scriptstyle O_0\) is one of the characters 0, - or 6 and \(\scriptstyle O_1\) is one of the characters 0, - or 6 and \(\scriptstyle O_0\) is one of the characters 0, - or 6.

Back\(\scriptstyle J\) (example: Back11)

Background term #\(\scriptstyle J\); where \(\scriptstyle J\) is the background term number.

BkPkint;\(\scriptstyle J\) (example: BkPkint;11)

Background peak #\(\scriptstyle J\) intensity; where \(\scriptstyle J\) is the background peak number.

BkPkpos;\(\scriptstyle J\) (example: BkPkpos;11)

Background peak #\(\scriptstyle J\) position; where \(\scriptstyle J\) is the background peak number.

BkPksig;\(\scriptstyle J\) (example: BkPksig;11)

Background peak #\(\scriptstyle J\) Gaussian width; where \(\scriptstyle J\) is the background peak number.

BkPkgam;\(\scriptstyle J\) (example: BkPkgam;11)

Background peak #\(\scriptstyle J\) Cauchy width; where \(\scriptstyle J\) is the background peak number.

BF mult

Background file multiplier.

Bab\(\scriptstyle Q\) (example: BabA)

Babinet solvent scattering coef. \(\scriptstyle Q\); where \(\scriptstyle Q\) is one of the characters A or U.

D\(\scriptstyle N_0\)\(\scriptstyle N_1\) (example: D11)

Anisotropic strain coef. \(\scriptstyle N_0\)\(\scriptstyle N_1\); where \(\scriptstyle N_0\) is one of the characters 1, 2 or 3 and \(\scriptstyle N_1\) is one of the characters 1, 2 or 3.

Extinction

Extinction coef.

MD

March-Dollase coef.

Mustrain;\(\scriptstyle J\) (example: Mustrain;11)

Microstrain coefficient (delta Q/Q x 10**6); where \(\scriptstyle J\) can be i for isotropic or equatorial and a is axial (uniaxial broadening), a number for generalized (Stephens) broadening or mx for the Gaussian/Lorentzian mixing term (LGmix).

Size;\(\scriptstyle J\) (example: Size;11)

Crystallite size value (in microns); where \(\scriptstyle J\) can be i for isotropic or equatorial, and a is axial (uniaxial broadening), a number between 0 and 5 for ellipsoidal broadening or mx for the Gaussian/Lorentzian mixing term (LGmix).

eA

Cubic mustrain value.

Ep

Primary extinction.

Es

Secondary type II extinction.

Eg

Secondary type I extinction.

Flack

Flack parameter.

TwinFr

Twin fraction.

Layer Disp

Layer displacement along beam.

Absorption

Absorption coef.

LayerDisp

Bragg-Brentano Layer displacement.

Displace\(\scriptstyle R\) (example: DisplaceX)

Debye-Scherrer sample displacement \(\scriptstyle R\); where \(\scriptstyle R\) is one of the characters X or Y.

Lam

Wavelength.

I(L2)\/I(L1)

Ka2/Ka1 intensity ratio.

Polariz.

Polarization correction.

SH/L

FCJ peak asymmetry correction.

\(\scriptstyle S\) (example: U)

Gaussian instrument broadening \(\scriptstyle S\); where \(\scriptstyle S\) is one of the characters U, V or W.

\(\scriptstyle T\) (example: X)

Cauchy instrument broadening \(\scriptstyle T\); where \(\scriptstyle T\) is one of the characters X, Y or Z.

Zero

Debye-Scherrer zero correction.

Shift

Bragg-Brentano sample displ.

SurfRoughA

Bragg-Brenano surface roughness A.

SurfRoughB

Bragg-Brenano surface roughness B.

Transparency

Bragg-Brentano sample tranparency.

DebyeA

Debye model amplitude.

DebyeR

Debye model radius.

DebyeU

Debye model Uiso.

RBV\(\scriptstyle J\) (example: RBV11)

Vector rigid body parameter.

RBVO\(\scriptstyle U\) (example: RBVOa)

Vector rigid body orientation parameter \(\scriptstyle U\); where \(\scriptstyle U\) is one of the characters a, i, j or k.

RBVP\(\scriptstyle M\) (example: RBVPx)

Vector rigid body \(\scriptstyle M\) position parameter; where \(\scriptstyle M\) is one of the characters x, y or z.

RBVf

Vector rigid body site fraction.

RBV\(\scriptstyle V_0\)\(\scriptstyle W_0\)\(\scriptstyle W_1\) (example: RBVT11)

Residue rigid body group disp. param.; where \(\scriptstyle V_0\) is one of the characters T, L or S and \(\scriptstyle W_0\) is one of the characters 1, 2, 3, A or B and \(\scriptstyle W_1\) is one of the characters 1, 2, 3, A or B.

RBVU

Residue rigid body group Uiso param.

RBRO\(\scriptstyle U\) (example: RBROa)

Residue rigid body orientation parameter \(\scriptstyle U\); where \(\scriptstyle U\) is one of the characters a, i, j or k.

RBRP\(\scriptstyle M\) (example: RBRPx)

Residue rigid body \(\scriptstyle M\) position parameter; where \(\scriptstyle M\) is one of the characters x, y or z.

RBRTr;\(\scriptstyle J\) (example: RBRTr;11)

Residue rigid body torsion parameter.

RBRf

Residue rigid body site fraction.

RBR\(\scriptstyle V_0\)\(\scriptstyle W_0\)\(\scriptstyle W_1\) (example: RBRT11)

Residue rigid body group disp. param.; where \(\scriptstyle V_0\) is one of the characters T, L or S and \(\scriptstyle W_0\) is one of the characters 1, 2, 3, A or B and \(\scriptstyle W_1\) is one of the characters 1, 2, 3, A or B.

RBRU

Residue rigid body group Uiso param.

RBSAtNo

Atom number for spinning rigid body.

RBSO\(\scriptstyle U\) (example: RBSOa)

Spinning rigid body orientation parameter \(\scriptstyle U\); where \(\scriptstyle U\) is one of the characters a, i, j or k.

RBSP\(\scriptstyle M\) (example: RBSPx)

Spinning rigid body \(\scriptstyle M\) position parameter; where \(\scriptstyle M\) is one of the characters x, y or z.

RBSShRadius

Spinning rigid body shell radius.

RBSShC\(\scriptstyle X\) (example: RBSShC1)

Spinning rigid body sph. harmonics term; where \(\scriptstyle X\) is one of the characters 1, -, 2 or 0 ,, 1, -, 2 or 0.

constr\(\scriptstyle G\) (example: constr10)

Generated degree of freedom from constraint; where \(\scriptstyle G\) is one or more digits (0, 1,… 9).

nv-(.+)

New variable assignment with name 1.

mV\(\scriptstyle H\) (example: mV0)

Modulation vector component \(\scriptstyle H\); where \(\scriptstyle H\) is the digits 0, 1, or 2.

Fsin

Sin site fraction modulation.

Fcos

Cos site fraction modulation.

Fzero

Crenel function offset.

Fwid

Crenel function width.

Tmin

ZigZag/Block min location.

Tmax

ZigZag/Block max location.

\(\scriptstyle T\)max (example: Xmax)

ZigZag/Block max value for \(\scriptstyle T\); where \(\scriptstyle T\) is one of the characters X, Y or Z.

\(\scriptstyle T\)sin (example: Xsin)

Sin position wave for \(\scriptstyle T\); where \(\scriptstyle T\) is one of the characters X, Y or Z.

\(\scriptstyle T\)cos (example: Xcos)

Cos position wave for \(\scriptstyle T\); where \(\scriptstyle T\) is one of the characters X, Y or Z.

U\(\scriptstyle N_0\)\(\scriptstyle N_1\)sin (example: U11sin)

Sin thermal wave for U\(\scriptstyle N_0\)\(\scriptstyle N_1\); where \(\scriptstyle N_0\) is one of the characters 1, 2 or 3 and \(\scriptstyle N_1\) is one of the characters 1, 2 or 3.

U\(\scriptstyle N_0\)\(\scriptstyle N_1\)cos (example: U11cos)

Cos thermal wave for U\(\scriptstyle N_0\)\(\scriptstyle N_1\); where \(\scriptstyle N_0\) is one of the characters 1, 2 or 3 and \(\scriptstyle N_1\) is one of the characters 1, 2 or 3.

M\(\scriptstyle T\)sin (example: MXsin)

Sin mag. moment wave for \(\scriptstyle T\); where \(\scriptstyle T\) is one of the characters X, Y or Z.

M\(\scriptstyle T\)cos (example: MXcos)

Cos mag. moment wave for \(\scriptstyle T\); where \(\scriptstyle T\) is one of the characters X, Y or Z.

PDFpos

PDF peak position.

PDFmag

PDF peak magnitude.

PDFsig

PDF peak std. dev.

Aspect ratio

Particle aspect ratio.

Length

Cylinder length.

Diameter

Cylinder/disk diameter.

Thickness

Disk thickness.

Shell thickness

Multiplier to get inner(<1) or outer(>1) sphere radius.

Dist

Interparticle distance.

VolFr

Dense scatterer volume fraction.

epis

Sticky sphere epsilon.

Sticky

Stickyness.

Depth

Well depth.

Width

Well width.

Volume

Particle volume.

Radius

Sphere/cylinder/disk radius.

Mean

Particle mean radius.

StdDev

Standard deviation in Mean.

G

Guinier prefactor.

Rg

Guinier radius of gyration.

B

Porod prefactor.

P

Porod power.

Cutoff

Porod cutoff.

PkInt

Bragg peak intensity.

PkPos

Bragg peak position.

PkSig

Bragg peak sigma.

PkGam

Bragg peak gamma.

e\(\scriptstyle Y_0\)\(\scriptstyle Y_1\) (example: e11)

strain tensor e\(\scriptstyle Y_0\)\(\scriptstyle Y_1\); where \(\scriptstyle Y_0\) is one of the characters 1 or 2 and \(\scriptstyle Y_1\) is one of the characters 1 or 2.

Dcalc

Calc. d-spacing.

Back

background parameter.

pos

peak position.

int

peak intensity.

WgtFrac

phase weight fraction.

alpha

TOF profile term.

alpha-\(\scriptstyle P\) (example: alpha-0)

Pink profile term; where \(\scriptstyle P\) is one of the characters 0 or 1.

beta-\(\scriptstyle Z\) (example: beta-0)

TOF/Pink profile term; where \(\scriptstyle Z\) is one of the characters 0, 1 or q.

sig-\(\scriptstyle a\) (example: sig-0)

TOF profile term; where \(\scriptstyle a\) is one of the characters 0, 1, 2 or q.

dif\(\scriptstyle b\) (example: difA)

TOF to d-space calibration; where \(\scriptstyle b\) is one of the characters A, B or C.

C\(\scriptstyle G_0\),\(\scriptstyle G_1\) (example: C10,10)

spherical harmonics preferred orientation coef.; where \(\scriptstyle G_0\) is one or more digits (0, 1,… 9) and \(\scriptstyle G_1\) is one or more digits (0, 1,… 9).

Pressure

Pressure level for measurement in MPa.

Temperature

T value for measurement, K.

FreePrm\(\scriptstyle N\) (example: FreePrm1)

User defined measurement parameter \(\scriptstyle N\); where \(\scriptstyle N\) is one of the characters 1, 2 or 3.

Gonio. radius

Distance from sample to detector, mm.

3.3. Constraints Tree Item

Constraints are stored in a dict, separated into groups. Note that parameter are named in the following pattern, p:h:<var>:n, where p is the phase number, h is the histogram number <var> is a variable name and n is the parameter number. If a parameter does not depend on a histogram or phase or is unnumbered, that number is omitted. Note that the contents of each dict item is a List where each element in the list is a constraint definition objects. The constraints in this form are converted in GSASIImapvars.ProcessConstraints() to the form used in GSASIImapvars

The keys in the Constraints dict are:

key

explanation

Hist

This specifies a list of constraints on histogram-related parameters, which will be of form :h:<var>:n.

HAP

This specifies a list of constraints on parameters that are defined for every histogram in each phase and are of form p:h:<var>:n.

Phase

This specifies a list of constraints on phase parameters, which will be of form p::<var>:n.

Global

This specifies a list of constraints on parameters that are not tied to a histogram or phase and are of form ::<var>:n

Each constraint is defined as an item in a list. Each constraint is of form:

[[<mult1>, <var1>], [<mult2>, <var2>],..., <fixedval>, <varyflag>, <constype>]

Where the variable pair list item containing two values [<mult>, <var>], where:

  • <mult> is a multiplier for the constraint (float)

  • <var> a G2VarObj object. (Note that in very old .gpx files this might be a str with a variable name of form ‘p:h:name[:at]’)

Note that the last three items in the list play a special role:

  • <fixedval> is the fixed value for a constant equation (constype=c) constraint or is None. For a New variable (constype=f) constraint, a variable name can be specified as a str (used for externally generated constraints)

  • <varyflag> is True or False for New variable (constype=f) constraints or is None. This indicates if this variable should be refined.

  • <constype> is one of four letters, ‘e’, ‘c’, ‘h’, ‘f’ that determines the type of constraint:

    • ‘e’ defines a set of equivalent variables. Only the first variable is refined (if the appropriate refine flag is set) and and all other equivalent variables in the list are generated from that variable, using the appropriate multipliers.

    • ‘c’ defines a constraint equation of form, \(m_1 \times var_1 + m_2 \times var_2 + ... = c\)

    • ‘h’ defines a variable to hold (not vary). Any variable on this list is not varied, even if its refinement flag is set. Only one [mult,var] pair is allowed in a hold constraint and the mult value is ignored. This is of particular value when needing to hold one or more variables where a single flag controls a set of variables such as, coordinates, the reciprocal metric tensor or anisotropic displacement parameter.

    • ‘f’ defines a new variable (function) according to relationship \(newvar = m_1 \times var_1 + m_2 \times var_2 + ...\)

3.4. Covariance Tree Item

The Covariance tree item has results from the last least-squares run. They are stored in a dict with these keys:

key

sub-key

explanation

newCellDict

(dict) ith lattice parameters computed by GSASIIstrMath.GetNewCellParms()

title

(str) Name of gpx file(?)

variables

(list) Values for all N refined variables (list of float values, length N, ordered to match varyList)

sig

(list) Uncertainty values for all N refined variables (list of float values, length N, ordered to match varyList)

varyList

(list of str values, length N) List of directly refined variables

newAtomDict

(dict) atom position values computed in GSASIIstrMath.ApplyXYZshifts()

Rvals

(dict) R-factors, GOF, Marquardt value for last refinement cycle

Nobs

(int) Number of observed data points

Rwp

(float) overall weighted profile R-factor (%)

chisq

(float) \(\sum w*(I_{obs}-I_{calc})^2\) for all data. Note: this is not the reduced \(\chi^2\).

lamMax

(float) Marquardt value applied to Hessian diagonal

GOF

(float) The goodness-of-fit, aka square root of the reduced chi squared.

covMatrix

(np.array) The (NxN) covVariance matrix

3.5. Phase Tree Items

Phase information is stored in the GSAS-II data tree as children of the Phases item in a dict with keys:

key

sub-key

explanation

General

(dict) Overall information for the phase

3Dproj

(list of str) projections for 3D pole distribution plots

AngleRadii

(list of floats) Default radius for each atom used to compute interatomic angles

AtomMass

(list of floats) Masses for atoms

AtomPtrs

(list of int) four locations (cx,ct,cs & cu) to use to pull info from the atom records

AtomTypes

(llist of str) Atom types

BondRadii

(list of floats) Default radius for each atom used to compute interatomic distances

Cell

Unit cell parameters & ref. flag (list with 8 items. All but first item are float.)

0: cell refinement flag (True/False),

1-3: a, b, c, (\(\AA\))

4-6: alpha, beta & gamma, (degrees)

7: volume (\(\AA^3\))

Color

(list of (r,b,g) triplets) Colors for atoms

Compare

(dict) Polygon comparison parameters

Data plot type

(str) data plot type (‘Mustrain’, ‘Size’ or ‘Preferred orientation’) for powder data

DisAglCtls

(dDict) with distance/angle search controls, which has keys ‘Name’, ‘AtomTypes’, ‘BondRadii’, ‘AngleRadii’ which are as above except are possibly edited. Also contains ‘Factors’, which is a 2 element list with a multiplier for bond and angle search range [typically (0.85,0.85)].

F000X

(float) x-ray F(000) intensity

F000N

(float) neutron F(000) intensity

Flip

(dict) Charge flip controls

HydIds

(dict) geometrically generated hydrogen atoms

Isotope

(dict) Isotopes for each atom type

Isotopes

(dict) Scattering lengths for each isotope combination for each element in phase

MCSA controls

(dict) Monte Carlo-Simulated Annealing controls

Map

(dict) Map parameters

Mass

(float) Mass of unit cell contents in g/mol

Modulated

(bool) True if phase modulated

Mydir

(str) Directory of current .gpx file

Name

(str) Phase name

NoAtoms

(dict) Number of atoms per unit cell of each type

POhkl

(list) March-Dollase preferred orientation direction

Pawley dmin

(float) maximum Q (as d-space) to use for Pawley extraction

Pawley dmax

(float) minimum Q (as d-space) to use for Pawley extraction

Pawley neg wt

(float) Restraint value for negative Pawley intensities

SGData

(object) Space group details as a space group (SGData) object, as defined in GSASIIspc.SpcGroup().

SH Texture

(dict) Spherical harmonic preferred orientation parameters

Super

(int) dimension of super group (0,1 only)

Type

(str) phase type (e.g. ‘nuclear’)

Z

(dict) Atomic numbers for each atom type

doDysnomia

(bool) flag for max ent map modification via Dysnomia

doPawley

(bool) Flag for Pawley intensity extraction

vdWRadii

(dict) Van der Waals radii for each atom type

ranId

(int) unique random number Id for phase

pId

(int) Phase Id number for current project.

Atoms

(list of lists) Atoms in phase as a list of lists. The outer list is for each atom, the inner list contains varying items depending on the type of phase, see the Atom Records description.

Drawing

(dict) Display parameters

Atoms

(list of lists) with an entry for each atom that is drawn

Plane

(list) Controls for contour density plane display

Quaternion

(4 element np.array) Viewing quaternion

Zclip

(float) clipping distance in \(\AA\)

Zstep

(float) Step to de/increase Z-clip

atomPtrs

(list) positions of x, type, site sym, ADP flag in Draw Atoms

backColor

(list) background for plot as and R,G,B triplet (default = [0, 0, 0], black).

ballScale

(float) Radius of spheres in ball-and-stick display

bondList

(dict) Bonds

bondRadius

(float) Radius of binds in \(\AA\)

cameraPos

(float) Viewing position in \(\AA\) for plot

contourLevel

(float) map contour level in \(e/\AA^3\)

contourMax

(float) map contour maximum

depthFog

(bool) True if use depthFog on plot - set currently as False

ellipseProb

(float) Probability limit for display of thermal ellipsoids in % .

magMult

(float) multiplier for magnetic moment arrows

mapSize

(float) x & y dimensions of contourmap (fixed internally)

modelView

(4,4 array) from openGL drawing transofmation matrix

oldxy

(list with two floats) previous view point

radiusFactor

(float) Distance ratio for searching for bonds. Bonds are located that are within r(Ra+Rb) and (Ra+Rb)/r where Ra and Rb are the atomic radii.

selectedAtoms

(list of int values) List of selected atoms

showABC

(bool) Flag to show view point triplet. True=show.

showHydrogen

(bool) Flag to control plotting of H atoms.

showRigidBodies

(bool) Flag to highlight rigid body placement

showSlice

(bool) flag to show contour map

sizeH

(float) Size ratio for H atoms

unitCellBox

(bool) Flag to control display of the unit cell.

vdwScale

(float) Multiplier of van der Waals radius for display of vdW spheres.

viewDir

(np.array with three floats) cartesian viewing direction

viewPoint

(list of lists) First item in list is [x,y,z] in fractional coordinates for the center of the plot. Second item list of previous & current atom number viewed (may be [0,0])

ISODISTORT

(dict) contains controls for running ISODISTORT and results from it

ISOmethod

(int) ISODISTORT method (currently 1 or 4; 2 & 3 not implemented in GSAS-II)

ParentCIF

(str) parent cif file name for ISODISTORT method 4

ChildCIF

(str) child cif file name for ISODISTORT method 4

SGselect

(dict) selection list for lattice types in radio result from ISODISTORT method 1

selection

(int) chosen selection from radio

radio

(list) results from ISODISTORT method 1

ChildMatrix

(3x3 array) transformation matrix for method 3 (not currently used)

ChildSprGp

(str) child space group for method 3 (not currently used)

ChildCell

(str) cell ordering for nonstandard orthorhombic ChildSprGrp in method 3 (not currently used)

G2ModeList

(list) ISODISTORT mode names

modeDispl

(list) distortion mode values; refinable parameters

ISOmodeDispl

(list) distortion mode values as determined in method 4 by ISODISTORT

NormList

(list) ISODISTORT normalization values; to convert mode value to fractional coordinate dsplacement

G2parentCoords

(list) full set of parent structure coordinates transformed to child structure; starting basis for mode displacements

G2VarList

(list)

IsoVarList

(list)

G2coordOffset

(list) only adjustible set of parent structure coordinates

G2OccVarList

(list)

Var2ModeMatrix

(array) atom variable to distortion mode transformation

Mode2VarMatrix

(array) distortion mode to atom variable transformation

rundata

(dict) saved input information for use by ISODISTORT method 1

RBModels

Rigid body assignments (note Rigid body definitions are stored in their own main top-level tree entry.)

RMC

(dict) RMCProfile, PDFfit & fullrmc controls

Pawley ref

(list) Pawley reflections

Histograms

(dict of dicts) The key for the outer dict is the histograms tied to this phase. The inner dict contains the combined phase/histogram parameters for items such as scale factors, size and strain parameters. The following are the keys to the inner dict. (dict)

Babinet

(dict) For protein crystallography. Dictionary with two entries, ‘BabA’, ‘BabU’

Extinction

(list of float, bool) Extinction parameter

Flack

(list of [float, bool]) Flack parameter & refine flag

HStrain

(list of two lists) Hydrostatic strain. The first is a list of the HStrain parameters (1, 2, 3, 4, or 6 depending on unit cell), the second is a list of boolean refinement parameters (same length)

Histogram

(str) The name of the associated histogram

Layer Disp

(list of [float, bool]) Layer displacement in beam direction & refine flag

LeBail

(bool) Flag for LeBail extraction

Mustrain

(list) Microstrain parameters, in order:

  1. Type, one of u’isotropic’, u’uniaxial’, u’generalized’

  2. Isotropic/uniaxial parameters - list of 3 floats

  3. Refinement flags - list of 3 bools

  4. Microstrain axis - list of 3 ints, [h, k, l]

  5. Generalized mustrain parameters - list of 2-6 floats, depending on space group

  6. Generalized refinement flags - list of bools, corresponding to the parameters of (4)

Pref.Ori.

(list) Preferred Orientation. List of eight parameters. Items marked SH are only used for Spherical Harmonics.

  1. (str) Type, ‘MD’ for March-Dollase or ‘SH’ for Spherical Harmonics

  2. (float) Value

  3. (bool) Refinement flag

  4. (list) Preferred direction, list of ints, [h, k, l]

  5. (int) SH - number of terms

  6. (dict) SH -

  7. (list) SH

  8. (float) SH

Scale

(list of [float, bool]) Phase fraction & refine flag

Size

List of crystallite size parameters, in order:

  1. (str) Type, one of u’isotropic’, u’uniaxial’, u’ellipsoidal’

  2. (list) Isotropic/uniaxial parameters - list of 3 floats

  3. (list) Refinement flags - list of 3 bools

  4. (list) Size axis - list of 3 ints, [h, k, l]

  5. (list) Ellipsoidal size parameters - list of 6 floats

  6. (list) Ellipsoidal refinement flags - list of bools, corresponding to the parameters of (4)

Use

(bool) True if this histogram is to be used in refinement

MCSA

(dict) Monte-Carlo simulated annealing parameters

3.6. Rigid Body Objects

Rigid body descriptions are available for two types of rigid bodies: ‘Vector’ and ‘Residue’. Vector rigid bodies are developed by a sequence of translations each with a refinable magnitude and Residue rigid bodies are described as Cartesian coordinates with defined refinable torsion angles.

key

sub-key

explanation

Vector

RBId

(dict of dict) vector rigid bodies

AtInfo

(dict) Drad, Color: atom drawing radius & color for each atom type

RBname

(str) Name assigned by user to rigid body

VectMag

(list) vector magnitudes in \(\AA\)

rbXYZ

(list of 3 float Cartesian coordinates for Vector rigid body )

rbRef

(list of 3 int & 1 bool) 3 assigned reference atom nos. in rigid body for origin definition, use center of atoms flag

VectRef

(list of bool refinement flags for VectMag values )

rbTypes

(list of str) Atom types for each atom in rigid body

rbVect

(list of lists) Cartesian vectors for each translation used to build rigid body

useCount

(int) Number of times rigid body is used in any structure

Residue

RBId

(dict of dict) residue rigid bodies

AtInfo

(dict) Drad, Color: atom drawing radius & color for each atom type

RBname

(str) Name assigned by user to rigid body

rbXYZ

(list of 3 float) Cartesian coordinates for Residue rigid body

rbTypes

(list of str) Atom types for each atom in rigid body

atNames

(list of str) Names of each atom in rigid body (e.g. C1,N2…)

rbRef

(list of 3 int & 1 bool) 3 assigned reference atom nos. in rigid body for origin definition, use center of atoms flag

rbSeq

(list) Orig,Piv,angle,Riding : definition of internal rigid body torsion; origin atom (int), pivot atom (int), torsion angle (float), riding atoms (list of int)

SelSeq

(int,int) used by SeqSizer to identify objects

useCount

(int)Number of times rigid body is used in any structure

RBIds

(dict) unique Ids generated upon creation of each rigid body

Vector

(list) Ids for each Vector rigid body

Residue

(list) Ids for each Residue rigid body

3.7. Space Group Objects

Space groups are interpreted by GSASIIspc.SpcGroup() and the information is placed in a SGdata object which is a dict with these keys. Magnetic ones are marked “mag”

key

explanation

BNSlattsym

mag - (str) BNS magnetic space group symbol and centering vector

GenFlg

mag - (list) symmetry generators indices

GenSym

mag - (list) names for each generator

MagMom

mag - (list) “time reversals” for each magnetic operator

MagPtGp

mag - (str) Magnetic point group symbol

MagSpGrp

mag - (str) Magnetic space group symbol

OprNames

mag - (list) names for each space group operation

SGCen

(np.array) Symmetry cell centering vectors. A (n,3) np.array of centers. Will always have at least one row: np.array([[0, 0, 0]])

SGFixed

(bool) Only True if phase mported from a magnetic cif file then the space group can not be changed by the user because operator set from cif may be nonstandard

SGGen

(list) generators

SGGray

(bool) True if space group is a gray group (incommensurate magnetic structures)

SGInv

(bool) True if centrosymmetric, False if not

SGLatt

(str)Lattice centering type. Will be one of P, A, B, C, I, F, R

SGLaue

(str) one of the following 14 Laue classes: -1, 2/m, mmm, 4/m, 4/mmm, 3R, 3mR, 3, 3m1, 31m, 6/m, 6/mmm, m3, m3m

SGOps

(list) symmetry operations as a list of form [[M1,T1], [M2,T2],...] where \(M_n\) is a 3x3 np.array and \(T_n\) is a length 3 np.array. Atom coordinates are transformed where the Asymmetric unit coordinates [X is (x,y,z)] are transformed using \(X^\prime = M_n*X+T_n\)

SGPolax

(str) Axes for space group polarity. Will be one of ‘’, ‘x’, ‘y’, ‘x y’, ‘z’, ‘x z’, ‘y z’, ‘xyz’. In the case where axes are arbitrary ‘111’ is used (P 1, and ?).

SGPtGrp

(str) Point group of the space group

SGUniq

unique axis if monoclinic. Will be a, b, or c for monoclinic space groups. Will be blank for non-monoclinic.

SGSpin

mag - (list) of spin flip operatiors (+1 or -1) for the space group operations

SGSys

(str) symmetry unit cell: type one of ‘triclinic’, ‘monoclinic’, ‘orthorhombic’, ‘tetragonal’, ‘rhombohedral’, ‘trigonal’, ‘hexagonal’, ‘cubic’

SSGK1

(list) Superspace multipliers

SpGrp

(str) space group symbol

SpnFlp

mag - (list) Magnetic spin flips for every magnetic space group operator

Superspace groups [3+1] are interpreted by GSASIIspc.SSpcGroup() and the information is placed in a SSGdata object which is a dict with these keys:

key

explanation

SSGCen

(list) 4D cell centering vectors [0,0,0,0] at least

SSGK1

(list) Superspace multipliers

SSGOps

(list) 4D symmetry operations as [M,T] so that M*x+T = x’

SSpGrp

(str) superspace group symbol extension to space group symbol, accidental spaces removed

modQ

(list) modulation/propagation vector

modSymb

(list of str) Modulation symbols

3.8. Phase Information

Phase information is placed in one of the following keys:

key

explanation

General

Overall information about a phase

Histograms

Information about each histogram linked to the current phase as well as parameters that are defined for each histogram and phase (such as sample peak widths and preferred orientation parameters.

Atoms

Contains a list of atoms, as described in the Atom Records description.

Drawing

Parameters that determine how the phase is displayed, including a list of atoms to be included, as described in the Drawing Atom Records description

MCSA

Monte-Carlo simulated annealing parameters

pId

The index of each phase in the project, numbered starting at 0

ranId

An int value with a unique value for each phase

RBModels

A list of dicts with parameters for each rigid body inserted into the current phase, as defined in the Rigid Body Insertions. Note that the rigid bodies are defined as Rigid Body Objects

RMC

PDF modeling parameters

Pawley ref

Pawley refinement parameters

3.8.1. Atom Records

If phasedict points to the phase information in the data tree, then atoms are contained in a list of atom records (list) in phasedict['Atoms']. Also needed to read atom information are four pointers, cx,ct,cs,cia = phasedict['General']['AtomPtrs'], which define locations in the atom record, as shown below. Items shown are always present; additional ones for macromolecular phases are marked ‘mm’, and those for magnetic structures are marked ‘mg’

location

explanation

ct-4

mm - (str) residue number

ct-3

mm - (str) residue name (e.g. ALA)

ct-2

mm - (str) chain label

ct-1

(str) atom label

ct

(str) atom type

ct+1

(str) refinement flags; combination of ‘F’, ‘X’, ‘U’, ‘M’

cx,cx+1,cx+2

(3 floats) the x,y and z coordinates

cx+3

(float) site occupancy

cx+4,cx+5,cx+6

mg - (list) atom magnetic moment along a,b,c in Bohr magnetons

cs

(str) site symmetry

cs+1

(int) site multiplicity

cia

(str) ADP flag: Isotropic (‘I’) or Anisotropic (‘A’)

cia+1

(float) Uiso

cia+2…cia+7

(6 floats) U11, U22, U33, U12, U13, U23

atom[cia+8]

(int) unique atom identifier

3.8.2. Drawing Atom Records

If phasedict points to the phase information in the data tree, then drawing atoms are contained in a list of drawing atom records (list) in phasedict['Drawing']['Atoms']. Also needed to read atom information are four pointers, cx,ct,cs,ci = phasedict['Drawing']['AtomPtrs'], which define locations in the atom record, as shown below. Items shown are always present; additional ones for macromolecular phases are marked ‘mm’, and those for magnetic structures are marked ‘mg’

location

explanation

ct-4

mm - (str) residue number

ct-3

mm - (str) residue name (e.g. ALA)

ct-2

mm - (str) chain label

ct-1

(str) atom label

ct

(str) atom type

cx,cx+1,cx+2

(3 floats) the x,y and z coordinates

cx+3,cx+4,cx+5

mg - (3 floats) atom magnetic moment along a,b,c in Bohr magnetons

cs-1

(str) Sym Op symbol; sym. op number + unit cell id (e.g. ‘1,0,-1’)

cs

(str) atom drawing style; e.g. ‘balls & sticks’

cs+1

(str) atom label style (e.g. ‘name’)

cs+2

(int) atom color (RBG triplet)

cs+3

(str) ADP flag: Isotropic (‘I’) or Anisotropic (‘A’)

cs+4

(float) Uiso

cs+5…cs+11

(6 floats) U11, U22, U33, U12, U13, U23

ci

(int) unique atom identifier; matches source atom Id in Atom Records

3.8.3. Rigid Body Insertions

If phasedict points to the phase information in the data tree, then rigid body information is contained in list(s) in phasedict['RBModels']['Residue'] and/or phasedict['RBModels']['Vector'] for each rigid body inserted into the current phase.

key

explanation

fixOrig

Should the origin be fixed (when editing, not the refinement flag)

Ids

Ids for assignment of atoms in the rigid body

numChain

Chain number for macromolecular fits

Orient

Orientation of the RB as a quaternion and a refinement flag (’ ‘, ‘A’ or ‘AV’)

OrientVec

Orientation of the RB expressed as a vector and azimuthal rotation angle

Orig

Origin of the RB in fractional coordinates and refinement flag (bool)

RBId

References the unique ID of a rigid body in the Rigid Body Objects

RBname

The name for the rigid body (str)

AtomFrac

The atom fractions for the rigid body

ThermalMotion

The thermal motion description for the rigid body, which includes a choice for the model and can include TLS parameters or an overall Uiso value.

Torsions

Defines the torsion angle and refinement flag for each torsion defined in the Rigid Body Object

3.9. Powder Diffraction Tree Items

Every powder diffraction histogram is stored in the GSAS-II data tree with a top-level entry named beginning with the string “PWDR “. The diffraction data for that information are directly associated with that tree item and there are a series of children to that item. The routines GSASIIdataGUI.GSASII.GetUsedHistogramsAndPhasesfromTree() and GSASIIstrIO.GetUsedHistogramsAndPhases() will load this information into a dictionary where the child tree name is used as a key, and the information in the main entry is assigned a key of Data, as outlined below.

key

sub-key

explanation

Comments

(list of str) Text strings extracted from the original powder data header. These cannot be changed by the user; it may be empty.

Limits

(list) two two element lists, as [[Ld,Hd],[L,H]] where L and Ld are the current and default lowest two-theta value to be used and where H and Hd are the current and default highest two-theta value to be used.

Reflection Lists

(dict of dicts) with an entry for each phase in the histogram. The contents of each dict item is a dict containing reflections, as described in the Powder Reflections description.

Instrument Parameters

(dict) The instrument parameters uses different dicts for the constant wavelength (CW) and time-of-flight (TOF) cases. See below for the descriptions of each.

wtFactor

(float) A weighting factor to increase or decrease the leverage of data in the histogram . A value of 1.0 weights the data with their standard uncertainties and a larger value increases the weighting of the data (equivalent to decreasing the uncertainties).

Sample Parameters

(dict) Parameters that describe how the data were collected, as listed below. Refinable parameters are a list containing a float and a bool, where the second value specifies if the value is refined, otherwise the value is a float unless otherwise noted.

Scale

The histogram scale factor (refinable)

Absorption

The sample absorption coefficient as \(\mu r\) where r is the radius (refinable). Only valid for Debye-Scherrer geometry.

SurfaceRoughA

Surface roughness parameter A as defined by Surotti, J. Appl. Cryst, 5, 325-331, 1972. (refinable - only valid for Bragg-Brentano geometry)

SurfaceRoughB

Surface roughness parameter B (refinable - only valid for Bragg-Brentano geometry)

DisplaceX, DisplaceY

Sample displacement from goniometer center where Y is along the beam direction and X is perpendicular. Units are \(\mu m\) (refinable).

Phi, Chi, Omega

Goniometer sample setting angles, in degrees.

Gonio. radius

Radius of the diffractometer in mm

InstrName

(str) A name for the instrument, used in preparing a CIF .

Force, Temperature, Humidity, Pressure, Voltage

Variables that describe how the measurement was performed. Not used directly in any computations.

ranId

(int) The random-number Id for the histogram (same value as where top-level key is ranId)

Type

(str) Type of diffraction data, may be ‘Debye-Scherrer’ or ‘Bragg-Brentano’ .

hId

(int) The number assigned to the histogram when the project is loaded or edited (can change)

ranId

(int) A random number id for the histogram that does not change

Background

(list) The background is stored as a list with where the first item in the list is list and the second item is a dict. The list contains the background function and its coefficients; the dict contains Debye diffuse terms and background peaks. (TODO: this needs to be expanded.)

Data

(list) The data consist of a list of 6 np.arrays containing in order:

  1. the x-postions (two-theta in degrees),

  2. the intensity values (Yobs),

  3. the weights for each Yobs value

  4. the computed intensity values (Ycalc)

  5. the background values

  6. Yobs-Ycalc

3.9.1. CW Instrument Parameters

Instrument Parameters are placed in a list of two dicts, where the keys in the first dict are listed below. Note that the dict contents are different for constant wavelength (CW) vs. time-of-flight (TOF) histograms. The value for each item is a list containing three values: the initial value, the current value and a refinement flag which can have a value of True, False or 0 where 0 indicates a value that cannot be refined. The first and second values are floats unless otherwise noted. Items not refined are noted as [*]

key

sub-key

explanation

Instrument Parameters[0]

Type [*]

(str) Histogram type: * ‘PXC’ for constant wavelength x-ray * ‘PNC’ for constant wavelength neutron

Bank [*]

(int) Data set number in a multidata file (usually 1)

Lam

(float) Specifies a wavelength in \(\AA\)

Lam1 [*]

(float) Specifies the primary wavelength in \(\AA\), used in place of Lam when an \(\alpha_1, \alpha_2\) source is used.

Lam2 [*]

(float) Specifies the secondary wavelength in \(\AA\), used with Lam1

I(L2)/I(L1)

(float) Ratio of Lam2 to Lam1, used with Lam1

Zero

(float) Two-theta zero correction in degrees

Azimuth [*]

(float) Azimuthal setting angle for data recorded with differing setting angles

U, V, W

(float) Cagliotti profile coefficients for Gaussian instrumental broadening, where the FWHM goes as \(U \tan^2\theta + V \tan\theta + W\)

X, Y, Z

(float) Cauchy (Lorentzian) instrumental broadening coefficients

SH/L

(float) Variant of the Finger-Cox-Jephcoat asymmetric peak broadening ratio. Note that this is the sum of S/L and H/L where S is sample height, H is the slit height and L is the goniometer diameter.

Polariz.

(float) Polarization coefficient.

Instrument Parameters[1]

(empty dict)

3.9.2. TOF Instrument Parameters

Instrument Parameters are also placed in a list of two dicts, where the keys in each dict listed below, but here for time-of-flight (TOF) histograms. The value for each item is a list containing three values: the initial value, the current value and a refinement flag which can have a value of True, False or 0 where 0 indicates a value that cannot be refined. The first and second values are floats unless otherwise noted. Items not refined are noted as [*]

key

sub-key

explanation

Instrument Parameters[0]

Type [*]

(str) Histogram type: * ‘PNT’ for time of flight neutron

Bank

(int) Data set number in a multidata file

2-theta [*]

(float) Nominal scattering angle for the detector

fltPath [*]

(float) Total flight path source-sample-detector

Azimuth [*]

(float) Azimuth angle for detector right hand rotation from horizontal away from source

difC,difA, difB

(float) Diffractometer constants for conversion of d-spacing to TOF in microseconds

Zero

(float) Zero point offset (microseconds)

alpha

(float) Exponential rise profile coefficients

beta-0 beta-1 beta-q

(float) Exponential decay profile coefficients

sig-0 sig-1 sig-2 sig-q

(float) Gaussian profile coefficients

X,Y,Z

(float) Lorentzian profile coefficients

Instrument Parameters[1]

Pdabc

(list of 4 float lists) Originally created for use in gsas as optional tables of d, alp, bet, d-true; for a reflection alpha & beta are obtained via interpolation from the d-spacing and these tables. The d-true column is apparently unused.

3.10. Powder Reflection Data Structure

For every phase in a histogram, the Reflection Lists value is a dict one element of which is ‘RefList’, which is a np.array containing reflections. The columns in that array are documented below.

index

explanation

0,1,2

h,k,l (float)

3

(int) multiplicity

4

(float) d-space, \(\AA\)

5

(float) pos, two-theta

6

(float) sig, Gaussian width

7

(float) gam, Lorenzian width

8

(float) \(F_{obs}^2\)

9

(float) \(F_{calc}^2\)

10

(float) reflection phase, in degrees

11

(float) intensity correction for reflection, this times \(F_{obs}^2\) or \(F_{calc}^2\) gives Iobs or Icalc

12

(float) Preferred orientation correction

13

(float) Transmission (absorption correction)

14

(float) Extinction correction

3.11. Single Crystal Tree Items

Every single crystal diffraction histogram is stored in the GSAS-II data tree with a top-level entry named beginning with the string “HKLF “. The diffraction data for that information are directly associated with that tree item and there are a series of children to that item. The routines GSASIIdataGUI.GSASII.GetUsedHistogramsAndPhasesfromTree() and GSASIIstrIO.GetUsedHistogramsAndPhases() will load this information into a dictionary where the child tree name is used as a key, and the information in the main entry is assigned a key of Data, as outlined below.

key

sub-key

explanation

Data

(dict) that contains the reflection table, as described in the Single Crystal Reflections description.

Instrument Parameters

(list) containing two dicts where the possible keys in each dict are listed below. The value for most items is a list containing two values: the initial value, the current value. The first and second values are floats unless otherwise noted.

Lam

(two floats) Specifies a wavelength in \(\AA\)

Type

(two str values) Histogram type : * ‘SXC’ for constant wavelength x-ray * ‘SNC’ for constant wavelength neutron * ‘SNT’ for time of flight neutron * ‘SEC’ for constant wavelength electrons (e.g. micro-ED)

InstrName

(str) A name for the instrument, used in preparing a CIF

wtFactor

(float) A weighting factor to increase or decrease the leverage of data in the histogram. A value of 1.0 weights the data with their standard uncertainties and a larger value increases the weighting of the data (equivalent to decreasing the uncertainties).

hId

(int) The number assigned to the histogram when the project is loaded or edited (can change)

ranId

(int) A random number id for the histogram that does not change

3.12. Single Crystal Reflection Data Structure

For every single crystal a histogram, the 'Data' item contains the structure factors as an np.array in item ‘RefList’. The columns in that array are documented below.

index

explanation

0,1,2

(float) h,k,l

3

(int) multiplicity

4

(float) d-space, \(\AA\)

5

(float) \(F_{obs}^2\)

6

(float) \(\sigma(F_{obs}^2)\)

7

(float) \(F_{calc}^2\)

8

(float) \(F_{obs}^2T\)

9

(float) \(F_{calc}^2T\)

10

(float) reflection phase, in degrees

11

(float) intensity correction for reflection, this times \(F_{obs}^2\) or \(F_{calc}^2\) gives Iobs or Icalc

3.13. Image Data Structure

Every 2-dimensional image is stored in the GSAS-II data tree with a top-level entry named beginning with the string “IMG “. The image data are directly associated with that tree item and there are a series of children to that item. The routines GSASIIdataGUI.GSASII.GetUsedHistogramsAndPhasesfromTree() and GSASIIstrIO.GetUsedHistogramsAndPhases() will load this information into a dictionary where the child tree name is used as a key, and the information in the main entry is assigned a key of Data, as outlined below.

key

sub-key

explanation

Comments

(list of str) Text strings extracted from the original image data header or a metafile. These cannot be changed by the user; it may be empty.

Image Controls

azmthOff

(float) The offset to be applied to an azimuthal value. Accomodates detector orientations other than with the detector X-axis horizontal.

background image

(list:str,float) The name of a tree item (“IMG …”) that is to be subtracted during image integration multiplied by value. It must have the same size/shape as the integrated image. NB: value < 0 for subtraction.

calibrant

(str) The material used for determining the position/orientation of the image. The data is obtained from ImageCalibrants() and UserCalibrants.py (supplied by user).

calibdmin

(float) The minimum d-spacing used during the last calibration run.

calibskip

(int) The number of expected diffraction lines skipped during the last calibration run.

center

(list:floats) The [X,Y] point in detector coordinates (mm) where the direct beam strikes the detector plane as determined by calibration. This point does not have to be within the limits of the detector boundaries.

centerAzm

(bool) If True then the azimuth reported for the integrated slice of the image is at the center line otherwise it is at the leading edge.

color

(str) The name of the colormap used to display the image. Default = ‘Paired’.

cutoff

(float) The minimum value of I/Ib for a point selected in a diffraction ring for calibration calculations. See pixLimit for details as how point is found.

DetDepth

(float) Coefficient for penetration correction to distance; accounts for diffraction ring offset at higher angles. Optionally determined by calibration.

DetDepthRef

(bool) If True then refine DetDepth during calibration/recalibration calculation.

distance

(float) The distance (mm) from sample to detector plane.

ellipses

(list:lists) Each object in ellipses is a list [center,phi,radii,color] where center (list) is location (mm) of the ellipse center on the detector plane, phi is the rotation of the ellipse minor axis from the x-axis, and radii are the minor & major radii of the ellipse. If radii[0] is negative then parameters describe a hyperbola. Color is the selected drawing color (one of ‘b’, ‘g’ ,’r’) for the ellipse/hyperbola.

edgemin

(float) Not used; parameter in EdgeFinder code.

fullIntegrate

(bool) If True then integrate over full 360 deg azimuthal range.

GonioAngles

(list:floats) The ‘Omega’,’Chi’,’Phi’ goniometer angles used for this image. Required for texture calculations.

invert_x

(bool) If True display the image with the x-axis inverted.

invert_y

(bool) If True display the image with the y-axis inverted.

IOtth

(list:floats) The minimum and maximum 2-theta values to be used for integration.

LRazimuth

(list:floats) The minimum and maximum azimuth values to be used for integration.

Oblique

(list:float,bool) If True apply a detector absorption correction using the value to the intensities obtained during integration.

outAzimuths

(int) The number of azimuth pie slices.

outChannels

(int) The number of 2-theta steps.

pixelSize

(list:ints) The X,Y dimensions (microns) of each pixel.

pixLimit

(int) A box in the image with 2*pixLimit+1 edges is searched to find the maximum. This value (I) along with the minimum (Ib) in the box is reported by GSASIIimage.ImageLocalMax() and subject to cutoff in GSASIIimage.makeRing(). Locations are used to construct rings of points for calibration calcualtions.

PolaVal

(list:float,bool) If type=’SASD’ and if True, apply polarization correction to intensities from integration using value.

rings

(list:lists) Each entry is [X,Y,dsp] where X & Y are lists of x,y coordinates around a diffraction ring with the same d-spacing (dsp)

ring

(list) The x,y coordinates of the >5 points on an inner ring selected by the user,

Range

(list) The minimum & maximum values of the image

rotation

(float) The angle between the x-axis and the vector about which the detector is tilted. Constrained to -180 to 180 deg.

SampleShape

(str) Currently only ‘Cylinder’. Sample shape for Debye-Scherrer experiments; used for absorption calculations.

SampleAbs

(list: float,bool) Value of absorption coefficient for Debye-Scherrer experimnents, flag if True to cause correction to be applied.

setDefault

(bool) If True the use the image controls values for all new images to be read. (might be removed)

setRings

(bool) If True then display all the selected x,y ring positions (vida supra rings) used in the calibration.

showLines

(bool) If True then isplay the integration limits to be used.

size

(list:int) The number of pixels on the image x & y axes

type

(str) One of ‘PWDR’, ‘SASD’ or ‘REFL’ for powder, small angle or reflectometry data, respectively.

tilt

(float) The angle the detector normal makes with the incident beam; range -90 to 90.

wavelength

(float) The radiation wavelength (\(\AA\)) as entered by the user (or someday obtained from the image header).

Masks

Arcs

(list: lists) Each entry [2-theta,[azimuth[0],azimuth[1]],thickness] describes an arc mask to be excluded from integration

Frames

(list:lists) Each entry describes the x,y points (3 or more - mm) that describe a frame outside of which is excluded from recalibration and integration. Only one frame is allowed.

Points

(list:lists) Each entry [x,y,radius] (mm) describes an excluded spot on the image to be excluded from integration.

Polygons

(list:lists) Each entry is a list of 3+ [x,y] points (mm) that describe a polygon on the image to be excluded from integration.

Rings

(list: lists) Each entry [2-theta,thickness] describes a ring mask to be excluded from integration.

Thresholds

(list:[tuple,list]) [(Imin,Imax),[Imin,Imax]] This gives lower and upper limits for points on the image to be included in integrsation. The tuple is the image intensity limits and the list are those set by the user.

SpotMask

(dict: int & array) ‘esdMul’(int) number of standard deviations above mean ring intensity to mask ‘spotMask’ (bool array) the spot mask for every pixel in image

Stress/Strain

Sample phi

(float) Sample rotation about vertical axis.

Sample z

(float) Sample translation from the calibration sample position (for Sample phi = 0) These will be restricted by space group symmetry; result of strain fit refinement.

Type

(str) ‘True’ or ‘Conventional’: The strain model used for the calculation.

d-zero

(list:dict) Each item is for a diffraction ring on the image; all items are from the same phase and are used to determine the strain tensor. The dictionary items are: ‘Dset’: (float) True d-spacing for the diffraction ring; entered by the user. ‘Dcalc’: (float) Average calculated d-spacing determined from strain coeff. ‘Emat’: (list: float) The strain tensor elements e11, e12 & e22 (e21=e12, rest are 0) ‘Esig’: (list: float) Esds for Emat from fitting. ‘pixLimit’: (int) Search range to find highest point on ring for each data point ‘cutoff’: (float) I/Ib cutoff for searching. ‘ImxyObs’: (list: lists) [[X],[Y]] observed points to be used for strain calculations. ‘ImtaObs’: (list: lists) [[d],[azm]] transformed via detector calibration from ImxyObs. ‘ImtaCalc’: (list: lists [[d],[azm]] calculated d-spacing & azimuth from fit.

3.14. Parameter Dictionary

The parameter dictionary contains all of the variable parameters for the refinement. The dictionary keys are the name of the parameter (<phase>:<hist>:<name>:<atom>). It is prepared in two ways. When loaded from the tree (in GSASIIdataGUI.GSASII.MakeLSParmDict() and GSASIIIO.ExportBaseclass.loadParmDict()), the values are lists with two elements: [value, refine flag]

When loaded from the GPX file (in GSASIIstrMain.Refine() and GSASIIstrMain.SeqRefine()), the value in the dict is the actual parameter value (usually a float, but sometimes a letter or string flag value (such as I or A for iso/anisotropic).

3.15. Texture implementation

There are two different places where texture can be treated in GSAS-II. One is for mitigating the effects of texture in a structural refinement. The other is for texture characterization.

For reducing the effect of texture in a structural refinement there are entries labeled preferred orientation in each phase’s data tab. Two different approaches can be used for this, the March-Dollase model and spherical harmonics.

For the March-Dollase model, one axis in reciprocal space is designated as unique (defaulting to the 001 axis) and reflections are corrected according to the angle they make with this axis depending on the March-Dollase ratio. (If unity, no correction is made). The ratio can be greater than one or less than one depending on if crystallites oriented along the designated axis are overrepresented or underrepresented. For most crystal systems there is an obvious choice for the direction of the unique axis and then only a single term needs to be refined. If the number is close to 1, then the correction is not needed.

The second method for reducing the effect of texture in a structural refinement is to create a crystallite orientation probability surface as an expansion in terms spherical harmonic functions. Only functions consistent with cylindrical diffraction suymmetry and having texture symmetry consistent with the Laue class of phase are used and are allowed, so the higher the symmetry the fewer terms that are available for a given spherical harmonics order. To use this correction, select the lowest order that provides refinable terms and perform a refinement. If the texture index remains close to one, then the correction is not needed. If a significant improvement is noted in the profile Rwp, one may wish to see if a higher order expansion gives an even larger improvement.

To characterize texture in a material, generally one needs data collected with the sample at multiple orientations or, for TOF, with detectors at multiple locations around the sample. In this case the detector orientation is given in each histogram’s Sample Parameters and the sample’s orientation is described with the Euler angles specifed on the phase’s Texture tab, which is also where the texture type (cylindrical, rolling,…) and the spherical harmonic order is selected. This should not be used with a single dataset and should not be used if the preferred orientations corrections are used.

The coordinate system used for texture characterization is defined where the sample coordinates (Psi, gamma) are defined with an instrument coordinate system (I, J, K) such that K is normal to the diffraction plane and J is coincident with the direction of the incident radiation beam toward the source. We further define a standard set of right-handed goniometer eulerian angles (Omega, Chi, Phi) so that Omega and Phi are rotations about K and Chi is a rotation about J when Omega = 0. Finally, as the sample may be mounted so that the sample coordinate system (Is, Js, Ks) does not coincide with the instrument coordinate system (I, J, K), we define three eulerian sample rotation angles (Omega-s, Chi-s, Phi-s) that describe the rotation from (Is, Js, Ks) to (I, J, K). The sample rotation angles are defined so that with the goniometer angles at zero Omega-s and Phi-s are rotations about K and Chi-s is a rotation about J.

Three typical examples:

  1. Bragg-Brentano laboratory diffractometer: Chi=0

  2. Debye-Scherrer counter detector; sample capillary axis perpendicular to diffraction plane: Chi=90

  3. Debye-Scherrer 2D area detector positioned directly behind sample; sample capillary axis horizontal; Chi=0

NB: The area detector azimuthal angle will equal 0 in horizontal plane to right as viewed from x-ray source and will equal 90 at vertical “up” direction.

3.16. ISODISTORT implementation

CIFs prepared with the ISODISTORT web site https://stokes.byu.edu/iso/isodistort_version5.6.1/isodistort.php [B. J. Campbell, H. T. Stokes, D. E. Tanner, and D. M. Hatch, “ISODISPLACE: An Internet Tool for Exploring Structural Distortions.” J. Appl. Cryst. 39, 607-614 (2006).] can be read into GSAS-II using import CIF. This will cause constraints to be established for structural distortion modes read from the CIF. At present, of the five types of modes only displacive(_iso_displacivemode…) and occupancy (_iso_occupancymode…) are processed. Not yet processed: _iso_magneticmode…, _iso_rotationalmode… & _iso_strainmode

The CIF importer G2phase_CIF implements class G2phase_CIF.CIFPhaseReader which offers two methods associated with ISODISTORT (ID) input. Method G2phase_CIF.CIFPhaseReader.ISODISTORT_test() checks to see if a CIF block contains the loops with _iso_displacivemode_label or _iso_occupancymode_label items. If so, method G2phase_CIF.CIFPhaseReader.ISODISTORT_proc() is called to read and interpret them. The results are placed into the reader object’s .Phase class variable as a dict item with key 'ISODISTORT'.

Note that each mode ID has a long label with a name such as Pm-3m[1/2,1/2,1/2]R5+(a,a,0)[La:b:dsp]T1u(a). Function G2phase_CIF.ISODISTORT_shortLbl() is used to create a short name for this, such as R5_T1u(a) which is made unique by addition of _n if the short name is duplicated. As each mode is processed, a constraint corresponding to that mode is created and is added to list in the reader object’s .Constraints class variable. Items placed into that list can either be a list, which corresponds to a function (new var) type constraint definition entry, or an item can be a dict, which provides help information for each constraint.

3.16.1. Displacive modes

The coordinate variables, as named by ISODISTORT, are placed in .Phase['ISODISTORT']['IsoVarList'] and the corresponding GSASIIobj.G2VarObj objects for each are placed in .Phase['ISODISTORT']['G2VarList']. The mode variables, as named by ISODISTORT, are placed in .Phase['ISODISTORT']['IsoModeList'] and the corresponding GSASIIobj.G2VarObj objects for each are placed in .Phase['ISODISTORT']['G2ModeList']. [Use str(G2VarObj) to get the variable name from the G2VarObj object, but note that the phase number, n, for the prefix “n::” cannot be determined as the phase number is not yet assigned.]

Displacive modes are a bit complex in that they relate to delta displacements, relative to an offset value for each coordinate, and because the modes are normalized. While GSAS-II also uses displacements, these are added to the coordinates after each refinement cycle and then the delta values are set to zero. ISODISTORT uses fixed offsets (subtracted from the actual position to obtain the delta values) that are taken from the parent structure coordinate and the initial offset value (in _iso_deltacoordinate_value) and these are placed in .Phase['ISODISTORT']['G2coordOffset'] in the same order as .Phase['ISODISTORT']['G2ModeList'], .Phase['ISODISTORT']['IsoVarList'] and ‘’.Phase[ISODISTORT’][‘G2parentCoords’]’’.’

The normalization factors (which the delta values are divided by) are taken from _iso_displacivemodenorm_value and are placed in .Phase['ISODISTORT']['NormList'] in the same order as as ...['IsoModeList'] and ...['G2ModeList'].

The CIF contains a sparse matrix, from the loop_ containing _iso_displacivemodematrix_value which provides the equations for determining the mode values from the coordinates, that matrix is placed in .Phase['ISODISTORT']['Mode2VarMatrix']. The matrix is inverted to produce .Phase['ISODISTORT']['Var2ModeMatrix'], which determines how to compute the mode values from the delta coordinate values. These values are used for the in GSASIIconstrGUI.ShowIsoDistortCalc(), which shows coordinate and mode values, the latter with s.u. values.

3.16.2. Occupancy modes

The delta occupancy variables, as named by ISODISTORT, are placed in .Phase['ISODISTORT']['OccVarList'] and the corresponding GSASIIobj.G2VarObj objects for each are placed in .Phase['ISODISTORT']['G2OccVarList']. The mode variables, as named by ISODISTORT, are placed in .Phase['ISODISTORT']['OccModeList'] and the corresponding GSASIIobj.G2VarObj objects for each are placed in .Phase['ISODISTORT']['G2OccModeList'].

Occupancy modes, like Displacive modes, are also refined as delta values. However, GSAS-II directly refines the fractional occupancies. Offset values for each atom, are taken from _iso_occupancy_formula and are placed in .Phase['ISODISTORT']['ParentOcc]. (Offset values are subtracted from the actual position to obtain the delta values.) Modes are normalized (where the mode values are divided by the normalization factor) are taken from _iso_occupancymodenorm_value and are placed in .Phase['ISODISTORT']['OccNormList'] in the same order as as ...['OccModeList'] and ...['G2OccModeList'].

The CIF contains a sparse matrix, from the loop_ containing _iso_occupancymodematrix_value, which provides the equations for determining the mode values from the coordinates. That matrix is placed in .Phase['ISODISTORT']['Occ2VarMatrix']. The matrix is inverted to produce .Phase['ISODISTORT']['Var2OccMatrix'], which determines how to compute the mode values from the delta coordinate values.

3.16.3. Mode Computations

Constraints are processed after the CIF has been read in GSASIIdataGUI.GSASII.OnImportPhase() or GSASIIscriptable.G2Project.add_phase() by moving them from the reader object’s .Constraints class variable to the Constraints tree entry’s [‘Phase’] list (for list items defining constraints) or the Constraints tree entry’s [‘_Explain’] dict (for dict items defining constraint help information)

The information in .Phase['ISODISTORT'] is used in GSASIIconstrGUI.ShowIsoDistortCalc() which shows coordinate and mode values, the latter with s.u. values. This can be called from the Constraints and Phase/Atoms tree items.

Before each refinement, constraints are processed as described elsewhere. After a refinement is complete, GSASIIstrIO.PrintIndependentVars() shows the shifts and s.u.’s on the refined modes, using GSAS-II values, but GSASIIstrIO.PrintISOmodes() prints the ISODISTORT modes as computed in the web site.

3.17. Parameter Limits

One of the most often requested “enhancements” for GSAS-II would be the inclusion of constraints to force parameters such as occupancies or Uiso values to stay within expected ranges. While it is possible for users to supply their own restraints that would perform this by supplying an appropriate expression with the “General” restraints, the GSAS-II authors do not feel that use of restraints or constraints are a good solution for this common problem where parameters refine to non-physical values. This is because when this occurs, most likely one of the following cases is occurring:

  1. there is a significant problem with the model, for example for an x-ray fit if an O atom is placed where a S is actually present, the Uiso will refine artificially small or the occupancy much larger than unity to try to compensate for the missing electrons; or

  2. the data are simply insensitive to the parameter or combination of parameters, for example unless very high-Q data are included, the effects of a occupancy and Uiso value can have compensating effects, so an assumption must be made; likewise, with neutron data natural-abundance V atoms are nearly invisible due to weak coherent scattering. No parameters can be fit for a V atom with neutrons.

  3. the parameter is non-physical (such as a negative Uiso value) but within two sigma (sigma = standard uncertainty, aka e.s.d.) of a reasonable value, in which case the value is not problematic as it is experimentally indistinguishable from an expected value.

  4. there is a systematic problem with the data (experimental error)

In all these cases, this situation needs to be reviewed by a crystallographer to decide how to best determine a structural model for these data. An implementation with a constraint or restraint is likely to simply hide the problem from the user, making it more probable that a poor model choice is obtained.

What GSAS-II does implement is to allow users to specify ranges for parameters that works by disabling refinement of parameters that refine beyond either a lower limit or an upper limit, where either or both may be optionally specified. Parameters limits are specified in the Controls tree entry in dicts named as Controls['parmMaxDict'] and Controls['parmMinDict'], where the keys are G2VarObj objects corresponding to standard GSAS-II variable (see getVarDescr() and CompileVarDesc()) names, where a wildcard (‘*’) may optionally be used for histogram number or atom number (phase number is intentionally not allowed as a wildcard as it makes little sense to group the same parameter together different phases). Note that prmLookup() is used to see if a name matches a wildcard. The upper or lower limit is placed into these dicts as a float value. These values can be edited using the window created by the Calculate/”View LS parms” menu command or in scripting with the GSASIIscriptable.G2Project.set_Controls() function. In the GUI, a checkbox labeled “match all histograms/atoms” is used to insert a wildcard into the appropriate part of the variable name.

When a refinement is conducted, routine GSASIIstrMain.dropOOBvars() is used to find parameters that have refined to values outside their limits. If this occurs, the parameter is set to the limiting value and the variable name is added to a list of frozen variables (as a G2VarObj objects) kept in a list in the Controls['parmFrozen'] dict. In a sequential refinement, this is kept separate for each histogram as a list in Controls['parmFrozen'][histogram] (where the key is the histogram name) or as a list in Controls['parmFrozen']['FrozenList'] for a non-sequential fit. This allows different variables to be frozen in each section of a sequential fit. Frozen parameters are not included in refinements through removal from the list of parameters to be refined (varyList) in GSASIIstrMain.Refine() or GSASIIstrMain.SeqRefine(). The data window for the Controls tree item shows the number of Frozen variables and the individual variables can be viewed with the Calculate/”View LS parms” menu window or obtained with GSASIIscriptable.G2Project.get_Frozen(). Once a variable is frozen, it will not be refined in any future refinements unless the the variable is removed (manually) from the list. This can also be done with the Calculate/”View LS parms” menu window or GSASIIscriptable.G2Project.set_Frozen().

3.18. GSASIIobj Classes and routines

Classes and routines defined in GSASIIobj follow.

GSASIIobj.AddPhase2Index(rdObj, filename)[source]

Add a phase to the index during reading Used where constraints are generated during import (ISODISTORT CIFs)

GSASIIobj.AtomIdLookup = {}

dict listing for each phase index as a str, the atom label and atom random Id, keyed by atom sequential index as a str; best to access this using LookupAtomLabel()

GSASIIobj.AtomRanIdLookup = {}

dict listing for each phase the atom sequential index keyed by atom random Id; best to access this using LookupAtomId()

GSASIIobj.CompileVarDesc()[source]

Set the values in the variable lookup tables (reVarDesc and reVarStep). This is called in getDescr() and getVarStep() so this initialization is always done before use. These variables are also used in script makeVarTbl.py which creates the table in section 3.2 of the Sphinx docs (Variable names in GSAS-II).

Note that keys may contain regular expressions, where ‘[xyz]’ matches ‘x’ ‘y’ or ‘z’ (equivalently ‘[x-z]’ describes this as range of values). ‘.*’ matches any string. For example:

'AUiso':'Atomic isotropic displacement parameter',

will match variable 'p::AUiso:a'. If parentheses are used in the key, the contents of those parentheses can be used in the value, such as:

'AU([123][123])':'Atomic anisotropic displacement parameter U\1',

will match AU11, AU23,… and U11, U23 etc will be displayed in the value when used.

GSASIIobj.CreatePDFitems(G2frame, PWDRtree, ElList, Qlimits, numAtm=1, FltBkg=0, PDFnames=[])[source]

Create and initialize a new set of PDF tree entries

Parameters:
  • G2frame (Frame) – main GSAS-II tree frame object

  • PWDRtree (str) – name of PWDR to be used to create PDF item

  • ElList (dict) – data structure with composition

  • Qlimits (list) – Q limits to be used for computing the PDF

  • numAtm (float) – no. atom in chemical formula

  • FltBkg (float) – flat background value

  • PDFnames (list) – previously used PDF names

Returns:

the Id of the newly created PDF entry

GSASIIobj.DefaultControls = {'Author': 'no name', 'Copy2Next': False, 'F**2': False, 'FreePrm1': 'Sample humidity (%)', 'FreePrm2': 'Sample voltage (V)', 'FreePrm3': 'Applied load (MN)', 'HatomFix': False, 'Reverse Seq': False, 'SVDtol': 1e-06, 'ShowCell': False, 'UsrReject': {'MaxD': 500.0, 'MaxDF/F': 100.0, 'MinD': 0.05, 'MinExt': 0.01, 'minF/sig': 0.0}, 'deriv type': 'analytic Hessian', 'max cyc': 3, 'min dM/M': 0.001, 'newLeBail': False, 'shift factor': 1.0}

Values to be used as defaults for the initial contents of the Controls data tree item.

class GSASIIobj.ExpressionCalcObj(exprObj)[source]

An object used to evaluate an expression from a ExpressionObj object.

Parameters:

exprObj (ExpressionObj) – a ExpressionObj expression object with an expression string and mappings for the parameter labels in that object.

EvalExpression()[source]

Evaluate an expression. Note that the expression and mapping are taken from the ExpressionObj expression object and the parameter values were specified in SetupCalc(). :returns: a single value for the expression. If parameter values are arrays (for example, from wild-carded variable names), the sum of the resulting expression is returned.

For example, if the expression is 'A*B', where A is 2.0 and B maps to '1::Afrac:*', which evaluates to:

[0.5, 1, 0.5]

then the result will be 4.0.

SetupCalc(parmDict)[source]

Do all preparations to use the expression for computation. Adds the free parameter values to the parameter dict (parmDict).

UpdateDict(parmDict)[source]

Update the dict for the expression with values in a dict :param dict parmDict: a dict of values, items not in use are ignored

UpdateVars(varList, valList)[source]

Update the dict for the expression with a set of values :param list varList: a list of variable names :param list valList: a list of corresponding values

__init__(exprObj)[source]
__weakref__

list of weak references to the object

compiledExpr

The expression as compiled byte-code

eObj

The expression and mappings; a ExpressionObj object

exprDict

dict that defines values for labels used in expression and packages referenced by functions

fxnpkgdict

a dict with references to packages needed to find functions referenced in the expression.

lblLookup

Lookup table that specifies the expression label name that is tied to a particular GSAS-II parameters in the parmDict.

parmDict

A copy of the parameter dictionary, for distance and angle computation

su

Standard error evaluation where supplied by the evaluator

varLookup

Lookup table that specifies the GSAS-II variable(s) indexed by the expression label name. (Used for only for diagnostics not evaluation of expression.)

class GSASIIobj.ExpressionObj[source]

Defines an object with a user-defined expression, to be used for secondary fits or restraints. Object is created null, but is changed using LoadExpression(). This contains only the minimum information that needs to be stored to save and load the expression and how it is mapped to GSAS-II variables.

CheckVars()[source]

Check that the expression can be parsed, all functions are defined and that input loaded into the object is internally consistent. If not an Exception is raised.

Returns:

a dict with references to packages needed to find functions referenced in the expression.

EditExpression(exprVarLst, varSelect, varName, varValue, varRefflag)[source]

Load the expression and associated settings from the object into arrays used for editing.

Parameters:
  • exprVarLst (list) – parameter labels found in the expression

  • varSelect (dict) – this will be 0 for Free parameters and non-zero for expression labels linked to G2 variables.

  • varName (dict) – Defines a name (str) associated with each free parameter

  • varValue (dict) – Defines a value (float) associated with each free parameter

  • varRefflag (dict) – Defines a refinement flag (bool) associated with each free parameter

Returns:

the expression as a str

GetDepVar()[source]

return the dependent variable, or None

GetIndependentVars()[source]

Returns the names of the required independent parameters used in expression

GetVaried()[source]

Returns the names of the free parameters that will be refined

GetVariedVarVal()[source]

Returns the names and values of the free parameters that will be refined

LoadExpression(expr, exprVarLst, varSelect, varName, varValue, varRefflag)[source]

Load the expression and associated settings into the object. Raises an exception if the expression is not parsed, if not all functions are defined or if not all needed parameter labels in the expression are defined.

This will not test if the variable referenced in these definitions are actually in the parameter dictionary. This is checked when the computation for the expression is done in SetupCalc().

Parameters:
  • expr (str) – the expression

  • exprVarLst (list) – parameter labels found in the expression

  • varSelect (dict) – this will be 0 for Free parameters and non-zero for expression labels linked to G2 variables.

  • varName (dict) – Defines a name (str) associated with each free parameter

  • varValue (dict) – Defines a value (float) associated with each free parameter

  • varRefflag (dict) – Defines a refinement flag (bool) associated with each free parameter

ParseExpression(expr)[source]

Parse an expression and return a dict of called functions and the variables used in the expression. Returns None in case an error is encountered. If packages are referenced in functions, they are loaded and the functions are looked up into the modules global workspace.

Note that no changes are made to the object other than saving an error message, so that this can be used for testing prior to the save.

Returns:

a list of used variables

SetDepVar(var)[source]

Set the dependent variable, if used

UpdateVariedVars(varyList, values)[source]

Updates values for the free parameters (after a refinement); only updates refined vars

__init__()[source]
__weakref__

list of weak references to the object

assgnVars

A dict where keys are label names in the expression mapping to a GSAS-II variable. The value a G2 variable name. Note that the G2 variable name may contain a wild-card and correspond to multiple values.

expression

The expression as a text string

freeVars

A dict where keys are label names in the expression mapping to a free parameter. The value is a list with:

  • a name assigned to the parameter

  • a value for to the parameter and

  • a flag to determine if the variable is refined.

lastError

Shows last encountered error in processing expression (list of 1-3 str values)

GSASIIobj.FindFunction(f)[source]

Find the object corresponding to function f

Parameters:

f (str) – a function name such as ‘numpy.exp’

Returns:

(pkgdict,pkgobj) where pkgdict contains a dict that defines the package location(s) and where pkgobj defines the object associated with the function. If the function is not found, pkgobj is None.

exception GSASIIobj.G2Exception(msg)[source]

A generic GSAS-II exception class

__init__(msg)[source]
__str__()[source]

Return str(self).

__weakref__

list of weak references to the object

exception GSASIIobj.G2RefineCancel(msg)[source]

Raised when Cancel is pressed in a refinement dialog

__init__(msg)[source]
__str__()[source]

Return str(self).

__weakref__

list of weak references to the object

class GSASIIobj.G2VarObj(*args)[source]

Defines a GSAS-II variable either using the phase/atom/histogram unique Id numbers or using a character string that specifies variables by phase/atom/histogram number (which can change). Note that GSASIIstrIO.GetUsedHistogramsAndPhases(), which calls IndexAllIds() (or GSASIIscriptable.G2Project.index_ids()) should be used to (re)load the current Ids before creating or later using the G2VarObj object.

This can store rigid body variables, but does not translate the residue # and body # to/from random Ids

A G2VarObj object can be created with a single parameter:

Parameters:

varname (str/tuple) –

a single value can be used to create a G2VarObj

object. If a string, it must be of form “p:h:var” or “p:h:var:a”, where

  • p is the phase number (which may be left blank or may be ‘*’ to indicate all phases);

  • h is the histogram number (which may be left blank or may be ‘*’ to indicate all histograms);

  • a is the atom number (which may be left blank in which case the third colon is omitted). The atom number can be specified as ‘*’ if a phase number is specified (not as ‘*’). For rigid body variables, specify a will be a string of form “residue:body#”

Alternately a single tuple of form (Phase,Histogram,VarName,AtomID) can be used, where Phase, Histogram, and AtomID are None or are ranId values (or one can be ‘*’) and VarName is a string. Note that if Phase is ‘*’ then the AtomID is an atom number. For a rigid body variables, AtomID is a string of form “residue:body#”.

If four positional arguments are supplied, they are:

Parameters:
  • phasenum (str/int) – The number for the phase (or None or ‘*’)

  • histnum (str/int) – The number for the histogram (or None or ‘*’)

  • varname (str) – a single value can be used to create a G2VarObj

  • atomnum (str/int) – The number for the atom (or None or ‘*’)

__eq__(other)[source]

Allow comparison of G2VarObj to other G2VarObj objects or strings. If any field is a wildcard (‘*’) that field matches.

__hash__()[source]

Allow G2VarObj to be a dict key by implementing hashing

__init__(*args)[source]
__repr__()[source]

Return the detailed contents of the object

__str__()[source]

Return str(self).

__weakref__

list of weak references to the object

_show()[source]

For testing, shows the current lookup table

fmtVarByMode(seqmode, note, warnmsg)[source]

Format a parameter object for display. Note that these changes are only temporary and are only shown only when the Constraints data tree is selected.

  • In a non-sequential refinement or where the mode is ‘use-all’, the name is converted unchanged to a str

  • In a sequential refinement when the mode is ‘wildcards-only’ the name is converted unchanged to a str but a warning is added for non-wildcarded HAP or Histogram parameters

  • In a sequential refinement or where the mode is ‘auto-wildcard’, a histogram number is converted to a wildcard (*) and then converted to str

Parameters:
  • mode (str) – the sequential mode (see above)

  • note (str) – value displayed on the line of the constraint/equiv.

  • warnmsg (str) – a message saying the constraint is not used

Returns:

varname, explain, note, warnmsg (all str values) where:

  • varname is the parameter expressed as a string,

  • explain is blank unless there is a warning explanation about the parameter or blank

  • note is the previous value unless overridden

  • warnmsg is the previous value unless overridden

varname(hist=None)[source]

Formats the GSAS-II variable name as a “traditional” GSAS-II variable string (p:h:<var>:a) or (p:h:<var>)

Parameters:

hist (str/int) – if specified, overrides the histogram number with the specified value

Returns:

the variable name as a str

GSASIIobj.GenWildCard(varlist)[source]

Generate wildcard versions of G2 variables. These introduce ‘*’ for a phase, histogram or atom number (but only for one of these fields) but only when there is more than one matching variable in the input variable list. So if the input is this:

varlist = ['0::AUiso:0', '0::AUiso:1', '1::AUiso:0']

then the output will be this:

wildList = ['*::AUiso:0', '0::AUiso:*']
Parameters:

varlist (list) – an input list of GSAS-II variable names (such as 0::AUiso:0)

Returns:

wildList, the generated list of wild card variable names.

GSASIIobj.GetPhaseNames(fl)[source]

Returns a list of phase names found under ‘Phases’ in GSASII gpx file NB: there is another one of these in GSASIIstrIO.py that uses the gpx filename

Parameters:

fl (file) – opened .gpx file

Returns:

list of phase names

GSASIIobj.HistIdLookup = {}

dict listing histogram name and random Id, keyed by sequential histogram index as a str; best to access this using LookupHistName()

GSASIIobj.HistRanIdLookup = {}

dict listing histogram sequential index keyed by histogram random Id; best to access this using LookupHistId()

GSASIIobj.HowDidIgetHere(wherecalledonly=False)[source]

Show a traceback with calls that brought us to the current location. Used for debugging.

class GSASIIobj.ImportBaseclass(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]

Defines a base class for the reading of input files (diffraction data, coordinates,…). See Writing a Import Routine for an explanation on how to use a subclass of this class.

CIFValidator(filepointer)[source]

A ContentsValidator() for use to validate CIF files.

ContentsValidator(filename)[source]

This routine will attempt to determine if the file can be read with the current format. This will typically be overridden with a method that takes a quick scan of [some of] the file contents to do a “sanity” check if the file appears to match the selected format. the file must be opened here with the correct format (binary/text)

ExtensionValidator(filename)[source]

This methods checks if the file has the correct extension

Returns:

  • False if this filename will not be supported by this reader (only when strictExtension is True)

  • True if the extension matches the list supplied by the reader

  • None if the reader allows un-registered extensions

exception ImportException[source]

Defines an Exception that is used when an import routine hits an expected error, usually in .Reader.

Good practice is that the Reader should define a value in self.errors that tells the user some information about what is wrong with their file.

__weakref__

list of weak references to the object

ReInitialize()[source]

Reinitialize the Reader to initial settings

__init__(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]
__weakref__

list of weak references to the object

class GSASIIobj.ImportImage(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]

Defines a base class for the reading of images

Images are read in only these places:

When reading an image, the Reader() routine in the ImportImage class should set:

  • Comments: a list of strings (str),

  • Npix: the number of pixels in the image (int),

  • Image: the actual image as a numpy array (np.array)

  • Data: a dict defining image parameters (dict). Within this dict the following data items are needed:

    • ‘pixelSize’: size of each pixel in microns (such as [200.,200.].

    • ‘wavelength’: wavelength in \(\AA\).

    • ‘distance’: distance of detector from sample in cm.

    • ‘center’: uncalibrated center of beam on detector (such as [204.8,204.8].

    • ‘size’: size of image (such as [2048,2048]).

    • ‘ImageTag’: image number or other keyword used to retrieve image from a multi-image data file (defaults to 1 if not specified).

    • ‘sumfile’: holds sum image file name if a sum was produced from a multi image file

optional data items:

  • repeat: set to True if there are additional images to read in the file, False otherwise

  • repeatcount: set to the number of the image.

Note that the above is initialized with InitParameters(). (Also see Writing a Import Routine for an explanation on how to use import classes in general.)

InitParameters()[source]

initialize the instrument parameters structure

LoadImage(ParentFrame, imagefile, imagetag=None)[source]

Optionally, call this after reading in an image to load it into the tree. This saves time by preventing a reread of the same information.

ReInitialize()[source]

Reinitialize the Reader to initial settings – not used at present

__init__(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]
class GSASIIobj.ImportPDFData(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]

Defines a base class for the reading of files with PDF G(R) data. See Writing a Import Routine for an explanation on how to use this class.

ReInitialize()[source]

Reinitialize the Reader to initial settings

__init__(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]
class GSASIIobj.ImportPhase(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]

Defines a base class for the reading of files with coordinates

Objects constructed that subclass this (in import/G2phase_*.py etc.) will be used in GSASIIdataGUI.GSASII.OnImportPhase() and in GSASIIscriptable.import_generic(). See Writing a Import Routine for an explanation on how to use this class.

__init__(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]
class GSASIIobj.ImportPowderData(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]

Defines a base class for the reading of files with powder data.

Objects constructed that subclass this (in import/G2pwd_*.py etc.) will be used in GSASIIdataGUI.GSASII.OnImportPowder() and in GSASIIscriptable.import_generic(). See Writing a Import Routine for an explanation on how to use this class.

ReInitialize()[source]

Reinitialize the Reader to initial settings

__init__(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]
class GSASIIobj.ImportReflectometryData(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]

Defines a base class for the reading of files with reflectometry data. See Writing a Import Routine for an explanation on how to use this class.

ReInitialize()[source]

Reinitialize the Reader to initial settings

__init__(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]
class GSASIIobj.ImportSmallAngleData(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]

Defines a base class for the reading of files with small angle data. See Writing a Import Routine for an explanation on how to use this class.

ReInitialize()[source]

Reinitialize the Reader to initial settings

__init__(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]
class GSASIIobj.ImportStructFactor(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]

Defines a base class for the reading of files with tables of structure factors.

Structure factors are read with a call to GSASIIdataGUI.GSASII.OnImportSfact() which in turn calls GSASIIdataGUI.GSASII.OnImportGeneric(), which calls methods ExtensionValidator(), ContentsValidator() and Reader().

See Writing a Import Routine for an explanation on how to use import classes in general. The specifics for reading a structure factor histogram require that the Reader() routine in the import class need to do only a few things: It should load RefDict item 'RefList' with the reflection list, and set Parameters with the instrument parameters (initialized with InitParameters() and set with UpdateParameters()).

Banks

self.RefDict is a dict containing the reflection information, as read from the file. Item ‘RefList’ contains the reflection information. See the Single Crystal Reflection Data Structure for the contents of each row. Dict element ‘FF’ contains the form factor values for each element type; if this entry is left as initialized (an empty list) it will be initialized as needed later.

InitParameters()[source]

initialize the instrument parameters structure

Parameters

self.Parameters is a list with two dicts for data parameter settings

ReInitialize()[source]

Reinitialize the Reader to initial settings

UpdateParameters(Type=None, Wave=None)[source]

Revise the instrument parameters

__init__(formatName, longFormatName=None, extensionlist=[], strictExtension=False)[source]
GSASIIobj.IndexAllIds(Histograms, Phases)[source]

Scan through the used phases & histograms and create an index to the random numbers of phases, histograms and atoms. While doing this, confirm that assigned random numbers are unique – just in case lightning strikes twice in the same place.

Note: this code assumes that the atom random Id (ranId) is the last element each atom record.

This is called when phases & histograms are looked up in these places (only):

Note that globals PhaseIdLookup and PhaseRanIdLookup are also set in AddPhase2Index() to temporarily assign a phase number as a phase is being imported.

TODO: do we need a lookup for rigid body variables?

GSASIIobj.LookupAtomId(pId, ranId)[source]

Get the atom number from a phase and atom random Id

Parameters:
  • pId (int/str) – the sequential number of the phase

  • ranId (int) – the random Id assigned to an atom

Returns:

the index number of the atom (str)

GSASIIobj.LookupAtomLabel(pId, index)[source]

Get the atom label from a phase and atom index number

Parameters:
  • pId (int/str) – the sequential number of the phase

  • index (int) – the index of the atom in the list of atoms

Returns:

the label for the atom (str) and the random Id of the atom (int)

GSASIIobj.LookupHistId(ranId)[source]

Get the histogram number and name from a histogram random Id

Parameters:

ranId (int) – the random Id assigned to a histogram

Returns:

the sequential Id (hId) number for the histogram (str)

GSASIIobj.LookupHistName(hId)[source]

Get the histogram number and name from a histogram Id

Parameters:

hId (int/str) – the sequential assigned to a histogram

Returns:

(hist,ranId) where hist is the name of the histogram (str) and ranId is the random # id for the histogram (int)

GSASIIobj.LookupPhaseId(ranId)[source]

Get the phase number and name from a phase random Id

Parameters:

ranId (int) – the random Id assigned to a phase

Returns:

the sequential Id (pId) number for the phase (str)

GSASIIobj.LookupPhaseName(pId)[source]

Get the phase number and name from a phase Id

Parameters:

pId (int/str) – the sequential assigned to a phase

Returns:

(phase,ranId) where phase is the name of the phase (str) and ranId is the random # id for the phase (int)

GSASIIobj.LookupWildCard(varname, varlist)[source]

returns a list of variable names from list varname that match wildcard name in varname

Parameters:
  • varname (str) – a G2 variable name containing a wildcard (such as *::var)

  • varlist (list) – the list of all variable names used in the current project

Returns:

a list of matching GSAS-II variables (may be empty)

GSASIIobj.MakeUniqueLabel(lbl, labellist)[source]

Make sure that every a label is unique against a list by adding digits at the end until it is not found in list.

Parameters:
  • lbl (str) – the input label

  • labellist (list) – the labels that have already been encountered

Returns:

lbl if not found in labellist or lbl with _1-9 (or _10-99, etc.) appended at the end

GSASIIobj.PhaseIdLookup = {}

dict listing phase name and random Id keyed by sequential phase index as a str; best to access this using LookupPhaseName()

GSASIIobj.PhaseRanIdLookup = {}

dict listing phase sequential index keyed by phase random Id; best to access this using LookupPhaseId()

GSASIIobj.ReadCIF(URLorFile)[source]

Open a CIF, which may be specified as a file name or as a URL using PyCifRW (from James Hester). The open routine gets confused with DOS names that begin with a letter and colon “C:dir” so this routine will try to open the passed name as a file and if that fails, try it as a URL

Parameters:

URLorFile (str) – string containing a URL or a file name. Code will try first to open it as a file and then as a URL.

Returns:

a PyCifRW CIF object.

GSASIIobj.SetDefaultSample()[source]

Fills in default items for the Sample dictionary for Debye-Scherrer & SASD

GSASIIobj.SetNewPhase(Name='New Phase', SGData=None, cell=None, Super=None)[source]

Create a new phase dict with default values for various parameters

Parameters:
  • Name (str) – Name for new Phase

  • SGData (dict) – space group data from GSASIIspc:SpcGroup(); defaults to data for P 1

  • cell (list) – unit cell parameter list; defaults to [1.0,1.0,1.0,90.,90,90.,1.]

GSASIIobj.ShortHistNames = {}

a dict containing a possibly shortened and when non-unique numbered version of the histogram name. Keyed by the histogram sequential index.

GSASIIobj.ShortPhaseNames = {}

a dict containing a possibly shortened and when non-unique numbered version of the phase name. Keyed by the phase sequential index.

class GSASIIobj.ShowTiming[source]

An object to use for timing repeated sections of code.

Create the object with::

tim0 = ShowTiming()

Tag sections of code to be timed with::

tim0.start(‘start’) tim0.start(‘in section 1’) tim0.start(‘in section 2’)

etc. (Note that each section should have a unique label.)

After the last section, end timing with::

tim0.end()

Show timing results with::

tim0.show()

__init__()[source]
__weakref__

list of weak references to the object

GSASIIobj.SortVariables(varlist)[source]

Sorts variable names in a sensible manner

GSASIIobj.StripUnicode(string, subs='.')[source]

Strip non-ASCII characters from strings

Parameters:
  • string (str) – string to strip Unicode characters from

  • subs (str) – character(s) to place into string in place of each Unicode character. Defaults to ‘.’

Returns:

a new string with only ASCII characters

GSASIIobj.TestIndexAll()[source]

Test if IndexAllIds() has been called to index all phases and histograms (this is needed before G2VarObj() can be used.

Returns:

Returns True if indexing is needed.

GSASIIobj.VarDescr(varname)[source]

Return two strings with a more complete description for a GSAS-II variable

Parameters:

name (str) – A full G2 variable name with 2 or 3 or 4 colons (<p>:<h>:name[:<a>] or <p>::RBname:<r>:<t>])

Returns:

(loc,meaning) where loc describes what item the variable is mapped (phase, histogram, etc.) and meaning describes what the variable does.

GSASIIobj._lookup(dic, key)[source]

Lookup a key in a dictionary, where None returns an empty string but an unmatched key returns a question mark. Used in G2VarObj

GSASIIobj.fmtVarDescr(varname)[source]

Return a string with a more complete description for a GSAS-II variable

Parameters:

varname (str) – A full G2 variable name with 2 or 3 or 4 colons (<p>:<h>:name[:<a>] or <p>::RBname:<r>:<t>])

Returns:

a string with the description

GSASIIobj.getDescr(name)[source]

Return a short description for a GSAS-II variable

Parameters:

name (str) – The descriptive part of the variable name without colons (:)

Returns:

a short description or None if not found

GSASIIobj.getVarDescr(varname)[source]

Return a short description for a GSAS-II variable

Parameters:

name (str) – A full G2 variable name with 2 or 3 or 4 colons (<p>:<h>:name[:<a1>][:<a2>])

Returns:

a six element list as [p,`h`,`name`,`a1`,`a2`,`description`], where p, h, a1, a2 are str values or None, for the phase number, the histogram number and the atom number; name will always be a str; and description is str or None. If the variable name is incorrectly formed (for example, wrong number of colons), None is returned instead of a list.

GSASIIobj.getVarStep(name, parmDict=None)[source]

Return a step size for computing the derivative of a GSAS-II variable

Parameters:
  • name (str) – A complete variable name (with colons, :)

  • parmDict (dict) – A dict with parameter values or None (default)

Returns:

a float that should be an appropriate step size, either from the value supplied in CompileVarDesc() or based on the value for name in parmDict, if supplied. If not found or the value is zero, a default value of 1e-5 is used. If parmDict is None (default) and no value is provided in CompileVarDesc(), then None is returned.

GSASIIobj.prmLookup(name, prmDict)[source]

Looks for a parameter in a min/max dictionary, optionally considering a wild card for histogram or atom number (use of both will never occur at the same time).

Parameters:
Returns:

Two values, (matchname, value), are returned where:

  • matchname (str) is the G2VarObj object corresponding to the actual matched name, which could contain a wildcard even if name does not; and

  • value (float) which contains the parameter limit.

GSASIIobj.reVarDesc = {re.compile('([UVW])$'): 'Gaussian instrument broadening \\1', re.compile('([XYZ])$'): 'Cauchy instrument broadening \\1', re.compile('([XYZ])cos'): 'Cos position wave for \\1', re.compile('([XYZ])max'): 'ZigZag/Block max value for \\1', re.compile('([XYZ])sin'): 'Sin position wave for \\1', re.compile('([abc])$'): 'Lattice parameter, \\1, from Ai and Djk', re.compile('([vV]ol)'): 'Unit cell volume', re.compile('A([0-5])'): 'Reciprocal metric tensor component \\1', re.compile('A([xyz])$'): 'Fractional atomic coordinate, \\1', re.compile('AD\\([0-6],-[0-6]\\)([0-6])'): ' Atomic sp. harm. coeff for orbital, \\1', re.compile('AD\\([0-6],[0-6]\\)([0-6])'): ' Atomic sp. harm. coeff for orbital, \\1', re.compile('AM([xyz])$'): 'Atomic magnetic moment parameter, \\1', re.compile('ANe([01])'): ' Atomic <j0> orbital population for orbital, \\1', re.compile('AU([123][123])'): 'Atomic anisotropic displacement parameter U\\1', re.compile('AUiso'): 'Atomic isotropic displacement parameter', re.compile('Absorption'): 'Absorption coef.', re.compile('Afrac'): 'Atomic site fraction parameter', re.compile('Akappa([0-6])'): ' Atomic orbital softness for orbital, \\1', re.compile('Amul'): 'Atomic site multiplicity value', re.compile('Aspect ratio'): 'Particle aspect ratio', re.compile('B$'): 'Porod prefactor', re.compile('BF mult'): 'Background file multiplier', re.compile('Bab([AU])'): 'Babinet solvent scattering coef. \\1', re.compile('Back$'): 'background parameter', re.compile('Back(.*)'): 'Background term #\\1', re.compile('BkPkgam;(.*)'): 'Background peak #\\1 Cauchy width', re.compile('BkPkint;(.*)'): 'Background peak #\\1 intensity', re.compile('BkPkpos;(.*)'): 'Background peak #\\1 position', re.compile('BkPksig;(.*)'): 'Background peak #\\1 Gaussian width', re.compile('C\\([0-9]*,[0-9]*\\)'): 'spherical harmonics preferred orientation coef.', re.compile('Cutoff'): 'Porod cutoff', re.compile('D([123][123])'): 'Anisotropic strain coef. \\1', re.compile('Dcalc'): 'Calc. d-spacing', re.compile('DebyeA'): 'Debye model amplitude', re.compile('DebyeR'): 'Debye model radius', re.compile('DebyeU'): 'Debye model Uiso', re.compile('Depth'): 'Well depth', re.compile('Diameter'): 'Cylinder/disk diameter', re.compile('Displace([XY])'): 'Debye-Scherrer sample displacement \\1', re.compile('Dist'): 'Interparticle distance', re.compile('Eg$'): 'Secondary type I extinction', re.compile('Ep$'): 'Primary extinction', re.compile('Es$'): 'Secondary type II extinction', re.compile('Extinction'): 'Extinction coef.', re.compile('Fcos'): 'Cos site fraction modulation', re.compile('Flack'): 'Flack parameter', re.compile('FreePrm([123])'): 'User defined measurement parameter \\1', re.compile('Fsin'): 'Sin site fraction modulation', re.compile('Fwid'): 'Crenel function width', re.compile('Fzero'): 'Crenel function offset', re.compile('G$'): 'Guinier prefactor', re.compile('Gonio. radius'): 'Distance from sample to detector, mm', re.compile('I\\(L2\\)\\/I\\(L1\\)'): 'Ka2/Ka1 intensity ratio', re.compile('Lam'): 'Wavelength', re.compile('Layer Disp'): 'Layer displacement along beam', re.compile('LayerDisp'): 'Bragg-Brentano Layer displacement', re.compile('Length'): 'Cylinder length', re.compile('M([XYZ])cos$'): 'Cos mag. moment wave for \\1', re.compile('M([XYZ])sin$'): 'Sin mag. moment wave for \\1', re.compile('MD'): 'March-Dollase coef.', re.compile('Mean'): 'Particle mean radius', re.compile('Mustrain;.*'): 'Microstrain coefficient (delta Q/Q x 10**6)', re.compile('P$'): 'Porod power', re.compile('PDFmag'): 'PDF peak magnitude', re.compile('PDFpos'): 'PDF peak position', re.compile('PDFsig'): 'PDF peak std. dev.', re.compile('PkGam'): 'Bragg peak gamma', re.compile('PkInt'): 'Bragg peak intensity', re.compile('PkPos'): 'Bragg peak position', re.compile('PkSig'): 'Bragg peak sigma', re.compile('Polariz.'): 'Polarization correction', re.compile('Pressure'): 'Pressure level for measurement in MPa', re.compile('RBR([TLS])([123AB][123AB])'): 'Residue rigid body group disp. param.', re.compile('RBRO([aijk])'): 'Residue rigid body orientation parameter \\1', re.compile('RBRP([xyz])'): 'Residue rigid body \\1 position parameter', re.compile('RBRTr;.*'): 'Residue rigid body torsion parameter', re.compile('RBRU'): 'Residue rigid body group Uiso param.', re.compile('RBRf'): 'Residue rigid body site fraction', re.compile('RBSAtNo'): 'Atom number for spinning rigid body', re.compile('RBSO([aijk])'): 'Spinning rigid body orientation parameter \\1', re.compile('RBSP([xyz])'): 'Spinning rigid body \\1 position parameter', re.compile('RBSShC([1-20,1-20])'): 'Spinning rigid body sph. harmonics term', re.compile('RBSShRadius'): 'Spinning rigid body shell radius', re.compile('RBV([TLS])([123AB][123AB])'): 'Residue rigid body group disp. param.', re.compile('RBV.*'): 'Vector rigid body parameter', re.compile('RBVO([aijk])'): 'Vector rigid body orientation parameter \\1', re.compile('RBVP([xyz])'): 'Vector rigid body \\1 position parameter', re.compile('RBVU'): 'Residue rigid body group Uiso param.', re.compile('RBVf'): 'Vector rigid body site fraction', re.compile('Radius'): 'Sphere/cylinder/disk radius', re.compile('Rg$'): 'Guinier radius of gyration', re.compile('SH/L'): 'FCJ peak asymmetry correction', re.compile('Scale'): 'Phase fraction (as p:h:Scale) or Histogram scale factor (as :h:Scale)', re.compile('Shell thickness'): 'Multiplier to get inner(<1) or outer(>1) sphere radius', re.compile('Shift'): 'Bragg-Brentano sample displ.', re.compile('Size;.*'): 'Crystallite size value (in microns)', re.compile('StdDev'): 'Standard deviation in Mean', re.compile('Sticky'): 'Stickyness', re.compile('SurfRoughA'): 'Bragg-Brenano surface roughness A', re.compile('SurfRoughB'): 'Bragg-Brenano surface roughness B', re.compile('Temperature'): 'T value for measurement, K', re.compile('Thickness'): 'Disk thickness', re.compile('Tmax'): 'ZigZag/Block max location', re.compile('Tmin'): 'ZigZag/Block min location', re.compile('Transparency'): 'Bragg-Brentano sample tranparency', re.compile('TwinFr'): 'Twin fraction', re.compile('U([123][123])cos$'): 'Cos thermal wave for U\\1', re.compile('U([123][123])sin$'): 'Sin thermal wave for U\\1', re.compile('VolFr'): 'Dense scatterer volume fraction', re.compile('Volume'): 'Particle volume', re.compile('WgtFrac'): 'phase weight fraction', re.compile('Width'): 'Well width', re.compile('Zero'): 'Debye-Scherrer zero correction', re.compile('alpha'): 'TOF profile term', re.compile('alpha-([01])'): 'Pink profile term', re.compile('beta-([01q])'): 'TOF/Pink profile term', re.compile('constr([0-9]*)'): 'Generated degree of freedom from constraint', re.compile('dA([xyz])$'): 'Refined change to atomic coordinate, \\1', re.compile('dif([ABC])'): 'TOF to d-space calibration', re.compile('e([12][12])'): 'strain tensor e\\1', re.compile('eA$'): 'Cubic mustrain value', re.compile('epis'): 'Sticky sphere epsilon', re.compile('int$'): 'peak intensity', re.compile('mV([0-2])$'): 'Modulation vector component \\1', re.compile('nv-(.+)'): 'New variable assignment with name \\1', re.compile('pos$'): 'peak position', re.compile('sig-([012q])'): 'TOF profile term', re.compile('α'): 'Lattice parameter, α, computed from both Ai and Djk', re.compile('β'): 'Lattice parameter, β, computed from both Ai and Djk', re.compile('γ'): 'Lattice parameter, γ, computed from both Ai and Djk'}

This dictionary lists descriptions for GSAS-II variables where keys are compiled regular expressions that will match the name portion of a parameter name. Initialized in CompileVarDesc().

GSASIIobj.reVarStep = {re.compile('([UVW])$'): 1e-05, re.compile('([XYZ])$'): 1e-05, re.compile('A([0-5])'): 1e-05, re.compile('AU([123][123])'): 0.0001, re.compile('AUiso'): 0.0001, re.compile('Afrac'): 1e-05, re.compile('Displace([XY])'): 0.1, re.compile('I\\(L2\\)\\/I\\(L1\\)'): 0.001, re.compile('Lam'): 1e-06, re.compile('Polariz.'): 0.001, re.compile('SH/L'): 0.0001, re.compile('dA([xyz])$'): 1e-06}

This dictionary lists the preferred step size for numerical derivative computation w/r to a GSAS-II variable. Keys are compiled regular expressions and values are the step size for that parameter. Initialized in CompileVarDesc().

GSASIIobj.removeNonRefined(parmList)[source]

Remove items from variable list that are not refined and should not appear as options for constraints

Parameters:

parmList (list) – a list of strings of form “p:h:VAR:a” where VAR is the variable name

Returns:

a list after removing variables where VAR matches a entry in local variable NonRefinedList

GSASIIobj.validateAtomDrawType(typ, generalData={})[source]

Confirm that the selected Atom drawing type is valid for the current phase. If not, use ‘vdW balls’. This is currently used only for setting a default when atoms are added to the atoms draw list.