Rietveld Refinement with GSAS Recent Quote seen in Rietveld e-mail: “Rietveld refinement is one of those few fields of intellectual endeavor wherein the more one does it, the less one understands.” (Sue Kesson) Stephens’ Law – “A Rietveld refinement is never perfected, merely abandoned” Demonstration – refinement of fluroapatite R.B. Von Dreele, Advanced Photon Source Argonne National Laboratory Rietveld refinement is multiparameter curve fitting ) (lab CuKa B-B data) Iobs + Icalc | Io-Ic | Refl. positions Result from fluoroapatite refinement – powder profile is curve with counting noise & fit is smooth curve NB: big plot is sqrt(I) 2 So how do we get there? Beginning – model errors misfits to pattern Can’t just let go all parameters – too far from best model (minimum c2) False minimum c2 Least-squares cycles True minimum – “global” minimum parameter c2 surface shape depends on parameter suite 3 Fluoroapatite start – add model (1st choose lattice/sp. grp.) important – reflection marks match peaks Bad start otherwise – adjust lattice parameters (wrong space group?) 4 2nd add atoms & do default initial refinement – scale & background Notice shape of difference curve – position/shape/intensity errors 5 Errors & parameters? position – lattice parameters, zero point (not common) - other systematic effects – sample shift/offset shape – profile coefficients (GU, GV, GW, LX, LY, etc. in GSAS) intensity – crystal structure (atom positions & thermal parameters) - other systematic effects (absorption/extinction/preferred orientation) NB – get linear combination of all the above NB2 – trend with 2Q (or TOF) important peak shift a – too small too sharp LX - too small wrong intensity Ca2(x) – too small 6 Difference curve – what to do next? Characteristic “up-down-up” profile error NB – can be “down-updown” for too “fat” profile Dominant error – peak shapes? Too sharp? Refine profile parameters next (maybe include lattice parameters) NB - EACH CASE IS DIFFERENT 7 Result – much improved! maybe intensity differences left – refine coordinates & thermal parms. 8 Result – essentially unchanged Ca F PO4 Thus, major error in this initial model – peak shapes 9 So how does Rietveld refinement work? Rietveld Minimize Exact overlaps M R w( I o I c )2 - symmetry Io Incomplete overlaps SIc Ic Residuals: Rwp 2 w(I I ) o c wI 2 o Extract structure factors: Apportion Io by ratio of Ic to Sic & apply corrections Ic 1 F I o Lp Ic 2 o 10 Rietveld refinement - Least Squares Theory Given a set of observations Gobs and a function Gcalc g(p1, p 2 , p 3 ..., pn ) then the best estimate of the values pi is found by minimizing M w(G G )2 o c This is done by setting the derivative to zero w (Go Gc ) Gc 0 p j Results in n “normal” equations (one for each variable) - solve for pi 11 Least Squares Theory - continued Problem - g(pi) is nonlinear & transcendental (sin, cos, etc.) so can’t solve directly Expand g(pi) as Taylor series & toss high order terms Gc (pi ) Gc (ai ) i Gc pi pi ai - initial values of pi pi = pi - ai (shift) Substitute above Gc Gc pi 0 w G i pi p j G Go Gc (ai ) Normal equations - one for each pi; outer sum over observations Solve for pi - shifts of parameters, NOT values 12 Least Squares Theory - continued Rearrange Gc n Gc Gc w p w G i p1 i1 pi p1 . . . Gc n Gc Gc pi wG w pn i1 pi pn Matrix form: Ax=v a i, j w Gc Gc p i p j x j p j vi w (G) Gc p i 13 Least Squares Theory - continued Matrix equation Ax=v Solve x = A-1v = Bv; B = A-1 This gives set of pi to apply to “old” set of ai repeat until all xi~0 (i.e. no more shifts) Quality of fit – “c2” = M/(N-P) 1 if weights “correct” & model without systematic errors (very rarely achieved) Bii = s2i – “standard uncertainty” (“variance”) in pi (usually scaled by c2) Bij/(Bii*Bjj) – “covariance” between pi & pj Rietveld refinement - this process applied to powder profiles Gcalc - model function for the powder profile (Y elsewhere) 14 Rietveld Model: Yc = Io{SkhF2hmhLhP(h) + Ib} Least-squares: minimize M=Sw(Yo-Yc)2 Io - incident intensity - variable for fixed 2Q kh - scale factor for particular phase F2h - structure factor for particular reflection mh - reflection multiplicity Lh - correction factors on intensity - texture, etc. P(h) - peak shape function - strain & microstrain, etc. Ib - background contribution 15 Peak shape functions – can get exotic! Convolution of contributing functions Instrumental effects Source Geometric aberrations Sample effects Particle size - crystallite size Microstrain - nonidentical unit cell sizes CW Peak Shape Functions – basically 2 parts: Gaussian – usual instrument contribution is “mostly” Gaussian 2 2 [-4ln2 k/ Hk] P(k) = 4ln2 e =G Hk p Lorentzian – usual sample broadening contribution 1 =L P( k ) = 2 p Hk 1 + 4 2/H 2 k k H - full width at half maximum - expression from soller slit sizes and monochromator angle - displacement from peak position Convolution – Voigt; linear combination - pseudoVoigt CW Profile Function in GSAS Thompson, Cox & Hastings (with modifications) Pseudo-Voigt P(T) L(T, ) (1 )G(T, ) k j ( )j j1 3 Mixing coefficient FWHM parameter 5 5 5 i i c ig i1 18 CW Axial Broadening Function Finger, Cox & Jephcoat based on van Laar & Yelon Debye-Scherrer cone 2Q Scan H Slit 2Qmin 2Qi 2QBragg Depend on slit & sample “heights” wrt diffr. radius H/L & S/L - parameters in function (typically 0.002 - 0.020) Pseudo-Voigt (TCH) = profile function 19 How good is this function? Protein Rietveld refinement - Very low angle fit 1.0-4.0° peaks - strong asymmetry “perfect” fit to shape 20 Bragg-Brentano Diffractometer – “parafocusing” Focusing circle Diffractometer circle X-ray source Receiving slit Incident beam slit Sample displaced Divergent beam optics Sample Beam footprint transparency 21 CW Function Coefficients - GSAS Shifted difference T' T Ss cosQ Ts sin2Q pRS s 36000 9000 eff Sample transparency pRTs Sample shift s Gaussian profile g2 U tan2 Q V tan Q W P Lorentzian profile cos2 Q X Y tan Q cos Q (plus anisotropic broadening terms) Intrepretation? 22 Crystallite Size Broadening d*=constant d Q cot Q 2 d d 2Q cot Q sin Q d 2Q 2 d cos Q d* b* a* Lorentzian term - usual K - Scherrer const. p 180K p" LX" Gaussian term - rare particles same size? p 180K p " GP" Microstrain Broadening d cons tan t d d d * Q cot Q d d* b* a* Lorentzian term - usual effect Gaussian term - theory? Remove instrumental part 2 d 2Q tan Q d S 100% p " LY" 180 p S 100% " GU" 180 Microstrain broadening – physical model Model – elastic deformation of crystallites Stephens, P.W. (1999). J. Appl. Cryst. 32, 281-289. Also see Popa, N. (1998). J. Appl. Cryst. 31, 176-180. d-spacing expression 1 2 2 2 M a h a k a l a 4 kl a 5 hl a 6 hk hkl 1 2 3 2 d hkl Broadening – variance in Mhkl s2 M hkl Sij i,j M M ai a j 25 Microstrain broadening - continued Terms in variance M M M M M 2 2 M 2 h , k , l , kl , hl , hk a1 a 2 a 3 a 4 a 5 a 6 Substitute – note similar terms in matrix – collect terms h4 2 2 h k M M h2 l 2 2 a i a j h kl h3 l 3 h k h2 k 2 h2 l 2 h2 kl k4 k 2l 2 k 3l k 2l 2 k 3l l4 kl 3 kl 3 k 2l 2 hk 2 l hl3 hkl2 hk 3 hkl2 hk 2 l h3 k hk 2 l hk 3 hl3 hkl2 2 2 hkl hk l h2 l 2 h2 kl 2 2 2 h kl h k h3 l 26 Microstrain broadening - continued Broadening – as variance s 2 M hkl SHKL h H k K l L , H K L 4 HKL 3 collected terms General expression – triclinic – 15 terms s 2 M hkl S400 h4 S040 k 4 S004 l 4 3 S220 h2 k 2 S202 h2 l 2 S022 k 2 l 2 4 S 2 S310 h3 k S103 hl3 S031 k 3 l S130 hk3 S301 h3 l S013 kl 3 2 2 2 h kl S hk l S hkl 211 121 112 Symmetry effects – e.g. monoclinic (b unique) – 9 terms s 2 M hkl S 400 h 4 S 040 k 4 S 004 l 4 3S 202 h 2 l 2 3( S 220 h 2 k 2 S 022 k 2 l 2 ) 2 S 301 h 3l S103 hk 3 4S121 hk 2 l Cubic – m3m – 2 terms s 2 M hkl S400 h4 k 4 l 4 3 S220 h2 k 2 h2 l 2 k 2 l 2 27 Example - unusual line broadening effects in Na parahydroxybenzoate Sharp lines Broad lines Directional dependence Lattice defects? Seeming inconsistency in line broadening - hkl dependent 28 H-atom location in Na parahydroxybenzoate Good F map allowed by better fit to pattern F contour map H-atom location from x-ray powder data 29 Macroscopic Strain Part of peak shape function #5 – TOF & CW d-spacing expression; aij from recip. metric tensor 1 2 2 2 M a h a k a l a 4 kl a 5 hl a 6 hk hkl 1 2 3 2 d hkl Elastic strain – symmetry restricted lattice distortion TOF: ΔT = (d11h2+d22k2+d33l2+d12hk+d13hl+d23kl)d3 CW: ΔT = (d11h2+d22k2+d33l2+d12hk+d13hl+d23kl)d2tanQ Why? Multiple data sets under different conditions (T,P, x, etc.) 30 Symmetry & macrostrain dij – restricted by symmetry e.g. for cubic T = d11h2d3 for TOF Result: change in lattice parameters via change in metric coeff. aij’ = aij-2dij/C for TOF aij’ = aij-(p/9000)dij for CW Use new aij’ to get lattice parameters e.g. for cubic 1 a a ij' 31 Nonstructural Features Affect the integrated peak intensity and not peak shape Bragg Intensity Corrections: Lh Extinction Preferred Orientation Absorption & Surface Roughness Other Geometric Factors Extinctio n Sabine model - Darwin, Zachariasen & Hamilton Eb = Bragg component - reflection 1 1+x Laue component - transmission 2 3 El = 1 - x + x - 5x . . . x < 1 2 4 48 El = 2 1 - 1 - 3 . . . x > 1 px 8x 128x2 Combination of two parts 2 2 Eh = Eb sin Q + El cos Q Sabine Extinction Coefficient Fh x Ex V 2 Crystallite grain size = 80% Increasing wavelength (1-5 Å) 60% Eh 40% 20% 0% 0.0 25.0 50.0 75.0 2Q 100.0 125.0 150.0 Ex What is texture? Nonrandom crystallite grain orientations Random powder - all crystallite orientations equally probable - flat pole figure Pole figure - stereographic projection of a crystal axis down some sample direction Loose powder (100) random texture (100) wire texture Crystallites oriented along wire axis - pole figure peaked in center and at the rim (100’s are 90º apart) Orientation Distribution Function - probability function for texture Metal wire 35 Texture - measurement by diffraction (220) Non-random crystallite orientations in sample Incident beam x-rays or neutrons (200) Sample (111) Debye-Scherrer cones •uneven intensity due to texture •also different pattern of unevenness for different hkl’s •Intensity pattern changes as sample is turned 36 Preferred Orientation - March/Dollase Model Uniaxial packing Ellipsoidal Distribution assumed cylindrical Ellipsoidal particles Spherical Distribution Ro - ratio of ellipsoid axes = 1.0 for no preferred orientation 1 n 2 sin2 2 Oh Ro cos M j1 Ro 3 2 Integral about distribution - modify multiplicity Texture - Orientation Distribution Function - GSAS Probability distribution of crystallite orientations - f(g) f(g) = f(F1,Y,F2) f(g) = l l l=0 m=-l n=-l F1 Y F2 F1,Y,F2 - Euler angles C mn l T mn l Tlmn = Associated Legendre functions or generalized spherical harmonics (g) Texture effect on reflection intensity - Rietveld model 4p l l mn m n A(h, y) C K ( h ) K l l l ( y) l 0 2l 1 m l n l • Projection of orientation distribution function for chosen reflection (h) and sample direction (y) • K - symmetrized spherical harmonics - account for sample & crystal symmetry • “Pole figure” - variation of single reflection intensity as fxn. of sample orientation - fixed h • “Inverse pole figure” - modification of all reflection intensities by sample texture - fixed y - Ideally suited for neutron TOF diffraction • Rietveld refinement of coefficients, Clmn, and 3 orientation angles - sample alignment 39 Absorption X-rays - independent of 2Q - flat sample – surface roughness effect - microabsorption effects - but can change peak shape and shift their positions if small (thick sample) Neutrons - depend on 2Q and but much smaller effect - includes multiple scattering much bigger effect - assume cylindrical sample Debye-Scherrer geometry Model - A.W. Hewat Ah exp(T1AB T2 AB2 2 ) For cylinders and weak absorption only i.e. neutrons - most needed for TOF data not for CW data – fails for R>1 GSAS – New more elaborate model by Lobanov & alte de Viega – works to R>10 Other corrections - simple transmission & flat plate Surface Roughness – Bragg-Brentano only Low angle – less penetration (scatter in less dense material) - less intensity High angle – more penetration (go thru surface roughness) - more dense material; more intensity Nonuniform sample density with depth from surface Most prevalent with strong sample absorption If uncorrected - atom temperature factors too small Suortti model Pitschke, et al. model q 1 p 1 qexp q 1 p 2 sinQ sinQ sin Q SR SR p 1 qexp q 1 p pq (a bit more stable) Other Geometric Corrections Lorentz correction - both X-rays and neutrons Polarization correction - only X-rays 2 X-rays Lp = 1 + M2 cos 2Q 2sin Q cosQ Neutrons - CW Lp = Neutrons - TOF 1 2 2sin Q cosQ 4 Lp = d sinQ Solvent scattering – proteins & zeolites? Contrast effect between structure & “disordered” solvent region f = fo-Aexp(-8pBsin2Q/2) Carbon scattering factor uncorrected 6 4 fC Babinet’s Principle: Atoms not in vacuum – change form factors Solvent corrected 2 0 0 5 10 15 20 2Q 44 Background scattering Manual subtraction – not recommended - distorts the weighting scheme for the observations & puts a bias in the observations Fit to a function - many possibilities: Fourier series - empirical Chebyschev power series - ditto Exponential expansions - air scatter & TDS Fixed interval points - brute force Debye equation - amorphous background (separate diffuse scattering in GSAS) Debye Equation - Amorphous Scattering real space correlation function especially good for TOF terms with sin(QR i ) 1 Ai exp( BiQ2 ) QR i 2 vibration amplitude distance Neutron TOF - fused silica “quartz” 47 Rietveld Refinement with Debye Function O 1.60Å 4.13Å Si 3.12Å 5.11Å 2.63Å 6.1Å a-quartz distances 7 terms Ri –interatomic distances in SiO2 glass 1.587(1), 2.648(1), 4.133(3), 4.998(2), 6.201(7), 7.411(7) & 8.837(21) Same as found in a-quartz 48 Non-Structural Features in Powder Patterns Summary 1. Large crystallite size - extinction 2. Preferred orientation 3. Small crystallite size - peak shape 4. Microstrain (defect concentration) 5. Amorphous scattering - background Time to quit? Stephens’ Law – “A Rietveld refinement is never perfected, merely abandoned” Also – “stop when you’ve run out of things to vary” What if problem is more complex? Apply constraints & restraints “What to do when you have too many parameters & not enough data” 50 Complex structures (even proteins) Too many parameters – “free” refinement fails Known stereochemistry: Bond distances Bond angles Torsion angles (less definite) Group planarity (e.g. phenyl groups) Chiral centers – handedness Etc. Choice: rigid body description – fixed geometry/fewer parameters stereochemical restraints – more data 51 Constraints vs restraints Constraints – reduce no. of parameters Derivative vector After constraints (shorter) F F R il U lk Skj v i p j Derivative vector Before constraints (longer) Rigid body User Symmetry Rectangular matrices Restraints – additional information (data) that model must fit Ex. Bond lengths, angles, etc. 52 Space group symmetry constraints Special positions – on symmetry elements Axes, mirrors & inversion centers (not glides & screws) Restrictions on refineable parameters Simple example: atom on inversion center – fixed x,y,z What about Uij’s? – no restriction – ellipsoid has inversion center Mirrors & axes ? – depends on orientation Example: P 2/m – 2 || b-axis, m ^ 2-fold on 2-fold: x,z – fixed & U11,U22,U33, & U13 variable on m: y fixed & U11,U22, U33, & U13 variable Rietveld programs – GSAS automatic, others not 53 Multi-atom site fractions “site fraction” – fraction of site occupied by atom “site multiplicity”- no. times site occurs in cell “occupancy” – site fraction * site multiplicity may be normalized by max multiplicity GSAS uses fraction & multiplicity derived from sp. gp. Others use occupancy If two atoms in site – Ex. Fe/Mg in olivine Then (if site full) FMg = 1-FFe 54 Multi-atom site fractions - continued If 3 atoms A,B,C on site – problem Diffraction experiment – relative scattering power of site “1-equation & 2-unknowns” unsolvable problem Need extra information to solve problem – 2nd diffraction experiment – different scattering power “2-equations & 2-unknowns” problem Constraint: solution of J.-M. Joubert Add an atom – site has 4 atoms A, B, C, C’ so that FA+FB+FC+FC’=1 Then constrain so FA = -FC and FB = - FC’ 55 Multi-phase mixtures & multiple data sets Neutron TOF – multiple detectors Multi- wavelength synchrotron X-ray/neutron experiments How constrain scales, etc.? I c I b I d Sh Sph Yph p Histogram scale Phase scale Ex. 2 phases & 2 histograms – 2 Sh & 4 Sph – 6 scales Only 4 refinable – remove 2 by constraints Ex. S11 = -S21 & S12 = -S22 56 Rigid body problem – 88 atoms – [FeCl2{OP(C6H5)3}4][FeCl4] P21/c a=14.00Å b=27.71Å c=18.31Å b=104.53 V=6879Å3 264 parameters – no constraints Just one x-ray pattern – not enough data! Use rigid bodies – reduce parameters V. Jorik, I. Ondrejkovicova, R.B. Von Dreele & H. Eherenberg, Cryst. Res. Technol., 38, 174-181 (2003) 57 Rigid body description – 3 rigid bodies FeCl4 – tetrahedron, origin at Fe z Fe - origin Cl1 Cl4 x Cl2 y Cl3 1 translation, 5 vectors Fe [ 0, 0, Cl1 [ sin(54.75), 0, Cl2 [ -sin(54,75), 0, Cl3 [ 0, sin(54.75), Cl4 [ 0, -sin(54.75), D=2.1Å; Fe-Cl bond 0 ] cos(54.75)] cos(54.75)] -cos(54.75)] -cos(54.75)] 58 Rigid body description – continued C4 PO – linear, origin at P C6 – ring, origin at P(!) x C2 (ties them together) D2 C6 C1 D1 D P C5 P [ 0, 0, 0 ] O [ 0, 0 1 ] D=1.4Å C3 z O C1-C6 [ 0, 0, -1 ] D1=1.6Å; P-C bond C1 [ 0, 0, 0 ] C2 [ sin(60), 0, -1/2 ] C3 [-sin(60), 0, -1/2 ] C4 [ sin(60), 0, -3/2 ] C5 [-sin(60), 0, -3/2 ] C6 [ 0, 0, -2 ] D2=1.38Å; C-C aromatic bond 59 Rigid body description – continued Rigid body rotations – about P atom origin For PO group – R1(x) & R2(y) – 4 sets For C6 group – R1(x), R2(y),R3(z),R4(x),R5(z) 3 for each PO; R3(z)=+0, +120, & +240; R4(x)=70.55 Transform: X’=R1(x)R2(y)R3(z)R4(x)R5(z)X C C C x R5(z) C C C 47 structural variables P R4(x) R1(x) y R2(y) R3(z) z O Fe 60 Refinement - results Rwp=4.49% Rp =3.29% RF2 =9.98% Nrb =47 Ntot =69 61 Refinement – RB distances & angles OP(C6)3 1 2 3 4 R1(x) 122.5(13) -76.6(4) 69.3(3) -158.8(9) R2(y) -71.7(3) -15.4(3) 12.8(3) 69.2(4) R3(z)a 27.5(12) 51.7(3) -10.4(3) -53.8(9) R3(z)b 147.5(12) 171.7(3) 109.6(3) 66.2(9) R3(z)c 267.5(12) 291.7(3) 229.6(3) 186.2(9) R4(x) 68.7(2) 68.7(2) 68.7(2) 68.7(2) R5(z)a 99.8(15) 193.0(14) 139.2(16) 64.6(14) R5(z)b 81.7(14) 88.3(17) 135.7(17) -133.3(16) R5(z)c 155.3(16) 63.8(16) 156.2(15) 224.0(16) P-O = 1.482(19)Å, P-C = 1.747(7)Å, C-C = 1.357(4)Å, Fe-Cl = 2.209(9)Å } PO orientation } C3PO torsion (+0,+120,+240) p − C-P-O angle }Phenyl twist x R5(z) R2(y- PO) R4(x) R1(x - PO) R3(z) z Fe 62 Packing diagram – see fit of C6 groups 63 Stereochemical restraints – additional “data” M fY wi Yoi Yci 2 Powder profile (Rietveld)* 2 Bond angles* f a wi aoi aci f d wi d oi d ci 2 f t wi tci 4 Bond distances* Torsion angle pseudopotentials f p wi pci 2 Plane RMS displacements* f v wi voi vci 4 f h wi hoi hci 2 f x wi xoi xci 2 van der Waals distances (if voi<vci) Hydrogen bonds Chiral volumes** f R wi ( Rci ) 4 “/y” pseudopotential wi = 1/s2 weighting factor fx - weight multipliers (typically 0.1-3) 64 For [FeCl2{OP(C6H5)3}4][FeCl4] - restraints Bond distances: Fe-Cl = 2.21(1)Å, P-O = 1.48(2)Å, P-C = 1.75(1)Å, C-C = 1.36(1)Å Number = 4 + 4 + 12 + 72 = 92 Bond angles: O-P-C, C-P-C & Cl-Fe-Cl = 109.5(10) – assume tetrahedral C-C-C & P-C-C = 120(1) – assume hexagon Number = 12 + 12 + 6 + 72 + 24 = 126 Planes: C6 to 0.01 – flat phenyl Number = 72 Total = 92 + 126 + 72 = 290 restraints A lot easier to setup than RB!! 65 Refinement - results Rwp=3.94% Rp =2.89% RF2 =7.70% Ntot =277 66 Stereochemical restraints – superimpose on RB results Nearly identical with RB refinement Different assumptions – different results 67 New rigid bodies for proteins (actually more general) Proteins have too many parameters Poor data/parameter ratio - especially for powder data Very well known amino acid bonding – e.g. Engh & Huber Reduce “free” variables – fixed bond lengths & angles Define new objects for protein structure – flexible rigid bodies for amino acid residues Focus on the “real” variables – location/orientation & torsion angles of each residue Parameter reduction ~1/3 of original protein xyz set 68 Residue rigid body model for phenylalanine Qijk c2 txyz c1 y 3txyz+3Qijk+y+c1+c2 = 9 variables vs 33 unconstrained xyz coordinates 69 Qijk – Quaternion to represent rotations In GSAS defined as: Qijk = r+ai+bj+ck – 4D complex number – 1 real + 3 imaginary components Normalization: r2+a2+b2+c2 = 1 Rotation vector: v = ax+by+cz; u = (ax+by+cz)/sin(a/2) Rotation angle: r2 = cos2(a/2); a2+b2+c2 = sin2(a/2) Quaternion product: Qab = Qa * Qb ≠ Qb * Qa Quaternion vector transformation: v’ = QvQ-1 70 How effective? PDB 194L – HEWL from a space crystallization; single xtal data,1.40Å resolution 21542 observations; 1148 atoms (1001 HEWL) X-Plor 3.1 – RF = 25.8% ~4600 variables GSAS RB refinement – RF=20.9% ~2700 variables RMS difference 0.10Å main chain & 0.21Å all protein atoms RB refinement reduces effect of “over refinement” 71 194L & rigid body model – essentially identical 72 Conclusions – constraints vs. restraints Constraints required space group restrictions multiatom site occupancy Rigid body constraints reduce number of parameters molecular geometry assumptions Restraints add data molecular geometry assumptions (again) 73 GSAS - A bit of history GSAS – conceived in 1982-1983 (A.C. Larson & R.B. Von Dreele) 1st version released in Dec. 1985 •Only TOF neutrons (& buggy) •Only for VAX •Designed for multiple data (histograms) & multiple phases from the start •Did single crystal from start Later – add CW neutrons & CW x-rays (powder data) SGI unix version & then PC (MS-DOS) version also Linux version (briefly HP unix version) 2001 – EXPGUI developed by B.H. Toby Recent – spherical harmonics texture & proteins New Windows, MacOSX, Fedora & RedHat linux versions All identical code – g77 Fortran; 50 pgms. & 800 subroutines GrWin & X graphics via pgplot EXPGUI – all Tcl/Tk – user additions welcome Basic structure is essentially unchanged 74 Structure of GSAS 1. Multiple programs - each with specific purpose editing, powder preparation, least squares, etc. 2. User interface - EXPEDT edit control data & problem parameters for calculations - multilevel menus & help listings text interface (no mouse!) visualize “tree” structure for menus 3. Common file structure – all named as “experiment.ext” experiment name used throughout, extension differs by type of file 4. Graphics - both screen & hardcopy 5. EXPGUI – graphical interface (windows, buttons, edit boxes, etc.); incomplete overlap with EXPEDT but with useful extra features – by B. H. Toby 75 PC-GSAS – GUI only for access to GSAS programs pull down menus for GSAS programs (not linux) 76 GSAS & EXPGUI interfaces GSAS – EXPEDT (and everything else): EXPEDT EXPEDT <?> D F K n L P R S X - data setup option (<?>,D,F,K,L,P,R,S,X) > data setup options: Type this help listing Distance/angle calculation set up Fourier calculation set up Delete all but the last n history records Least squares refinement set up Powder data preparation Review data in the experiment file Single crystal data preparation Exit from EXPEDT On console screen Keyboard input – text & numbers 1 letter commands – menu help Layers of menus – tree structure Type ahead thru layers of menus Macros (@M, @R & @X commands) Numbers – real: ‘0.25’, or ‘1/3’, or ‘2.5e-5’ all allowed Drag & drop for e.g. file names 77 GSAS & EXPGUI interfaces EXPGUI: Access to GSAS Typical GUI – edit boxes, buttons, pull downs etc. Liveplot – powder pattern 78 Unique EXPGUI features (not in GSAS) CIF input – read CIF files (not mmCIF) widplt/absplt coordinate export – various formats instrument parameter file creation/edit widplt Sum Lorentz FWHM (sample) Gauss FWHM (instrument) 79 Powder pattern display - liveplot Zoom (new plot) updates at end of genles run – check if OK! cum. c2 on 80 Powder pattern display - powplot Io Ic Refl. pos. Io-Ic “publication style” plot – works OK for many journals; save as “emf” can be “dressed up”; also ascii output of x,y table 81 Powplot options – x & y axes – “improved” plot? Sqrt(I) Refl. pos. Io Ic rescale y by 4x Q-scale (from Q=p/sinq) 82 Citations: GSAS: A.C. Larson and R.B. Von Dreele, General Structure Analysis System (GSAS), Los Alamos National Laboratory Report LAUR 86-748 (2004). EXPGUI: B. H. Toby, EXPGUI, a graphical user interface for GSAS, J. Appl. Cryst. 34, 210-213 (2001). 83