USER'S INSTRUCTIONS FOR THE ABSORB PROGRAMS ------------------------------------------- ABSORPTION CORRECTIONS BY GAUSSIAN NUMERICAL INTEGRATION OVER THE CRYSTAL VOLUME DEFINED BY INDEXED CRYSTAL FACES AND LENGTHS OF FACE NORMALS THE SOURCE CODE IS SUPPLIED AS TWO MODULES: absorb1.f - A PROGRAM FOR SETTING-UP THE ABSORPTION CALCULATIONS. RUNS INTERACTIVELY. absorb2.f - A PROGRAM FOR CARRYING OUT THE ABSORPTION CORRECTIONS FOR EACH REFLECTION MEASUREMENT. RUNS WITH THE INPUT REFLECTION FILE AND AN "absorb.dat" FILE FROM PROGRAM absorb1. EACH OF THESE MODULES INCORPORATES THE MODULE: absorb3.f - A SET OF SUBPROGRAMS USED BY BOTH absorb1 AND absorb2. INFORMATION NEEDED FOR RUNNING absorb1 INCLUDES: 1. NAME OF THE CRYSTAL; 2. INPUT REFLECTION FILE NAME; 3. OUTPUT REFLECTION FILE NAME TO BE USED BY ABSORB2; 4. UNIT CELL DIMENSIONS; 5. X-RAY WAVELENGTH SYMBOL (FOR CU, MO, OR AG K-ALPHA OR K-BETA) OR RADIATION WAVELENGTH AND LINEAR ABSORPTION COEFFICIENT (FOR OTHER X-RADIATIONS OR NEUTRONS); 6. ELEMENTAL COMPOSITION OF THE ASYMMETRIC CRYSTAL CHEMICAL UNIT AND THE NUMBER OF CRYSTAL CHEMICAL UNITS PER UNIT CELL; 7. MILLER INDICES OF THE CRYSTAL FACES AND THEIR PERPENDICULAR DISTANCES FROM A COMMON ORIGIN POINT IN OR ON THE CRYSTAL; 8. DESIRED RECIPROCAL LATTICE DIRECTIONS FOR THE AXES OF THE GAUSSIAN INTEGRATION GRID AND DESIRED NUMBER OF GRID DIVISIONS ALONG EACH AXIS; 9. DIFFRACTOMETER TYPE AND DIFFRACTOMETER ORIENTATION MATRIX; 10. IF A CAPILLARY CRYSTAL ENCLOSUREE WAS USED, THE TYPE OF GLASS AND THE CAPILLARY DIAMETER AND WALL THICKNESS; 11. IF A CORRECTION IS NEEDED FOR AN INHOMOGENEOUS, QUASIPARALLEL BEAM FROM AN INCIDENT-BEAM MONOCHROMATOR, THE COEFFICIENTS OF A POLYNOMIAL FITTED TO THE PROFILE OF THE BEAM. THE LINEAR ABSORPTION COEFFICIENT MUST BE IN UNITS OF RECIPROCAL MILLIMETERS (NOT CENTIMETERS), AND THE FACE NORMAL LENGTHS MUST BE IN UNITS OF MILLIMETERS (NOT CENTIMETERS). IF OUTPUT OF THE ABSORPTION-WEIGHTED MEAN PATH LENGTH, TBAR, AND THE REVERSE-INCIDENT AND DIFFRACTED BEAM DIRECTION VECTORS, S0(3) AND S1(3), IS REQUESTED, S0 AND S1 ARE GIVEN AS DIRECTION COSINES REFERRED TO THE CRYSTALLOGRAPGIC DIRECT SPACE AXES. DETAILED USERS' NOTES FOR THE ABSORB PROGRAMS ARE PROVIDED IN A TYPEWRITTEN DOCUMENT RATHER THAN IN AN ASCII TEXT FILE. FOR COPIES OF THE ABSORB USERS' NOTES CONTACT THE PROGRAM AUTHOR: DR. GEORGE T. DE TITTA HAUPTMAN-WOODWARD INSTITUTE 73 HIGH STREET BUFFALO, NEW YORK 14203, USA TELEPHONE: 716-856-9600, EXTENSION 325 E-MAIL: DeTitta@HWI.Buffalo.Edu REFERENCE: DeTitta, G.T. (1985). ABSORB: An Absorption Correction Program for Crystals Enclosed in Capillaries with Trapped Mother Liquor. J. Appl. Cryst. 18, 75-79. --------------- == A rough and incomplete ascii version of the absorb users' notes typescript follows. ------------------------------------------------------------------------ Program: ABSORB (10 Feb 82) Author: George T. DeTitta Medical Foundation of Buffalo 73 High Street Buffalo, New York 14203 716-856-9600 extension 325 e-mail: detitta@hwi.buffalo.edu Purpose: Calculate and apply absorption corrections for crystals with natural faces, in or out of capillaries. Introduction: This is a series of programs to calculate and apply Gaussian numerical integration absorption corrections to crystals with natural faces or crystals that can be approximated by natural faces. It will also calculate and correct for absorption by glass capillaries of various sorts and allows for a completely general orientation of the capillary with respect to the crystal and the goniometer head. The programs have been tested against data supplied by Alcock (1974) and Flack, Vincent & Alcock (1980). Along with the transmission factors the programs produce a variety of geometrical calculations concerning the crystal shape. A file for viewing the crystal on the MMS-X display system can be generated. Method: The application of Gaussian quadrature techniques for calculating transmission factors was described by Busing & Levy (1957). Coppens (1970) described the matrix algebra necessary for the calculations. A fuller description of the techniques is given in Appendix A. The place in the scheme of things for absorption correction is after time-dependent scaling and before sorting-merging-averaging the data. Program Setup: ABSORB is set up in two parts. ABSORB1 is an interactive program to create the input file for ABSORB2 which actually calculates and applies the absorption correction. In addition ABSORB1 displays all the geometrical data pertinent to the crystal, and allows test runs for timing purposes and for verifying the correctness of the input data. ABSORB1: A list of information for ABSORB1 should be assembled before running the program. Items necessary include: 1. Title (A) 2. Input Data File Name (A) 3. Output Data File Name (A) 4. Cell constants a, b, c in Angstroms; alpha, beta, gamma in degrees 5. Wavelength symbol and wavelength (AgKalpha, AgKbeta, MoKa, MoKb, CuKa, CuKb, xray or neut) 6. Unit Cell Contents (see below) 7. Crystal Face Data (see below) 8. Grid Point Data (see below) 9. Capillary Data (see below) 10. Printer Frequency for ABSORB2 Unit Cell Contents: Specify the number and contents of the crystal chemical unit (CCU), e.g. 4 CCU each containing C_20 H_14 O_3 Te. Crystal Faces: Each face of a crystal can be completely specified by its Miller indices and the distance to the face from a point within or on the surface of the crystal. This distance is measured along the line perpendicular to the face which passes through the point chosen as the absorption origin. It is particularly advantageous to select a vertex (corner) of the crystal as the absorption origin since the perpendicular distances of the three planes which form the vertex are uniquely zero. Grid Point Data: The three directions along which the grid for Gaussian integration is laid out are specified by three reciprocal axial vectors. Generally the three principal directions are chosen (a*, b*, c* corresponding to 1,0,0; 0,1,0; and 0,0,1) but for crystals of non-uniform dimensions (thin plates, long needles) it may be advantageous to specify one grid along a direction most rapidly varying in dimension. Gaussian grid weights and fractions are tabulated for the values 2-10 inclusive, 12, 16, 20, 24, 32, 40, 48, 64, 80 and 96. Current program dimensions restrict the total number of grid points (see program restrictions) to .le. 4096; e.g., 16**3, 4x10x96 are acceptable. Keep in mind that computer time goes up roughly linearly with the number of grid points sampled and that acceptable results for approximately equi-dimensional crystals with moderate absorption can be had with as few as 2x2x2 points. It is worthwhile to vary the grid in ABSORB1 test runs to find the point of diminishing return. Capillary Data: If the crystal is encapsulated in a capillary tube and if you wish to make the capillary correction you must specify the type of glass (Pyrex, fused quartz or Lindemann), the radius and the thickness of the capillary. In addition you must specify the orientation of the capillary on the goniometer head and the displacement of the crystal from the capillary axis (see Appendix B). It is worth noting that the capillary orientation is most easily specified if the capillary axis is parallel to the phi axis of the diffractometer, and that variations in absorption due to the capillary are minimized when the crystal center of mass is along the capillary axis. Units: All linear dimensions, such as the face-perpendicular distances, the radius and thickness of the capillary, the edges and diagonals of the crystal, etc. are in MILLIMETERS. The linear absorption coefficients mu_x for the crystal and mu_c for the capillary are in RECIPROCAL MILLIMETERS. ABSORB2: After the input file (see Appendix C) has been successfully built and tested in ABSORB1, the transmission factors are calculated and applied in program ABSORB2. ABSORB2 can be conveniently run in batch mode. Acknowledgements: NIH grant AM-19856. Thanks to Drs. D. Harker, H. Hauptman, R. Blessing, G. Moss and D. Swenson for discussions and encouragement. Appendix A. The Absorption Correction Technique ------------------------------------------------ Vectors ------- The unit cell real and reciprocal vectors are the natural frames for the absorption correction. To review notation we state without further explanation Real basis vectors: a, b, c - - - Reciprocal basis vectors: a*, b*, c* - - - ( a.a a.b a.c ) ( - - - - - - ) Real Metric Tensor: G = ( b.a b.b b.c ) = ( - - - - - - ) ( c.a c.b c.c ) ( - - - - - - ) ( a*.a* a*.b* a*.c* ) ( - - - - - - ) Reciprocal Metric Tensor: G* = ( b*.a* b*.b* b*.c* ) = ( - - - - - - ) ( c*.a* c*.b* c*.c* ) ( - - - - - - ) Length of a Real Vector: d = xa + yb + zc - - - - d = (d.d)^1/2 - - = [(xa + yb + zc).(xa + yb + zc)]^1/2 - - - - - - = [x^2 a.a + y^2 b.b + z^2 c.c - - - - - - + 2(xya.b + yzb.c + zxc.a)]^1/2 - - - - - - [( x y z ) G ( x )]^1/2 d = [ = ( y )] = (x^T G x)^1/2 [ ( z )] - = - Length of a Reciprocal Vector: d* = ha* + kb* + lc* - - - - [( h k l ) G* ( h )]^1/2 d* = [ = ( k )] = (h^T G* h)^1/2 [ ( l )] - = - Conversion of Bases: -------------------- The physical vector q can be expressed in either the real space basis, - q = xa + yb + zc = [ x y z ] ( a ) = x^T a , - - - - ( b ) - ( c ) or the reciprocal basis set basis, q = ha* + kb* + lc* = [ h k l ] ( a* ) = h^T a* , - - - - ( b* ) - ( c* ) where the real and reciprocal space components of q are related by - ( h ) ( x* ) ( x ) ( k ) = ( y* ) = G ( y ) ( l ) ( z* ) = ( z ) or ( x ) ( h* ) ( h ) ( y ) = ( k* ) = G* ( k ) . ( z ) ( l* ) = ( l ) Note, however, if xyz are unitless then x* y* z* are in A**2. Face Vectors ------------ Let a crystal be bounded by natural faces. Then the complete description of the geometry of a crystal bounded by n faces is given by specifying the Miller indices hkl and perpendicular distances d_hkl of the n faces from an absorption origin O_A on or within the crystal ____________ i hi ki li d_i (mm) / \ - -------- -------- / 001 \ 1 0 0 1 d_1 = 0 / . O_A \ 2 1 -1 0 d_2 = 0.123 mm \ | /| 3 h3 k3 l3 d_3 |\ | d_1-10 = 0.123 mm . \ \______|____ / / . \ |1-10 | / . \|__________|/ n hn kn ln d_n A face direction is defined by the unit vector u_hkl = d*_hkl/d*_hkl . - - Vertices of a Crystal --------------------- The vertices (corners) of a crystal are where three faces meet at a point. Vertex vectors are constructed as follows. The point where three faces intersect must fulfill the three equalities ____________ / \ v_ijk . u_i = d_i / u_i u_m \ - - .| \ / \ . v_ij \/________\ v_ijk . u_j = d_j .---------/\ v_mn/ - - . | / \ / .| u_j u_m / v_ijk . u_k = d_k \_____________/ - - Here, v_ij is a virtual vertex, and v_mn is a physical vertex. If we express V_ijk in terms of its real basis components V_ijk = [ a b c ] ( v_1 ) ( v_2 ) ( v_3 ) and U*_i, U*_j, U*_k in terms of their reciprocal space components U* = [ a* b* c* ] ( U_i1 ) , etc., ( U_i2 ) ( U_i3 ) then v_1 U_i1 + v_2 U_i2 + v_3 U_i3 = d_i v_1 U_j1 + v_2 U_j2 + v_3 U_j3 = d_j v_1 U_k1 + v_2 U_k2 + v_3 U_k3 = d_k in matrix notation ( U_i1 U_i2 U_i3 ) ( v_1 ) ( d_i ) ( U_j1 U_j2 U_j3 ) ( v_2 ) = ( d_j ) or U V = d ( U_k1 U_k2 U_k3 ) ( V_3 ) ( d_k ) = - - So ( v_1 ) = U^-1 ( d_i ) ( v_2 ) = ( d_j ) ( v_3 ) ( d_k ) where U^-1 represents the matrix inverse to U. = = Not all vertices generated in this manner are real, physical vertices. Consider the two-dimensional example of the virtual vertex vector V_mn formed by the virtual intersection of the m-th and n-th crystal planes. This vertex vector lies outside the physical boundaries of the crystal. So for a point to be a vertex it must also satisfy { V_ijk . U*_l .le. d_l , l = 1 to n planes } . The Transmission Factor A ------------------------- For monochromatic radiation passing parallel through a block of material the transmission factor A is given by A = I/I_0 = exp (-mu t) where I_0 is the intensity of the unattenuated beam, I the intensity of the attenuated beam, t the thickness of material, and mu the linear absorption coefficient. In order to calculate the transmission factor we must know either I/I_0 or mu t. Generally it is easier to estimate mu t. The Linear Absorption Coefficient mu ------------------------------------ The value of mu is calculated according to the mixing rules described in the International Tables for X-Ray Crystallography, Vol. II. Briefly, mu = rho sum_i f_i (mu/rho)_i , i = 1, 2,..., n , where rho is the mass density, f_i the mass fraction of the i-th element in the unit cell and (mu/rho)_i is the mass absorption coefficient of the i-th element. Values of (mu/rho) are taken from Vol. IV of the Int'l. Tables. The Path Length t ----------------- For a crystal mounted on a diffractometer the calculation of t, the total path length, is broken down into calculating t_I and t_D, the path lengths along the incident and diffracted beam directions, respectively. _________________ / t_I \ / .----------\ \ t_D / ----> / <---- Source \ / / -(s_I)/ \ / /s_D / \_/_v_________/ / t = t_i + t_D / v Note that t varies from point to point in Detector the crystal. Concentrating on one volume element at P we see that t_Dj = d_j - P.U*_j/(S_D.U*_J) where the volume element of interest is specified by vector P relative to the absorption origin OA, the diffracted beam direction is specified by the vector S_D, t_Dj is the distance from the point P to the j-th crystal face, d_j is the perpendicular distance to the j-th crystal face, and U*_j is the unit vector describing the direction of the perpendicular to the j-th face. A similar expression exists for t_I, the distance to the source t_Ij = d_j - P.U*_j/(S_I.U*_J) where S_I is the unit vector in the direction of the reverse primary beam. ------- Note that U*_j's are expressed in terms of their reciprocal basis components. It is advantageous to express P, S_D and S_I in terms of their real basis components. Also note that, for every point P in the crystal, we must test each face (1 to n) to calculate t_Ij and t_Dj (j = 1 to n). For a particular point P the face through which the beam penetrates is that one with t_I (.gt. 0) a minimum and the face of beam exit is that with t_D (.gt. 0) a minimum. For example, point P_1 is reached through face A and is exited through face B. Point P_2 is reached through face H and is exited through face C. Getting S_I and S_D in terms of their real space components ----------------------------------------------------------- A detailed description of the various coordinate frames of use on a diffractometer has been given by Busing and Levy (1967). To get the real space components of the unit vectors defining the directions of the reverse primary and diffracted beams, respectively, we need to know the observed angles for a particular reflection {2u,v,f,x} or {u,k,fk,vk} on the P3/F or CAD-4, respectively, the orientation matrix UB, and the diffractometer conventions. For the P3/F a reflection measured on the positive side of 2u has real space components Similarly Here G* has its usual meaning, UB^-1 is the inverse of the orientation matrix printed by the P3/F, and R^-1 is the inverse of the P3/F rotation matrix. For a reflection measured on the P3/F at angles {2u,v,f,x} we define R by its elements R11 = cos(v-u) cosf + sin(v-u) cosx sinf R12 = cos(v-u) sinf - sin(v-u) cosx cosf R13 = -sin(v-u) sinx R21 = sin(v-u) cosf - cos(v-u) cosx sinf R22 = sin(v-u) sinf + cos(v-u) cosx cosf R31 = sinx sinf R32 = -sinx cosf R33 = cosx For the CAD-4 a reflection measured on the positive side of 2u has components For a reflection measured at {u,k,fk,vk} RCAD = A B C D E where Note that both R_P3 and R_CAD are rotation matrices with the property R^-1 = R^T (inverse equals transpose); that is, R is unitary. For the CAD a = 49.96681 deg. Specifying the Sampling Points ------------------------------ We have seen that the path lengths t_I and t_D depend not only on the particular reflection under consideration (that is to say that S_I and S_D change from reflection to reflection depending on the diffractometer angles) but also that for any particular reflection t_I and t_D vary within the crystal. If we had, for example, a rectangular crystal such as at the left we might look at 6 points in the crystal for a sampling of the absorption, and since the 6 points were representative of equal volumes of the crystal each would have an equal weight in an averaging procedure. We would look at each point P_i in turn, calculate the vector P_i for the point, get t_D and t_I, and calculate the transmission factor for that point A_i = exp{-mu_x(t_D + t_I)_i} then the average transmission factor would be If, however, the six sampling points were not representative of equal crystal volumes, for various reasons, such as we see in this case below, then we would properly weight the absorption by the volume of the element where V_i was the volume of the i-th block. In the limit of sampling an infinite number of points, each with volume dv Since we cannot hope to sample much more than 4K points in a crystal per reflection we retreat to where We now have to consider ways of sampling the crystal volume. The isometric grid, illustrated above, presents some difficulties. First, we can see that sometimes a grid point can lie just outside the crystal and therefore is not a valid sampling point. Second, it is difficult to design an isometric grid which samples close to, but always inside, the surface of the crystal. The Gaussian technique answers both objections. A full explanation of the layout of the Gaussian grid is beyond the scope of this technical report; a description of the one-dimensional Gaussian integration technique is given by Whittaker & Robinson (1967). Appendix B. Capillary Correction --------------------------------- If the crystal is encapsulated in a thin-walled glass capillary severe, asymmetric absorption effects can be seen to arise from the capillary alone. In order to correct for the capillary absorption, its orientation relative to the phi axis and position relative to the crystal must be known. The program will, as an option, make corrections for three types of capillary glass (Pyrex, fused quartz, Lindemann) and three wavelengths (Ag, Mo, Cu). The values of mu_CAP used are given in the table. mu_CAP (in mm^-1) Glass Lindemann 0.094 0.161 1.483 Pyrex-7740 0.368 0.717 7.105 Fused Quartz 0.411 0.807 8.021 Most capillaries have a nominal wall thickness of 0.0l mm and radii of 0.3, 0.4 and 0.5 mm are typical. The technique for the capillary correction has been briefly described by Wells (1960). In order to use it in complete generality we here define a coordinate frame fixed in the standard Huber goniometer head with arcs. Place the goniometer head on a table with a wall directly behind it. Rotate the goniometer head until the notch in the base faces to the right as you look towards the wall (i.e., if the direction of view towards the wall is north place the notch to the east). The top arc is now perpendicular to your point of view, and the scribe marks can be read. If the capillary is inclined with its top to the left and base to the right it is inclined with angle sigma positive. Turn the goniometer so that the notch faces you. The bottom arc can be read. If the capillary appears to be inclined top left/bottom right again it is inclined with angle tau positive. If the capillary is mounted rigidly in the brass pin with its axis parallel to the pin axis sigma and tau can be read directly from the arcs of the goniometer head. If the capillary is tilted with respect to the pin it is better to disregard the arc readings and determine sigma and tau by a simple experiment. Orient the notch to the right again. Shine a parallel source of light (AO microscope light) on to the capillary and observe the shadow of the capillary on the wall. Put dots on the wall (pencil) to record the shadow. Place a T square on the table and draw a line vertical (perpendicular to the table top) through the dots. The angle sigma can be read with a protractor. Similarly tau can be measured. The values of sigma and tau so obtained are usually +10 to -10 degrees and with care can be read to plus-or-minus 0.5 degrees. The positive directions for both angles holds for the use of the goniometer head on either the CAD-4 or P3/F. To determine the displacement of the crystal from the capillary axis we make the assumption that either the center-of-mass of the crystal is at the diffractometer center or is displaced a known amount. The former is obviously preferable and we treat it here. For the P3/F we assume the telescope has been aligned so that the cross- hairs point at the instrument center and the grid markings are horizontal in the field of view. Set chi = 335 degrees so that the phi axis is perpendicular to the telescope axis. We define the capillary displacement vector K by its components in the diffractometer phi coordinate frame. The sense of K is that it is from the diffractometer origin to the capillary axis. The phi base vectors are oriented as shown below at the 4 values of phi which bring the arcs parallel and perpendicular to the telescope axis. Each small hash mark on the P3/F telescope corresponds to 0.06 mm. An example of a capillary displaced +0.15 mm in X is shown below This can be read by averaging the hash mark values of the outer diameter of the capillary intersecting the horizontal axis. Better technique suggests averaging the results at phi = 25 and phi = 205; phi = 115 and phi = 295 deg. For the CAD-4 similar arguments hold. At kappa = 134.89 deg the phi_kappa axis is perpendicular to the telescope axis. Each division on the telescope is 0.02 mm. The phi axial system corresponding to arcs parallel and perpendicular to the telescope axis is shown below Appendix C. File Structure and Program Limitations --------------------------------------------------- Data Files Input is normally the output of a scaling program such as SCALE3. Output file has the same form as the input file. Both files are unformatted binary. Control File - ABSORB.DAT Created and edited by program ABSORB1, program ABSORB2 employs it as its only data control input program file. ABSORB.DAT is a formatted file which is read by subroutine PAGE1 and written by subroutine PAGE2. See them for further details. Limitations ----------- Number of Crystal Bounding Faces: 50 Number of Vertices: 150 Number of Gaussian Grid Points: 4096 Grid Divisions Permissible 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96 Constants The molecular weight is calculated from atomic weights of the Sargent- Welch Periodic Table of the Elements (1968) except for Li. The mass absorption coefficients (mu/rho) for six wavelengths (Ag, Mo, Cu) x (alpha-bar, beta) are from the Int'l. Tables Vol. IV. The composition of glasses and densities are from Shand (1958). The Gaussian weights and fractions are from Abramowitz & Stegun (1972) and are those compiled by P.J. Davis and I. Polonsky. See page 887, eq. 25.4.29 and Table 25.4 (pgs. 916-919). The limits of the integration have been changed from {-1 to +1} to {0 to 1}, see Whittaker & Robinson (1967). Source Code: Available from author. Bibliography ------------ Alcock, N. (1974). "Absorption and Extinction Corrections: Calculation Methods and Standard Tests", Acta Cryst. A30, 332-335. Busing, W.R. and Levy, H.A. (1957). "High-Speed Computation of the Absorption Correction for Single Crystal Diffraction Measurements", Acta Cryst. 10, 180-182. Busing, W.R. and Levy, H.A. (1967). "Angle Calculations for 3- and 4-Circle X-Ray and Neutron Diffractometers", Acta Cryst. 22, 457-464. Coppens, P. (1970). In "Crystallographic Computing", F.R. Ahmed, Ed., Munksgaard, Copenhagen. Davis, P.J. and Polonsky, I. (1972) in "Handbook of Mathematical Functions", M. Abramowitz and I.A. Stegun, Eds., Dover Press, NY. Flack, H.D., Vincent, M.G. and Alcock, N.W. (1980). "Absorption and Extinction Corrections: Standard Tests", Acta Cryst. A36, 682-686. Shand, E.B. (1958). "Glass Engineering Handbook", Chapter 1, McGraw-Hill Co., NY. Wells, M. (1960). "Computation of Absorption Corrections on EDSAC II", Acta Cryst. 13, 722-726. Whittaker, E. and Robinson, G. (1967), "The Calculus of Observations", Dover Publications, Inc., NY.