Data Processing A suite of programs for calculating x-ray absorption, reflection, and diffraction performance for a variety of materials at arbitrary wavelengths S. Btennan Stanford Synchrotron Radiation Laboratory, Stanford, California 94309 P. L. Cowana) National Institute of Standards and Technology, Gaithersburg, Maryland 20899 (Presented on 16 July 1991) One of the most useful characteristics of synchrotron radiation is the wide spectral distribution of the source. For applications involving tuned monochromatic beams it is often helpful to predict the x-ray optical characteristics of a sample or the beam line optics at a particular wavelength. In contrast to this desire stands the fact that tabulated values for the optical parameters of interest are generally available only at wavelengths corresponding to typical x-ray tube sources. We have developed a suite of FORTRAN programs which calculate photoabsorption cross sections and atomic scattering factors for materials of arbitrary, uniform composition or for arbitrary layered materials. Further, the suite includes programs for calculation of x-ray diffraction or reflection from such materials. These programs are of use for experimental planning, data analysis, and predictions of performance of beam line optical elements. I. INTRODUCTlON The imaginary anomalous dispersion termy is related to the total photoelectric absorption cross section via the One of the advantages of doing experiments at a syn- optical theorem. To find the total attenuation cross section chrotron radiation facility is that one can choose the x-ray one must sum the photoelectric, Compton, and Rayleigh wavelength for an experiment and the choice in many cases cross sections. The energy dependence of the latter two is critical to the success of the experiment. Much of the have been parametrized by McMasters et a1.4 vast prior work on x-ray optics calculating such things as We have created three data bases for the VMS operat- reflectivity and total integrated power are based on using ing system. One data file stores both the Cromer and Liber- characteristic lines from conventional radiation sources. In man p and 7 values, as well as the absorption edge ener- considering how to monochromatize the incident beam gies and atomic weights and densities. The second contains with the best combination of flux and resolution for an the parametrized Compton and Rayleigh cross sections. arbitrary wavelength the ability to calculate crystal perfor- The third data base is the parametrization of the atomic mance at that wavelength is crucial. As a result we have scattering factor vs scattering angle and wavelength. The combined a variety of existing data bases, a suite of sub- data bases are accessible through a set of subroutine calls routines for extracting parameters from them, and a set of which follow the VMS calling standard. These calls have programs for calculating such things as the crystal struc- been packaged in a shareable image library. The advantage ture factors for an arbitrary crystal at an arbitrary wave- of a shareable image library is that one need not explicitly length. In this paper we describe the data bases, the sub- link to routines in such a library, just as one does not routine calls which access these data, and a set of higher explicitly link to the FORTRAN intrinsic routine library. level routines and programs which we have developed. Table I shows the subroutines available. The atomic scat- The atomic scattering factor is wavelength and scatter- ing angle dependent. For x rays scattered in the forward direction the corrections to the form factor are TABLE I. Basic subroutine calls for absorption package. f = f. + f' + if", where f is the real and f' is the imagi- Name Input parameters Output parameters nary term. These terms are known as the anomalous dis- persion corrections or sometimes the H&l terms. For cal- ABSKROMER Z, Energy JJ" (in electron units) ABS$ATOMIC-DATA 2 Atomic weight, density culating f and f' we use the data of Cromer and absorption edge energies Liberman' which follows upon earlier work by the same ABS$RAYCOMP Z, Energy Rayleigh, Compton cross authors.2*3 section (in electron units) ABS$ELEMENT Element symbol Z ABS%MASS-ABS Z, Energy MU/RHO, density `)Present address: Physics Division, Argonne National Laboratory, Ar- ABS$SFCOEF 2, k [4rsin(@)//2] f(k), compton (k) gonne IL. 850 Rev. Sci. Instrum. 63 (I), January 1992 0034.6748/92/010850-04$02.00 @ 1992 American Institute of Physics 850 Downloaded 02 Jan 2003 to 148.6.178.13. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/rsio/rsicr.jsp TABLE II. Programs based directly on absorption package. TABLE III. Programs based on structure factor calculations. Name Description Name Description TREF Calculate Reflectivity, Penetration Depth, Field**2 STF Calculate structure factors for an arbitrary crystal. as f (incidence angle) for arbitrary material. POWDER Generate powder pattern delta functions for arbitrary EREF Calculate reflectivity vs energy for a single element. crystal. MLT Calculate superlattice reflectivity vs angle. XDF Calculate x-ray rocking curves for a dynamically scattering crystal. XDSCAN Calculate scattering vs energy for dynamically scattering crystal. tering factor dependence on scattering angle and wave- length has been calculated by Cromer and Mann.5 There is III. CRYSTAL SCATTERING FACTORS also a angle and wavelength dependence to the Compton cross section, which has been parametrized by Balyuzi6 Perhaps the most significant capability these data bases There is a separate data base for those parameters and the enable is to calculate the crystal structure factor for an subroutines which access them are also included in the arbitrary set of miller indices at an arbitrary energy. The shareable image library. general formula for calculating crystal structure factors At its simplest, what these data bases achieve is the from the atomic positions for an arbitrary unit cell can be ability to calculate an absorption length for an arbitrary found in most standard texts on crystallography or x-ray material at an arbitrary wavelength between roughly 100 diffraction8 We have developed a standardized data file for eV and 1 MeV. If one is interested in the atomic scattering crystal lattices which defines the unit cell and the number, factors of crystals then the other components of the data type, and position of the atoms within the unit cell. We bases become important. The entire package, built as an have found it useful to include other parameters character- installation kit, consists of the data bases, the shareable istic of a given crystal such as it elastic moduli and average image library, a program which is installed as a command coefficient of thermal expansion. The effect of thermal vi- similar to COPY or DIRECTORY for calculating absorption, brations of the atoms in the lattice is treated by including and a help library which describes the program and how to a Debye temperature. Dynamical diffraction theory is ger- access the data bases using the subroutines. The program, mane to the case of perfect crystal monochromators, pola- called ABSORPTION, calculates the transmitted intensity for rimeters, and spectrometers which are often the ideal a given thickness of material and lists the absorption length choice of optical elements for synchrotron radiation beam for the specified energy. It also lists the K and L edge lines. A main calling program, STF, has been written to energies (unless they do not exist). There is an extensive permit interactive calculation of the complex structure fac- help library which is installed with the VMS command and tors and other parameters related to x-ray reflection and which describes the specifics of the calling sequence. The diffraction. The CHIs are the Fourier coefficients of the driver program for the ABSORPTION package is also in- susceptibility' which are related to the structure factor. STF cluded in the installation kit as an example of how to use is for use with other programs requiring manual input of the routines. It should be made clear that close to an ab- the crystal structure factors, etc. sorption edge the calculated and parametrized values will be inaccurate. Any variation in absorption due to crystal IV. PROGRAMS BASED ON STF structure effects will not be present in the calculated val- Several main FORTRAN programs have been written to ues. use the crystal structure factors directly from the subrou- tines. Three of these are discussed here, namely POWDER for calculating powder diffraction patterns, XDF which cal- II. PROGRAMS BASED ON f' AND P culates perfect crystal Darwin-Prins curves and derives parameters descriptive of the diffraction performance of a A number of programs have been developed which particular crystal reflection, and XDSCAN which tabulated take advantage of the subroutine calls described here. All these same parameters as a function of photon energy. the programs described below are written in FORTRAN. POWDER calculates the intensity of all the allowed reflec- The simplest of these, TREF, involves calculating the reflec- tions for a crystal given an incident photon energy. Multi- tivity, penetration depth, and electric field intensity as a plicities are summed (and noted in the data file). XDF function of angle of incidence for an arbitrary material. calculates the single crystal Darwin-Prins curve using a This program is quite useful for research in grazing inci- modified set of equations taken from a paper by Bonse and dence x-ray scattering as it predicts the critical angle for Graeff."." The user has the option of performing the cal- total external reflection as well. The reflectivity as a func- culation for linearly polarized x rays, either s or p, or for tion of energy, EREF, can also be calculated (Tables II- unpolarized x rays. In addition to selecting the crystal and IV). This program is quite handy for determining synchro- Miller planes of interest, the crystal temperature, asymme- tron radiation mirror characteristics. The subroutines are try, and thickness are also variables. Both Bragg and Laue also used for a program, MLT, to calculate multilayer re- cases of diffraction are treatable, although XDF does not flectivities based on a paper by Bartels et al.' include multibeam cases nor cases involving grazing an- 851 Rev. Sci. Instrum., Vol. 83, No. 1, January 1992 Synchrotron radiation 851 Downloaded 02 Jan 2003 to 148.6.178.13. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/rsio/rsicr.jsp TABLE IV. Crystal data file. This is a complicated crystal with a noncubic structure, with three bases but only one atom per basis. For each basis the atomic number of the atom and the fraction of that atom present is used, followed by the number of positions in that basis and the coordinates of each position. LiNbOs 5.14739 5.14739 13.85614 90.00 90.00 120.00 293.00 5. 3 10.000 5.000 2.500 Iimaginary isotropic matl. 3 1 1 1 Atoms in basis # 1 !Ref: Abrahams Acta Cryst. B42 p. 61 (`86) (T-debye unk.) 3 1.00 6 O.OOOOO, 0.00000, 0.27872 ILi (6a3) O,O,z = 0.27872 o.ocooo, o.ooooO, 0.71872 ! 0.0,~ + l/2 = 0.77872 0.66667, 0.33333, 0.61205 1 2/3,1/3,z + l/3 = 0.61205 0.66667, 0.33333, 1.11205 1 Z-I- 5/6= 1.11205 0.33333, 0.66667, 0.94539 1 z + 2/3 = 0.94539 0.33333, 0.66667, 1.44539 I z + 7/6 = 1.44539 Atoms in basis #2 41 1.00 6 o.ooooO, 0.00000, O.OOOOO !Nb (6a3) z = 0.0 omooo, o.ooooO, 0.5OoOo ! z+ l/2 0.66667, 0.33333, 0.33333 1 a+ l/3 0.66667, 0.33333, 0.83333 ! 2+5/6 0.33333, 0.66667, 0.66667 ! z + 2/3 0,33333, 0.66667, 1.16667 ! z-!-7/6 Atoms in basis #3 8 1.00 18 0.04757, 0.34328, 0.06336 !O( 18bl) x = 0.04757, y = 0.34328, z = 0.06336 - 0.34328, - 0.29571, 0.06336 ! - YJ - XZ 0.29571, - 0.04757, 0.06336 ! - x -I- y, - w - 0.34328, - 0.04757, 0.56336 ! -y,-x,2+ l/2 0.2957 1, 0.34328, 0.56336 I - x + Y&Z + LQ 0.04757, - 0.29571, 0.56336 1 x,x - y,z + l/2 0.7 1424, 0.67661, 0.39669 ! x,y,z + 2/3,1/3,1/3 0.32339, 0.03762, 0.39669 1 - y,x - y,z + 2/3,1/3,1/3 0.96238, 0.28576, 0.39669 ! - x -I-Y, - x,z + 2/3,1/3,1/3 0.32339, 0.28576, 0.89669 ! - y, - x,z -k l/2 + 2/3,1/3,1/3 0.96238, 0.67661, 0.89669 ! - x + y,y,z + l/2 + 2/3,1/3,1/3 0.7 1424, 0.03762, 0.89669 ! x,x - y,z f l/2 + 2/3,1/3,1/3 0.38090, 1.00995, 0.73003 ! x,y,z f l/3,2/3,2/3 - 0.00995, 0.37096, 0.73003 1 - y,x - y,z + l/3,2/3,2/3 0.62904, 0.61910, 0.73003 ! - x + y, - x,z f l/3,2/3,2/3 - 0.00995, 0.61910, 1.23003 ! - y, - x,z f l/2 + l/3,2/3,2/3 0.62904, 1.00995, 1.23003 ! - x + y,y,z -I- l/2 + l/3,2/3,2/3 0.38090, 0.37096, 1.23003 I x,x - y,z + l/2 + l/3,2/3,2/3 gles. After calculating the Darwin-Prins curve for the re- for some time. The applications for which calculations flection, the XDF program uses the curve to extract a num- have been performed ranges from studies of novel mono- ber of useful diffraction parameters. These include the chromator crystals to determining index of refraction cor- angle and energy integrated reflectivities,12 Darwin-Prins rections for high precision x-ray spectroscopy. The authors angular width, energy resolving power, and the index of are willing to provide the ABSORPTION package as an in- refraction shift of the Bragg angle. The polarization selec- stallation package for VAX computers running the VMS tivity, defined as the ratios of the integrated reflectivity for operating system. Other codes based on that package are the two linear polarizations can also be found. XDSCAN is available upon request. Comments on possible improve- based on the XDF program. Its purpose is to produce the ments or bugs are invited. A number of related programs photon energy variation of the diffraction parameters. This with other capabilities which have been adapted to the is particularly useful in testing the spectral performance of basic subroutines will be described elsewhere. I4 crystals for use as monochromators, spectrometers, or polarizers. l3 ACKNOWLEDGMENTS V. CONCLUSIONS Part of this work was done at the Stanford Synchro- The subroutines and programs described above have tron Radiation Laboratory, which is supported by the U.S. been in use at SSRL, NIST, ESRF, and other institutions Department of Energy (DOE), Division of Chemical Sci- 852 Rev. Sci. Instrum., Vol. 63, No. 1, January 1992 Synchrotron radiation 852 Downloaded 02 Jan 2003 to 148.6.178.13. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/rsio/rsicr.jsp ences. Support for one of us (S. B.) was provided by the 6H. M. Balyuzi, Acta Crystallogr. Sect. A 31, 600 (1975). DOE, Office of Basic Energy Sciences. `W. J. Bartels, J. Hornstra, and D. J. W. Lobeek, Acta Crystallogr. Sect. A 42, 539 (1986). *B. E. Warren, X-ray D@action (Addison-Wesley, Reading, MA, `D. T. Cromer and D. A. Liberman, Acta Crystallogr. Sect. A 37, 267 1969). (Now available in a Dover paperback edition.) ( 1981). The original data and calling routine for calculatingP and r 9 2. G. Pinsker, Dynamical Scattering of X Rays in Crystals (Springer, was obtained from D. T. Cromer by P. H. Fuoss as a stack of punch cards. In 1987, during a visit to Hasylab by the authors, the program Berlin, 1978). was converted to F77 and direct access data base format. It has been "U Bonse and W. Graeff, in X-ray Optics, edited by H. J. Queisser upgraded extensively since then. (Springer, Berlin, 1977). `D. T. Cromer, Acta Crystallogr. 18, 17 (1965). "0 Briimmer, H. R. H&he, and J. Nieber, Phys. Status Solidi A 37, 529 `D. T. Cromer and D. Liberman, J. Chem. Phys. 53, 1891 (1970). ( 1976). `W. H. McMaster, N. Kerr Del Grande, J. H. Mallet& and J. H. Hub- `*A discussion of the definitions and applications of angle integrated re- bell, UCRL-50174 SEC II REV I, available from National Technical flectivity and energy integrated reflectivity will be published elsewhere. Information Service, U. S. Dept. of Commerce. "S. Brennan, P. L. Cowan, R. D. Deslattes, A. Henins, D. W. Lindle, `D. T. Cromer and J. B. Mann, Acta Crystallogr. Sect. A 24, 321 and B. A. Karlin, Rev. Sci. Instrum. 60, 2243 ( 1989). (1968). 14P. L. Cowan and S. Brennan (in preparation). 853 Rev. Sci. Instrum., Vol. 83, No. 1, January 1992 Synchrotron radiation 853 Downloaded 02 Jan 2003 to 148.6.178.13. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/rsio/rsicr.jsp