D I F P A T A N Version 1.5 March 1996 Program for X-ray diffraction powder pattern analysis, peak decomposition, pattern combination and comparison. Author : R.Kuzel Jr. (Several routines were written by D.Rafaja) Address : Faculty of Mathematics and Physics Charles University Ke Karlovu 5 121 16 Prague 2 Czech Republic E-mail : kuzel@karlov.mff.cuni.cz WWW page : krystal.karlov.mff.cuni.cz/priv/kuzel/difp CONTENTS Introduction. Hardware requirements. Files on distribution disk. Calling conventions. Licence agreement 1. About the program 2. Program input. Loading files. File types. 2.1 Files. 2.2 Loading a file. 2.3 File types. 2.4 Current file. 2.5 File parameters. 3. Determination of profile parameters. 4. Graphics 4.1 Main graphical menu. 4.2 Graphical utilities. 4.2.1 Graphic cursor mode. 4.2.2 Shortcut keys for graphics. 4.3 Drawing the pattern. 4.4 Corrections. 4.4.1 Background. 4.4.2 Smoothing. 4.4.3 Data correction. 4.4.4 Alpha 2 stripping. 4.4.5 Intensities. 4.4.6 Lorentz correction. 4.5 Peak search (Labels submenu). 4.5.1 Search peak submenu. 4.6 Modifications of the peak set in current pattern. 4.7 Indexing of peaks. 4.8 Phases. 4.9 Showing and changing profile parameters. 4.9.1 Submenu Parameters (Graphics). 4.9.2 Submenu Peaks of the menu Parameters. 4.9.3 Submenu Show parameters. 5. More files in the memory. 5.1 Submenu Files (Graphics). 5.1.1 Combination of the patterns. 6. Profile fitting. 6.1 Submenu Global parameters. 6.2 Modification of starting profile parameters. 6.3 Analytical functions. 6.4 Corrections. 6.5 Drawing the fitting curve. 7. Output. 7.1 Saving the data on disk. 7.2 Output of profile parameters. 7.2.1 Printing and saving. Submenu Write. 7.2.2 Plotting the data. Submenu Plot. 8. Environment. 8.1 Change of default directories. 8.2 Change of default instrumental parameters. 8.3 Other menu. 9. Advanced features. Colors. Symbols. Configuration 9.1 Configuration file CONFIG.PRF. 9.2 Colors and symbols. 9.3 Alpha 2 elimination. 10. Bugs. Hardware and software requirements: Computers : PC/AT compatible, MS-DOS CGA, EGA, VGA, Hercules graphic cards Math coprocessors - optional Memory : 640 kbytes Peripheries directly supported : EPSON printers Hewlett-Packard plotters or HP laser printers (HP-GL language) Files on distribution disks or in ZIP file: Files : DIFPATAN.EXE x main program DFHelp.HLP help file CONFIG.PRF configuration file ALPHA2.PRF histograms for alpha2 separation COLORS.PRF colors for main menu SCREEN.PRF specification of graphic windows CGA.PRF * EGA.PRF * VGA.PRF * HERCMONO.PRF * (* can be copied into SCREEN.PRF ) CGA.BGI should not be neccessary in ver. 1.5 EGAVGA.BGI should not be neccessary in ver. 1.5 HERC.BGI should not be neccessary in ver. 1.5 LITT.CHR should not be neccessary in ver. 1.5 Possible examples of .DAT, .BAR, .RIE, .GRF, .PRN, .FIT files. It is strongly recommended to keep all these files in one directory, which must also be the current one at the start of the program. Backup of configuration files is recommended. Calling conventions : DIFPATAN parameter 1 parameter 2 parameter 1 - version number (1-5) [default 3] = number of full diffraction patterns which can be kept in the memory simultaneously. Amount of free memory can be find in item VERSION of the Main menu. Remaining number (to 5) can be used for BAR files (angles, intensitites) parameter 2 - full name (including a path) for the configuration file [def. CONFIG.PRF] Examples: Difpatan Difpatan 4 Difpatan 1 c:\users\me\myconfig.prf d: LICENCE The author of this program accepts no responsibility for damages resulting from its use and makes no warranty or representation, either express or implied, including but not limited to, any implied warranty of merchantability or fitness for a particular purpose. This software is provided "AS IS", and you, its user, assume all risks when using it. The program and accompanying files are copyright material. The program can be distributed freely provided that no part of the package is removed including this file. The distributor is not allowed to make any profit from the distribution of this package. Difpatan package cannot be a part of commercial packages without explicit permission of the author. The program should be cited in approapriate places, if it is succesfully applied. -------------------------------------------------------------- Help : The Help for the program DIFPATAN is invoked from chosen menu by pressing ? (help for corresponding topic is shown), you can select from an index of help topics by pressing , and you can page backward through a list of previously selected topics by pressing . The text for a given topic may also contain links to other topics, which can be selected by moving the cursor to the appropriate word or phrase and pressing . 1. About the program Program DIFPATAN has been written for the evaluation of XRDP profile parameters either by direct analysis or by profile fitting. Direct profile analysis consists in direct determination of profile parameters usually after the subtraction of background and Ka elimination. The profile fitting approximates diffraction peaks by analytical functions. The program includes intensity corrections for different geometries : - conventional Bragg-Brentano in symmetrical theta-2theta geometry - asymmetrical geometry used for stress measurement (the so-called W- goniometer ) - asymmetrical geometry used for stress and texture measurement (the so-called j- goniometer or side inclination method) - thin film Seemann-Bohlin geometry with the constant angle of incidence - transmission Seemann-Bohlin geometry The program also includes the correction for the polarization of synchrotron radiation. The corrections can be performed either before or after the fitting. The program runs in text and graphic modes. Main menu (in text mode) consists of the following parts : Files Graphics Environment Output Fitting and Quit. Select items by . Back to the top submenu by . 2. Program input. Loading the files. File types. Experimental patterns are loded from files , they can be plotted by graphics , where the profile parameters can be determined. In case of overlapped peaks the fitting of profiles is necessary. 2.1 Files. Up to 5 files can be loaded into the memory. The first one is considered as a main file and it is strongly recommended for the use of profile analysis. The others are provided mainly for comparison, although most of operations can also be applied to them. The following file types can be used : DAT, SIM, RIE, BAR (see chapter 2.3 ). The first n files can be of the DAT, SIM or RIE type and all can be of BAR type. The number n depends on the Version of the program. Each file contains X-ray diffraction pattern and is related to file parameters. Data files can be loaded by load file or saved by save file. 2.2 Loading file (submenu) Read data file reads the data file of the type given by Extension into the current file (pattern). The following file types are only allowed : DAT, SIM, RIE, BAR. Up to 5 files can be in the memory simultaneously. The name file is given by Filename and the path by Pathname including the drive and last backslash. Different data fields can be loaded. The standard formats are described in File types section. Some other formats can be defined in configuration file. In most cases pure filename without path and extension should be given (except the Save file ). The extension is specified separately and determines the File type. Pathnames are attached to the different file types for all I/O operations according to the information in configuration file at the start of the program. They can be changed by Directories and they are used for example as default values for Pathname. When the wildcard * is contained in the filename then the list of the files in path name matching the mask is provided and file can be picked up by menu bar and . When the wildcard * is included in path name, the directory pick up list is shown first. Change the directory by , select directory for reading files by . List files is much the same as Read data file but the selected files are not read immediately, the filename is changed only and the file can be read subsequently. The item is provided mainly for listing of files which cannot be read by DIFPATAN (as .PAS,.EXE, .TXT ...). 2.3 File types. Types of files are distinguished by extensions and can be separated into two groups (the standard formats of which are described below): Input files : .DAT data files with the following format (ASCII): line 1 : name of sample (string) line 2 : note (string) line 3 : starting angle line 4 : last angle line 5 : step line 6 : time line 7 : intensity of the 1st point line 8 : - " - 2nd . . last line : - " - last point .SIM calculated pattern in the same format as above (the format can be changed in the formatting line, see chapter (9.1) .RIE data from the Rietveld program in the format : line 1 : name of sample (string) line 2 : note line 3 : not used data in columns X Y(exp) Y(calc) Difference .BAR file containing only peak positions and intensities in the format : line 1 : name of sample (string) line 2 : note (string) line 3 : number of peaks line 4 : h k l position intensity of peak 1 . . . . . . line 5 : . . . . . of the last peak Output files : .GRF output file in the format suitable for graphical or some spreadsheet programs columns: angle intensity calculated intensity .PLT output file for HP 7574A plotter in HP-GL language (latest graph from Graphics ) .PRN list of profile parameters of the peaks of the current phase in the current file . The parameters are specified by Listed parameters in Output . .FIT like .PRN, but with the parameters of fitted function .PCX graphs in PCX format 2.4 Current file Most of operations are carried out with this file (input and output, graphics, fitting, ...) i.e. the current diffraction pattern . There are 5 files in memory. The first one is considered as a main file and is recommended for the use of the profile analysis. The others are provided mainly for comparison. Most of operations can also be applied to them, though. The current file can be selected (changed) either from the menu Files and Current File Select (where the list of files is also shown) or from the main menu of Graphics by (n is the number of a file). The number and corresponding file- and sample names of the current pattern are shown in the bottom window of the Main menu and top window of Graphics, respectively. For the data evaluation the first (main) file is recommended. 2.5 File parameters File parameters can be find by selecting the same item from Load file submenu. A table is shown containing basic parameters of the files loaded. Default parameters are only shown for remaining files (5 in total). They are loaded from the Configuration files. The following part of the parameters can be modified by users: Sample name and Note are usually shown as headings in graphs and printings. In the table only the first 8 characters are shown. Color for graphics can be changed by pressing any key (the color number is increased by 1 after each selection, see chapter 9.2) Symbol for plotting of the data can be changed (9.2). Line Type for plotting of the data can be changed (9.2). Minimum and maximum of 2 theta . The values are loaded from the data file and they are used for the Reset limits in Graphics. Maximum of intensity is found just after the loading of the data and is used for the Reset limits in Graphics . Status Active - if TRUE then the diffraction pattern of the corresponding file is shown in Graphics (4). File type can be changed sometimes. It could be useful to change for example the DAT file into the BAR file in order to obtain lines denoting the position and height of the peaks in Graphics. In a similar way a BAR file can be changed into DAT and then the pattern can be calculated with View Pearson in Graphics. Step can be changed for pattern calculation. In other cases this can lead to the deformation of experimental data. Xshift- by this value the current pattern is shifted (for the plot only). Yfact- by this value the current pattern is multiplied (for the plot only). Other parameters are shown only for information : number of points in file and number of reflections in pattern (determined in Graphics ) 3. Determination of profile parameters. Each X-ray powder diffraction pattern contains a number of peaks the profile parameters of which are to be determined either by direct analysis or by fitting. Profile parameters : Height - given in cps Position - given in 2 q units FWHM - full width at half of maximum (halfwidth) either in 2 q (deg) or in reciprocal units (1/d), optionally in Output. Integrated intensity - given in 2 q units Integral breadth - integrated intensity divided by the peak height either 2 q (deg) or in reciprocal units (1/d), optionally in Output. Center of gravity - given in 2 q units Shape parameters - connected here to the exponent of the Pearson function describing the profile ( default value) or corresponding function. 4. Graphics Graphical screen is divided into several windows. The files with the status of ACTIVE set to 'true' are shown in current limits and in corresponding colors. Diffraction pattern (experimental or calculated) can contain about 1000-10000 points in maximum depending on Version and memory available. In Graphics diffraction peaks can be found or defined. Up to 60 peaks are allowed. They can be indexed and also prescribed to different Phases (up to 10), which are distinguished by numbers. Names can also be given to them by Phases in the Main menu. The angle and intensity limits given in Graphics are the current limits for all operations of program (e.g. fitting). There are several windows in graphical mode : Central graphic window ...... Plot of the data Bottom text window ...... Menu Top text window ...... Help line (in most cases) A short help for the current menu item in the bottom window. It shows the help for either the operation or submenu selected. Information and/or input line. 2nd top text window ...... Information line (e.g.current file) 3rd top window ...... Display of peak parameters 4.1 Main graphical menu Main menu consists of the following items : Draw Y-scale X-scale Reset limits Labels Files Parameters Corrections In the menu short-cut keys can be used for change of colors, labels, markers, X-scale etc . Everywhere the is used for selection and for change to top submenu. The items can also be selected by the first letter. This is the fastest way of work (e.g. by double pressed L you can introduced reflection labels). TAB is used for the introduction of graphic cursor. HARDCOPY can be invoked by PrtScr 4.2 Graphical utilities The change of scale can be done directly from the main menu or in Graphic cursor mode. Y-scale : Change of maximum for the plotting of diffraction patterns. Submenu: GCS - graphical selection of maximum (see next section) Increase - increase of maximum by factor 2 Decrease - decrease - " - Reset limits - maximum is set to its original value for the Current file (see File parameters). Ticks - after selection number of Y-axis ticks is given Maximum - numerical input of new maximum Change to log - change to logarithmic scale (toggle) Sqrt scale - change to square root scale (toggle) Plot type - marker (solid line) selection Y-grid - Y axis grid (toggle) X-scale : Submenu: Change of minimum and maximum of 2 theta values for the plotting of diffraction patterns. GCS - graphical selection (Graphic cursor mode ) Increase - range is enlarged by a definite factor Decrease - range is decreased Ticks - after selection number of Y-axis ticks is given Limits - numerical input of left and right limits Scale(d-2theta) - d- 2 theta toggle Reset limits - limits are initiated to their original values for the Current file (see File parameters) X-grid - X axis grid (toggle) Reset limits X and Y limits for the plotting of diffraction patterns are initiated to their original values. The values are shown and can be changed in File parameters (main menu - files). ATTENTION ! If you change starting value there, the pattern is shifted by the same value. The data can be graphically corrected in submenu Data correction of the menu Corrections. 4.2.1 Graphic Cursor Mode Graphic cursor is introduced from the Main graphic menu by pressing . In some procedures it is introduced automatically for graphic input. There are two types of graphic cursor : x-y cross (default) and independent X and Y lines. By pressing in GCS mode it is possible to switch from one to another. They are moved by the direction keys. ... accept the position of the graphic cursor (for graphical input) ... quit from GCS In the top window the current values of angles and intensities are shown. Cursor motion : velocity - numbers 1-9 (1 default) determines the step in data points (9 is the fastest motion) + ........ speed up 4x - ........ slow down 4x - cursor to the left - cursor to the right - cursor to the top - cursor to the bottom menu for the change of marker for the current file Size and shifts of the graph : (Zoom) - enlargement of the graph around the current position of the cursor The movable box appears on the screen. Shift it by cursor keys. locks the lower left corner > unlocks the lower left corner If you try to shift the box outside of any border, its size is decreased in corresponding direction. (Reset) - reset limits (see 43 Reset limits ) > - shift of the graphic window on the diffraction pattern to right (new limits : Left = Right[old], Right = Left + (Right[old] - Left[old])) - shift of the graphic window to the left (see above) - - " - upwards - " - - - " - downwards - " - Graphics peak selection (GPS) mode The procedure is similar to GCS with the following exceptions. There is only vertical line cursor moving by left and right direction keys from one peak to another with a constant velocity. The peaks should be found before the switching to the mode.Each peak can be deleted from the set by pressing key. For the current peak the basic Profile parameters are shown in the top window : peak height, position, halfwidth and exponent of the Pearson function (see 4.9.2). 4.2.2 Shortcut keys for graphics. In the main graphics menu shortcut keys can be used with the following meaning. Change current pattern color Change background color Plot last fitted pattern (toggle) Plot K profiles Change current pattern to n Show labels Peak markers toggle Plot residua after the fitting (toggle) Change marker Scale toggle (2 theta <-> non-equidistant d lattice spacings) Fine plot of calculated profile - toggle ON/OFF (after fitting) Saving the PCX file. It must be initiated from the main menu. 4.3 Drawing the pattern. Draw - Plots all the files having status set to ACTIVE (see File parameters) in current X and Y limits. These are initiated after the loading of files to the minimal and maximal values and can be changed as described in the preceding section. If the variable PlotFitCurve (see Fitting, 7.2.2) is set ON (automatically after the fitting) then also the calculated pattern is shown. If the variable PlotPeaks1 (PlotPeaks2) is set ON then also the individual fitted alpha1 peaks (doublets) are shown. If the variable PlotResidua is set ON then also the differences between experimental and calculated pattern are shown in the middle of main graphic window. (see also Short- cut keys). By selecting the item Draw the figure containing unnecessary information can be always cleared and redrawn. 4.4 Corrections. After looking on the diffraction pattern one usually wants to determine its parameters. There is a variety of ways how to do it. One way can start with the background separation and corrections for different angular factors as well as Ka line elimination. Corrections submenu Background determination and subtraction Data correction by GCS Smoothing of the data Alpha 2 elimination Intensity - integrated intensity calculation for all peaks Lorentz - correction for angle dependent factors 4.4.1. Background There is no automatic procedure of background elimination in Version 1.3. Global background : Only left and right points are to be given. They are connected by straight line and the background is determined by this manner within the corresponding 2 q range. (The limits are given by graphic cursor THE LEFT LIMIT MUST BE GIVEN FIRST !) Segment calc: Several segments of the diffraction pattern which do not contain contributions from diffraction peaks must be given. Input of all the limits is graphical - for each segment first left and then right limit. By pressing at left limit input the definition of segments is finished. Then a polynom is fitted to all the data lying within the segments. The order of polynom must be given in the top input line (0-4). If zero is given, then polynoms from the first to fourth orders are fitted and that giving the smallest error is used. Finally, the user is asked for acception of the background calculated. If the answer is negative () another order of polynom is used, otherwise the background within approapriate limits is determined. Calculation : The background is calculated in the same way like in the above scale. In addition the background fitted is extended to the whole X-scale range of the file. Subtraction : The background determined by one of the above methods is subtracted from the Current pattern in the whole 2 q range (see File parameters for minimal and maximal values) After a single application of the procedure with subtraction a variable BackgroundSubtracted is set to TRUE (see Get info, chapter 8.3). This is only changed by loading a new file. 4.4.2 Smoothing The diffraction pattern is smoothed within the current 2 q limits by the current method - linear or Savitzky-Golay (default). The method can be changed in Labels, Peak search (4.5). First, the smoothing window (number of points) must be given in the top input line. Then the result is shown and if accepted (top line) it replaces the original data within the current limits. After a single application of the smoothing procedure with acception a variable DataSmoothed is set to TRUE (see 4.5 ). This is only changed by loading a new file. 4.4.3. Data correction One data point can be corrected in Current file with the aid of graphic cursor . Select approapriate q position and then set a new value of intensity. Circles and crosses as labels for data point are useful in the correction procedure. By multiple application of the item more data points can be corrected. 4.4.4. Alpha 2 stripping The elimination of Ka line by the algorithm of Ladell, Zagofsky and Pearlman (J.Appl.Cryst. 8(1975),499-506) in the whole range of the Current file. The range can be graphically changed, if TAB is pressed after the selection of the menu item. Number of histograms (see the reference) must be given (3,5, or 7). The result of the elimination is displayed. The histograms are loaded each time from the file 'ALPHA2.PRF' for the corresponding radiation. The file can be updated and extended by the user. If the file is not found, the correction is not performed. After a single application of the procedure a variable Alpha2 Subtracted is set to TRUE (see Get info). This is only changed by loading of a new file. 4.4.5 Intensities Integrated intensities of all the peaks which have been found (Peak search) are calculated. However, at first the background should be subtracted. The calculation is performed very simply from the left side of peak (or groups of peaks), where the intensity is zero to the right point with the same condition. There is no peak separation. The left and right limits can be changed and calculations carried out somewhat more precisely in Parameters item. 4.4.6 Lorentz correction Some angle dependent factors can be corrected. The procedure includes different diffraction geometries (see chapter 1) and is applied to the whole 2 q range. Lorentz - correction for the Lorentz factor After a single application of the procedure a variable LorentzFactorCorrected is set to TRUE (see Get info 8.3) and correction cannot be applied again. This is only changed by loading of a new file. Polarization - correction for the polarization factor After a single application of the procedure a variable PolarizationCorrected is set to TRUE (see Get info ) and correction cannot be applied again. This is only changed by loading of a new file. Absorption - correction for the absorption factor After a single application of the procedure a variable AbsorptionCorrected is set to TRUE (see Get info ) and correction cannot be applied again. This is only changed by loading of a new file. The above corrections need some Instrumental parameters (Main Menu). They should be checked before application of the corrections. They also can be changed either in program or in configuration file. The latter way is recommended if the parameters are not varied frequently. Because of control variables it is recommended to use the correction only to the Main file. 4.5 Peak search (Labels submenu). The peaks can be searched or defined in submenu Labels. Peaks of the Current file can be either found or given manually by Peak set (indices and positions). If they have been found, the individual reflections can be removed from the set by Erase peak and other peaks may be added to the set by Add peak. Markers of peaks are switched on/off by the toggle. Short lines in the top of main window are shown. Labels of peaks can be shown by selection of the item. They are shown vertically in peak positions. Both peak markers and labels are also drawn by plotter and they can be introduced by ALT M and ALT L, respectively (see Shortcut keys), from the Main graphic menu. Only markers and labels of the Current phase are shown. 4.5.1 Search peak submenu. There are 2 methods implemented for the search of peaks. Widths and heights of peaks are also calculated. The default procedure includes the well-known Savitzky-Golay smoothing and derivative algorithm. It can give shifted maxima sometimes depending on smoothing rate. Numerical derivations of the pattern are used for the determination of basic profile parameters. The second procedure is simpler but it can lead to some troubles if there is a large noice and does not separate strongly overlapped peaks. It uses fast fit of the Gaussian curve to the peak maximum for the precise determination of peak position and halfwidth. For its application the threshold level must be set not to low and smoothing procedure can be used. There are two toggles the state of which is shown in information line (2nd from the top) : Golay-Savitzky - ON the Savitzky-Golay alorithm is used OFF simpler procedure with Gaussian fitting of the peak maxima is used Alpha 2 - ON continuous search is carried out OFF after the determination of peak position the interval corresponding to the distance of a peak is skipped over. Treshold level - only the data lying above the level are searched for maxima (useful for the supression of noice effects). A dotted line shows the current value of the threshold. It can be shifted by graphic cursor after the item selection. Smoothing - linear data smoothing for the peak search only (not necessary for the Savitzky-Golay method) Smoothing window (number of points) must be given in the top input line. Peak search is started by selection of Find peaks. The Savitzky-Golay algorithm gives usually more peaks. This depends on characteristic line width which must be given in the top input line before the search. 4.6. Modification of the peak set in current pattern. The peak can be removed by Erase peak (Labels submenu). The GPS mode is introduced and a line in place of the current peak is shown. The peak is deleted from the set by . Change peaks by direction keys. In the top window corresponding profile parameters are shown. A peak can be added to the peak set of the Current file by Add peak (Labels submenu). Peak position is selected by Graphic cursor. The Graphic cursor mode is introduced automatically. After the selection by the question 'Gauss fit ? ' appears. Say 'y' only for isolated peaks otherwise the program can break down. For 'yes' a Gaussian curve is fitted to the top of the peak and determines the basic profile parameters. Otherwise a peak position and height are derived from cursor position. By selecting the item several times the whole peak set can be created graphically and then indexed. 4.7 Indexing of peaks. Indices can be attached to the peaks of current pattern manually by selecting Indexing (Labels submenu) The input line in the top of the screen is shown asking for the indices of peaks (peak-by-peak) and also for the corresponding phase number (see Phases). Spaces between individual indices h k l must be inserted. Current (default) values are shown in brackets. By pressing you do not change them. Simultaneously lines in peak positions are shown. All the operations are applied only to the current file within the current limits of the graph. 4.8 Phases. Each diffraction pattern can contain up to 10 different phases. If current phase is equal to zero then all peaks are used in all listings of profile parameters and "peak operations" in Graphics, otherwise only the peaks of selected phase are shown. Names of the phases can be given by Name phases and the current phase is selected by Select phase ( in the Main menu). All phases of the Current file are selected by Select all. The program works also without phase description (phase=0). 4.9 Showing and changing profile parameters. The parameters of individual peaks within the current limits can be found and changed either in the Main menu (submenu Output, Show parameters) or in Graphics (submenu Parameters, Peaks). 4.9.1. Submenu Parameters (Graphics). Profile parameters of all peaks of the current pattern are shown and can be modified either for all peaks simultaneously or peak-by-peak in Peaks. Total pattern calculated from the profile parameters using the Pearson function can be shown by View Pearson . The default value of the Pearson function exponent is 2. (see also Functions ). The following procedures are applied to the parameters of all peaks of the current file (for calculated pattern only). Shift pattern - shift of pattern by given value Multiply pattern - increase or decrease of peak heights Tail changes - multiplication of the exponents by a given value FWHM change - multiplication of halfwidths by a given value Replace pattern replaces the current pattern with the calculated one (changes original data). This could be useful for pattern combination. 4.9.2. Submenu Peaks of the menu Parameters. Peak-by-peak change or simple view of the Profile parameters. The GPS is automatically introduced and after the selection of a peak the profile parameters can be modified. The basic profile parameters are displayed in the top window. There are two ways how to modify the parameters - numerical and graphical. The former consits in explicitly given number after the selection of approapriate parameter (in bottom window). In the latter case, the parameter is only pointed by the direction key without selection, instead of which the GCS mode (graphic cursor) is introduced by pressing . The following items are connected to the current peak selected by GPS. Only the first two parameters can be changed graphically. Maximum - change of maximum Position - change of position FWHM - change of halfwidth Shape parameter - change of exponent of the Pearson function HKL - indexing routine is invoked (4.7) Intensity Integrated intensity and integral breadth of the current reflection (selected) as well as the centroid are calculated and shown. The calculation is performed very simply from the left side of peak (or groups of peaks), where the intensity is zero to right point with the same condition. There is no peak separation. The area of the peak used for the calculation is filled with different colour. If the result is not satisfactory then the theta limits can be changed graphically (GCS, press N for this). Set the left limit first. 4.9.3. Submenu Show parameters of the menu Output. Current values of XRD line profile parameters for the peaks of the current phase in current file (pattern) lying within the current limits are shown in a table. The item also allows the change of all profile parameters (find the parameter to be changed by direction keys and press , then give a new value). Only the basic profile parameters are shown, for more information see Output. 5. More Files in the Memory. More files can be loaded into the memory and the corresponding diffraction patterns can be shown on the screen in the same time (see 2.1 Files). The item Version (submenu Environment) shows how many DAT files can be loaded in different versions and also limiting number of experimental points. The version cannot be changed within the program. This must be restarted. The current file is selected in the submenu Files and then can be loaded. The number and name is always shown in the bottom window of the main menu. All patterns the status ACTIVE of which is set TRUE are shown in Graphics in corresponding colour, line type or marker (see also File parameters). The status can be changed either in the table (2.5 File parameters) or in Graphics. 5.1 Submenu Files (graphics). The submenu is provided for manipulation with patterns to be drawn. The patterns can be normalized, shifted, multiplied, added, subtracted, removed from the list of shown paterns. Current pattern - change of the current file in the top menu (another way is from the Main graphic menu, by CTRL Fn) Normalization - All the diffraction patterns are normalized to their maximal values (scale 0-100). Shift pattern - Shift the current file by given value always from standard position (only for plotting). Multiply pattern - Multiply the current pattern (as above). Remove file - The plotting of selected file will be supressed. (The status ACTIVE is set to false). Select the corresponding file in the top menu. The item cannot be used for the Main file (no.1). Back to list- The status ACTIVE is set to 'true' again (see above). Select the corresponding file in the top menu. 5.1.1 Pattern combination Add pattern - The current file is added to the Main file . The result is shown and should be confirmed by the user, otherwise there is no effect of procedure on the Main file (no. 1). Pattern subtract - The current file is subtracted from the Main file (see preceding item). The result of the operation is shown by a thick line in the plot. If you want to get back the original data in Main file, it is necessary to reload them from the disk. The operation can be combined with pattern calculation and Replace item (see 4.9.1). 6. Profile Fitting. In many cases the direct analysis of diffraction profile is difficult or even impossible because of strong peak overlapping. Then it is necessary to approximate diffraction profiles by suitable analytical functions (separate them by profile fitting). Submenu Fit. All the peaks lying within the current theta limits (the latest in Graphics) are approximated with analytical function after the double selection of Fit . During the fitting the refined parameters after each iteration cycle are shown together with the GOF (Goodness-Of-Fit) factor which should be below about 5% for sufficient approximation. This is, however, dependent to some extent on the noice in the diffraction pattern. Two mathematical methods can be used for the fitting : SIMPLEX and Levenberg-Marquardt procedure. The modification of default parameters for fitting can be done by selecting the item Global parameters . THE MAXIMUM NUMBER OF FITTED PARAMETERS IS 50 ! 'Too many parameters' message appears when there is attempt to fit more parameters. 6.1. Submenu Global parameters (menu Fit). Global parameters for fitting can be modified in this menu and analytical function specified in Functions. Background fitting - toggle On/Off The default value depends on the status of BackgroundSubtracted variable. It should be ON if background has not been subtracted (in Graphics) for the current pattern, otherwise it is OFF. However, the status can be changed. It is up to the user. Quadratic background - toggle On/Off (default Off) If set to ON a quadratic background is fitted to the data. Range of fit - default values are taken from the latest graph (current theta limits). These also determine the number of peaks to be fitted. The change of range does not affect the number of peaks for refinement. (The decrease of the range is useful when the weak reflection is near the strong one. Then both are taken into fitting but the data points only from interval of the former are used) If you like to decrease or increase the number of fitted peaks, it is necessary to change the peak set by Erase peak or Add peak in the Graphics (see 2.6). Shape parameters - Only the a /a ratio can be changed here in the version 1.4 (default value is loaded from the configuration file and usually is equal to 0.5 ). Other shape factors for Ka lines are defined only in the configuration file (CONFIG.PRF). Interval of calculated profile - All the peaks included into fitting are calculated in a finite range given by the number of halfwidths. Initial value is calculated from the largest halfwidth of the peaks in current interval. In the item, give the value of the ratio I /I for which the profile can be truncated. The corresponding number of halfwidths is then automatically derived. Iterations number - number of iterations (default 6) Typically 4-10 for Marquardt method could be sufficient. For Simplex it is multiplied by 10. Lambda factor - parameter used in the fitting procedure (default 100). It should be larger if the starting profile parameters are not too good. Three parameters for the SIMPLEX method can be changed. Simplex - toggle On/Off The Levenberg-Marquardt is the default method. 6.2 Modification of starting profile parameters. Fixing the parameters. The modification of starting profile parameters can be done by selecting the item Peaks in Fit submenu.. Change parameters : Current values of XRD line profile parameters for the peaks of current file (pattern) lying within the current theta limits are shown in a table and can be changed (find the parameter to be changed by direction keys and press , then give a new value). The background parameters are also included. Fix parameters : Parameters which are fixed (not refined) during next refinement cycle are marked by 0 (find the parameter to be fixed or released by direction keys and press - toggle 1/0). The fixing is useful in the case of strongly overlapped or weak diffraction peaks. Connect parameters : Parameters which should be refined simultaneously (the same increments in iterations) must be denoted by the same numbers. No gap in numbers is allowed. The binding of parameters can be useful for shape and width parameters of strongly overlapped peaks or in the case of long tails. 6.3 Analytical functions The functions for fitting are selected in Function choice submenu of the Fit menu. The following functions can be used for the fitting (A ... free parameters, y .. intensities, x .. angles). A ... peak maximum, A ... peak position, A ... parameter related to FWHM A ... shape parameter Pearson (P) (not in common normalized shape) A y = ------------------ (1+A (x-A ) ) Asymmetric Pearson 1 (A) left side of the profile A y = ------------------ |1+A (x-A ) | right side A y = ------------------ |1+A A (x-A ) | Asymmetric Pearson 2 (S) A y = ------------------------------------ x-A |1 + A |---------------------- | | 1+A rA (x-A ) pseudo-Voigt (V) A A A (1-A ) y = ------------------ + ------------------- (1+A (x-A ) ) exp(A (x-A ) ) Asymmetric pseudo-Voigt (X) asymmetrization similar to asymmetric Pearson 2 Rational (R) A y = -------------------------------- 1 + A (x-A ) + A (x-A ) These functions are used for the description of the singlet Ka line. The total fit function for one diffraction peak includes the Ka profile which is shifted by the known value (for the given wavelength, see instrumental parameters) and the profile parameters of which can be related to the shape of Ka by the multiplication of corresponding parameters A , A ... as defined in configuration file. The default value of A (Ka )/ A (Ka ) is 0.5 and for other parameters equal to 1. Total fit function for selected segment of diffraction pattern is the sum of all doublets within the current theta limits and optionally includes also background. 6.4 Corrections The correction toggles are switching on/off the corrections of the polarization, absorption and Lorentz factors. In case of ON they are carried out automatically after the fitting for calculation of all profile parameters. The corrections cannot be performed if they have already been included for whole pattern (see 4.4). There are different ways, how to consider the correction factors. 6.5 Drawing the fitting curves. The graphic output of the fitted data can be defined by Graphics submenu of Fit. Plotting of different curves can be switched on/off. Fitted curve - total fitted curve (the sum of contributions of all peaks in the current segment of the diffraction pattern) is shown. The experimental data are automatically plotted with dots. In main graphic menu you can use a shortcut key () for the toggling. Alpha 1 peaks - individual alpha 1 peaks are plotted Doublets - individual doublets are plotted Residua - the differences between experimental and calculated data are plotted (cannot be used together with Fine Plot, see below). In main graphic menu you can use a shortcut key () for the toggling. Use it only after the fitting. The window for the plot of residua is defined in configuration file. Fine plot - the fitted profile is calculated with fine step in order a smooth curve could be plotted In main graphic menu you can use a shortcut key ( for switching on/off 7. Output The experimental data and profile parameters can be send to a file or to the printer. The graphs can be printed or plotted on HP plotter or laser printer (HP-GL language compatible). 7.1 Saving data on disk. Submenu Save file of Files (Main menu) Saves the data or a part of current file in current theta limits to disk in one of the following ways : Rewrite original file (user is asked for confirmation first) New file (first complete filename must be given , since the original name is offered, a care must be given to not erase the original file) Data file for Graph (the data are stored in columns : angles, intensities, calculated intensities) BAR file (only set of peaks is saved in the columnar form: h k l position - 2 q intensities) PCX file The graph is saved in PCX format. In main graphic menu activate by pressing . 7.2 Output of profile parameters Output menu Control of the output of the XRD line profile parameters to plotter, printer, screen and file. Plot, Write, Show parameters 7.2.1 Printing and saving. Submenu Write. Activate the output by selection of RUN in the menu. Writing the profile parameters of the peaks of the current phase of current file in a table form to printer, file and screen, respectively. The parameters are written to all the devices which are set to ON (Printer, Screen, Filename not empty). If Filename is given, then the .PRN extension is attached and the corresponding directory is attached to the name (see Environment). If the file already exists, then the parameters are only attached to it. Listed parameters The parameters which are set to ON are listed in a table form. In all cases the peak indices and positions are printed. Optional parameters are : peak heights, integrated intensities, widths (integral breadths, halfwidths), center of gravities and shape parameters (see Functions), interplanar spacings. The item Angular units of the submenu is a toggle defining whether the widths are written in angular (2 theta) or reciprocal lattice (1/d - in 10 m) units. A table title can be added. Printer setting The type of printing can be selected by Printer setting which allow to switch on/off the following modes : Elite, Compressed [default], Emphasized. This can be useful if the table is too wide for the paper format, for example. Last columns of the table (Type) inform on the fitting function and corrections included Type conventions : Function type - Pearson ...................P Asymmetric Paerson 1 .........A Asymmetric Pearson 2 .........S pseudo-Voigt .........V Asymmetric pseudo-Voigt ......X Rational ......R Direct profile analysis ......d undetermined parameters ......e Correction - polarization ... p P Lorentz ... l L absorption ... a A (upper case - correction performed after fitting) 7.2.2 Plotting the data. Submenu Plot. Activate the output by selection of RUN in the menu. It sends the latest graph from the Graphics to HP plotter (Com1 ON) and/or to the file specified in Filename. If Filename is given, the .PLT extension is attached and file is automatically created. If the Laser printer is ON then the file for HP laser printer is written in HP-GL language. Before sending of the graph some parameters can be changed in Frame image and Plot image. The paper size and orientation can be changed by Paper image . Frame image : The axes description of the graph for plotter. The X- and Y- limits are taken from the Graphics but can be changed again here (Left, Right, Top, Bottom limits). The axis labels can be modified or switched off/on together with ticks (Axis). The division of both axes can be changed by Division X(Y). Plot image : The parameters of plotting data are taken from the Graphics, but can be changed in the table for all files (see 4.9.3) Pen ... pen number (1-6) Symbol ... see Symbols (9.2) Line type ... see Line types Symbol mode ... if ON, then in each point a symbol is plotted regardless of line type Peak label ... if ON then indices of reflections are written to the peak vertically Peak marker ... if TRUE then short lines as markers are plotted at the top of the figure The text, size and color of the title can be modified by Text string , Label height , Label width , Slant (use 0-0.2) and Label pen . Paper image : The default parameters for the figure orientation and size are loaded from the configuration file, but can be changed here. Paper A4 ON .... A4 format OFF ... A3 format Rotate 90 ON .... basic orientation for the corresponding format OFF .... rotation on 90 degrees Velocity velocity of pen can be varied within the range 1-40 Origin X(Y) origin of the figure in milimeters Graph Size X(Y) size of X(Y) axis in milimeters 8. Environment Environment submenu. The item allows change of Current phase in Phases, change default Directories for different file types and Instrumental parameters. Get info - shows information on the status of different control parameters and Save configuration saves current configuration into the Configuration file. For phases see 4.8. 8.1 Change of default directories Directories submenu Pathnames corresponding to different file types are loaded from configuration file after the start of the program. They are used for example as default values for Pathname in Load file (2.1). They are automatically attached to the filenames for all I/O operations. All pathnames are listed and can be changed. If the directory name contains the wildcard '*' then the directory pick up list is shown first. (Change the directory by . Select directory by . Then the pathname for selected file type is changed.) The changed names are used during the whole run of the program. If you want to have the change permanent, change it in configuration file or use Save configuration item in this menu. 8.2 Change of default instrumental parameters Instrumental parameters submenu Change of instrumental parameters which have been loaded from configuration file. The parameters are mainly used for the correction on Lorentz, polarization and absorption factors. Radiation: Different X-ray tubes can be selected from the menu. For Wavelength item the value of lambda in Angstr”ms must be given and then 'Wa' is shown in the menu. Seemann-Bohlin : If selected, then other menu is shown connected only to the S-B geometry. First, Seemann-Bohlin must be set to 'ON'. Then also Transmission geometry can be set to 'ON'. Other parameters are described in CONFIG.PRF (see the next chapter and also chapter 1). 8.3 Other menu Get Info Shows the information on the status of some control parameters. Save configuration Saves current configuration to the Configuration file CONFIG.PRF without comments which are included in original configuration file. Therefore it is useful to save the original file to another directory. 9. Advanced Features - Colors, Symbols, Configuration 9.1 Configuration File CONFIG.PRF The CONFIG.PRF file contains initial parameters which are used as default values for the program. Modify them here, if you want to have the change permanet. Save the original CONFIG.PRF. It helps you to avoid difficulties. Format of the information in CONFIG.PRF must be preserved. FORMAT : line 1-15 : Set of initial parameters for the data files (patterns) 1-5. for each file line 1 color number see Colors line 2 symbol see Symbols line 3 file type see File types line 16 X-ray tube (two letters e.g. Cu) line 17 (empty) lines: 18 Chi angle (for j goniometer) 19 Omega angle (inclination from the symmetric position) 20 Polarization ratio of monochromator (cos a of monochromator) 21 Polarization of radiation 22 Film thickness (in cm) 23 Linear absorption coefficient 24 Seemann-Bohlin geometry (1 for yes, 0 for no); 25 Transmission geometry ( - " - ); 26 Angle of incidence (used only for SB) 27 Radius of goniometer (used only for SB) 28 Radius of X-ray tube (used only for SB) 29 Absorption coefficient of the air (used only for SB) 30 Intensity ratio Ka /Ka , Ka /Ka 31 Multiplication factor for shapes of a and a (Pearson) (e.g. A (Ka )= mult.fact * A (Ka ) ) 32 Multiplication factors for widths of - " - 33 Multiplication factors for shape asymmetry of a , a Parameters for Plotter : 35 Origin of graph (X,Y) 36 Size of graph in mm (X,Y) 37 Velocity 38 Paper format (only A4 or A3) 39 Rotation (only 0 or 90) 40 label on X-axis 41 label for X unit 42 label on Y-axis 43 label for Y unit 44 pen for frame 45 division of X division of Y decimal places of X decimal places of Y 46 draw labels on axes (1... for yes, 0 for no) 47 label height label width slant 48 pen for graph 49 symbol 50 line type 51 pen for label lines 52,54,56,58,60,62,64,66 (comments enclosed in {}, lines can be omitted) line 53 Path for DAT files line 55 Path for SIM files line 57 Path for RIE files line 59 Path for BAR files line 61 Path for GRF files line 63 Path for PLT files line 65 Path for PRN files line 67 Path for FIT files line 69 Path for PCX files next line {} Formatting lines : Put 1 in the following line if you like to change standard input formats, otherwise give 0. The following lines are used only in the former case. Comments enclosed in {} are ignored. next lines : obligatory line * empty or comment line formatting line for DAT files empty or comment line formatting line for SIM files empty or comment line formatting line for RIE files empty or comment line formatting line for BAR files Formatting line for input files have the following format : n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14 n15 n16 n17 n18 n19 n1 - 1..column format X,Y,(FIT) 2..output file from DBWS-Rietveld 3..other formats n2 number of line for Sample Name 0 if not given in data file n3 number of line for Note 0 if not given in data file n4 number of line for Starting Two Theta Angle - " - n5 number of line for Last Two Theta Angle - " - n6 number of line for Step - " - n7 number of line for Time - " - n8 number of line for Number of Points - " - n9 number of line for Number of Peaks - " - n10 number of the first line of the set of X (two theta) values 0 the set is not included in data file n11 number of the first line of the set of Y (intensities) MUST BE EQUIDISTANT !!! n12 number of the first line for reflection set n13 number of column for X data, each, even single, number must be taken into account in column number determination n14 number of column for Y data 0 if not given in data file n15 number of column for peak position - " - n16 number of column for peak height - " - n17 number of column for peak intensity - " - n18 number of column for FWHM - " - n19 number of column for Pearson function exponent - " - Positions n9, n12 and n15-19 are useful only for BAR files, i.e. lists of peaks and corresponding profile parameters. 9.2 Colors and Symbols. Colors for text mode are loaded from the file COLORS.PRF Different colors can be used for all windows in Graphics . They are loaded from configuration file SCREEN.PRF after the start. The background color of the main graphic window can be changed in Graphics by pressing ALT B. Different colors can be used for the plotting of patterns They are loaded from CONFIG.PRF after the start. They can be changed either in File parameters of Files submenu for each pattern separately or from Main menu in Graphics by pressing for the Current file . Colors : (standard palette is used) 0 black 8 dark grey 1 blue 9 light blue 2 green 10 light green 3 cyan 11 light cyan 4 red 12 light red 5 magenta 13 light magenta 6 brown 14 yellow 7 light gray 15 white FORMAT of COLORS.PRF: The file 'COLORS.PRF' contains codes for the colors of main menu. There are 7 different sets (try which one is which) In each line the following colors are defined : Frame, Header, Body of menu, Selected item, Highlighted character, Help row Used notation: $bf (b... background color number f... foreground color number) or only : f (b=0 automatically) The files HERCMONO.PRF, CGA.PRF,EGA.PRF and VGA.PRF are provided for different graphic cards. They can be copied into the file SCREEN.PRF from which the initial parameters for windows in Graphics are loaded. If the file is not found, default values are used. It is not recommended to modify most of the lines. FORMAT of SCREEN.PRF: groups: line 1-4 Main graphic window for the data plot 5-8 Main bottom text window in graphics 9-12 Top text window used mainly for help 13-16 2nd top text window used mainly for information line (current file) 17-20 3rd top window used for peak parameters 21-24 Window for plotting the residua (differences between experimental and calculated profile). 25-28 Split window 1 (not used in program) 29-32 Split window 2 (not used in program) each group contains the following parameters: line 1 : left, right, top, bottom screen coordinates of window line 2 : 1.. clip true or 2 .. clip false line 3 : foreground color , background color line 4 : text font, direction, character size, justification horizontal , justification vertical (text font : 0.. standard, 2.. small direction : 0.. horizontal 1..vertical character size : magnification factor 1-10 justification : 0 .. left bottom 1 .. center center 2 .. right top) It is not recommended to modify lines 2 , 4 and better also not 1. line 33 length of X-axis ticks, length of Y-axis ticks, size of point markers in X-direction, size of markers in Y-direction line 34 size of graphic menu bar (x and y) line 35 (used for menu in graphics) line 36 axis color, color of the graphic cursor line 37 default position of graphic cursor (x and y coordinates) Symbols : The following symbols can be used for the plotting of diffraction patterns : - solid line . dots x crosses o circles They are loaded from CONFIG.PRF after the start. They can be changed either in File parameters of Files menu for each pattern separately or from Main menu in Graphics for the Current file after the pressing . Line types : The following line types can be used (if the Symbol is '-'): 0 ... solid line 1 ... dotted line 2 ... center line 3 ... dashed line 4 - 7 as above but thick They can be changed in File parameters of Files menu for each pattern separately. 9.3 Alpha 2 Elimination. The file 'ALPHA2.PRF' contains histograms for the alpha2 elimination. It can be updated and/or extended (see original reference 4.4.4). format line 1 radiation (upper case) line 2 arms 3 term histogram line 3 arms 5 term histogram line 4 arms 7 term histogram line 5 weights 3 term histogram line 6 weights 5 term histogram line 7 weights 7 term histogram line 8 radiation . . . . the set for WA must be the last one. 10. Bugs Although this is already the fourth version of the program, it is not completely error free. You can meet some difficulties leading to the break down of the program. This can be especially in the following cases : - if simple method for peak search is used on noicy data, especially when the threshold level is under the background - if very poor starting parameters for fitting are used, such as zero maximum or maximum shifted by several degrees - some troubles can appear also for 'strange' profiles in case of pseudo-Voigt functions - if other than Main file (no.1) is used for fitting (usually does not cause the program interruption) - if background is calculated over larger distances Remarks: The asymmetric pseudo-Voigt function does not work in the version. Control parameters (for background, corrections, alpha 2 elimination) are initiated regardless of file number. Binding of parameters may not work properly. Some other errors can still be in the program. PLEASE, DO NOT HESITATE TO CONTACT THE AUTHOR IN CASE OF ANY DIFFICULTIES AS WELL AS OF NEW IDEAS (like new procedures for data evaluation, etc.)