Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
manual_part_2 [2009/08/26 14:53]
clare created
manual_part_2 [2009/08/27 09:54] (current)
clare
Line 919: Line 919:
 The weight fraction w<​sub>​p</​sub>​ for phase "​p"​ is calculated as follows: The weight fraction w<​sub>​p</​sub>​ for phase "​p"​ is calculated as follows:
  
-| <​sub>​{{Technical_Reference%20V4-1_files:​image156.gif?​76x70}}</​sub>​   | where   N<​sub>​p</​sub>​ = Number of phases Q<​sub>​p</​sub>​ = S<​sub>​p</​sub>​M<​sub>​p</​sub>​V<​sub>​p</​sub>/​B<​sub>​p</​sub>​ S<​sub>​p</​sub>​ = Rietveld scale factor for phase p. M<​sub>​p</​sub>​ = Unit cell mass for phase p. V<​sub>​p</​sub>​ = Unit cell volume for phase p. B<​sub>​p</​sub>​ = Brindley correction for phase p. |+| <​sub>​{{techref_files:​image156.gif?​76x70}}</​sub>​   | where   N<​sub>​p</​sub>​ = Number of phases Q<​sub>​p</​sub>​ = S<​sub>​p</​sub>​M<​sub>​p</​sub>​V<​sub>​p</​sub>/​B<​sub>​p</​sub>​ S<​sub>​p</​sub>​ = Rietveld scale factor for phase p. M<​sub>​p</​sub>​ = Unit cell mass for phase p. V<​sub>​p</​sub>​ = Unit cell volume for phase p. B<​sub>​p</​sub>​ = Brindley correction for phase p. |
  
 The Brindley correction is a function of //​brindley_spherical_r_cm//​ and the phase and mixture linear absorption coefficients;​ the latter two are in turn functions of //​phase_MAC//​ and //​mixture_MAC//​ respectively,​ or, The Brindley correction is a function of //​brindley_spherical_r_cm//​ and the phase and mixture linear absorption coefficients;​ the latter two are in turn functions of //​phase_MAC//​ and //​mixture_MAC//​ respectively,​ or,
Line 935: Line 935:
 **[//​chi2_convergence_criteria//​ !E]** **[//​chi2_convergence_criteria//​ !E]**
  
-Convergence is determined when the change in <​sub>​{{Technical_Reference%20V4-1_files:​image002.gif?​20x23}}</​sub>​ is less than //​chi2_convergence_criteria//​ for three consecutive cycles and when all defined //​stop_when//​ parameter attributes evaluate to true. Example:+Convergence is determined when the change in <​sub>​{{techref_files:​image002.gif?​20x23}}</​sub>​ is less than //​chi2_convergence_criteria//​ for three consecutive cycles and when all defined //​stop_when//​ parameter attributes evaluate to true. Example:
  
 chi2_convergence_criteria =  If(Cycle_Iter < 10, .001, .01); chi2_convergence_criteria =  If(Cycle_Iter < 10, .001, .01);
Line 1183: Line 1183:
 //​lp_search//​ uses a new indexing algorithm that is independent of d-spacing extraction; lp-search-pbso4.inp demonstrates its use. lp_search minimizes on a new figure of merit function that gives a measure of correctness for a particular set of lattice parameters. More specifically the figure of merit function assigns parts of the diffraction pattern to peaks and then sums the absolute values of the products of the diffraction intensities multiplied by the distance to the peaks: //​lp_search//​ uses a new indexing algorithm that is independent of d-spacing extraction; lp-search-pbso4.inp demonstrates its use. lp_search minimizes on a new figure of merit function that gives a measure of correctness for a particular set of lattice parameters. More specifically the figure of merit function assigns parts of the diffraction pattern to peaks and then sums the absolute values of the products of the diffraction intensities multiplied by the distance to the peaks:
  
-<​sub>​{{Technical_Reference%20V4-1_files:​image158.gif?​213x39}}</​sub>​where the summation in ‘j’ is over the calculated Bragg positions 2//​q<​sub>​0</​sub>//​ and the summation in ‘i’ is  over part of the diffraction pattern such that (2//​q//<​sub>​</​sub><​sub>​0,​ j-1</​sub>​ + 2//​q//<​sub>​</​sub>​ <​sub>​0,​ j</​sub>​.)/​2 < 2//​q//<​sub>​i</​sub>​  <  (2//​q//<​sub>​</​sub>​ <​sub>​0,​ j+1</​sub>​ + 2//​q//<​sub>​</​sub><​sub>​0,​ j</​sub>​.)/​2. The method avoids difficulties associated with extracting d-spacings from complex patterns comprising heavily overlapped lines; the primary difficulty being that of ascertaining the number of lines present.+<​sub>​{{techref_files:​image158.gif?​213x39}}</​sub>​where the summation in ‘j’ is over the calculated Bragg positions 2//​q<​sub>​0</​sub>//​ and the summation in ‘i’ is  over part of the diffraction pattern such that (2//​q//<​sub>​</​sub><​sub>​0,​ j-1</​sub>​ + 2//​q//<​sub>​</​sub>​ <​sub>​0,​ j</​sub>​.)/​2 < 2//​q//<​sub>​i</​sub>​  <  (2//​q//<​sub>​</​sub>​ <​sub>​0,​ j+1</​sub>​ + 2//​q//<​sub>​</​sub><​sub>​0,​ j</​sub>​.)/​2. The method avoids difficulties associated with extracting d-spacings from complex patterns comprising heavily overlapped lines; the primary difficulty being that of ascertaining the number of lines present.
  
 //​I_parameter_names_have_hkl//​ gives generated Intensity parameters a name starting with $start_of_parameter_name and ending with the corresponding hkl. //​I_parameter_names_have_hkl//​ gives generated Intensity parameters a name starting with $start_of_parameter_name and ending with the corresponding hkl.
Line 1315: Line 1315:
 Calculates the mass absorption coefficient in cm<​sup>​2</​sup>/​g for a mixture as follows: Calculates the mass absorption coefficient in cm<​sup>​2</​sup>/​g for a mixture as follows:
  
-<​sub>​{{Technical_Reference%20V4-1_files:​image160.gif?​160x45}}</​sub>​where //​w//<​sub>​i</​sub>​ and (//​m/////​r//​)<​sub>​i</​sub>​ is the weight percent and //​phase_MAC//​ of phase i respectively. Errors are reported for //​phase_MAC//​ and //​mixture_MAC//​.+<​sub>​{{techref_files:​image160.gif?​160x45}}</​sub>​where //​w//<​sub>​i</​sub>​ and (//​m/////​r//​)<​sub>​i</​sub>​ is the weight percent and //​phase_MAC//​ of phase i respectively. Errors are reported for //​phase_MAC//​ and //​mixture_MAC//​.
  
 The following example provides phase and mixture mass absorption coefficients. The following example provides phase and mixture mass absorption coefficients.
Line 1557: Line 1557:
 //​phase_penalties//​ for a single hkl is defined as follows: //​phase_penalties//​ for a single hkl is defined as follows:
  
-<​sub>​{{Technical_Reference%20V4-1_files:​image162.gif?​444x50}}</​sub>​where <​sub>​{{Technical_Reference%20V4-1_files:​image164.gif?​21x29}}</​sub>​= assigned phase, <​sub>​{{Technical_Reference%20V4-1_files:​image166.gif?​20x25}}</​sub>​= calculated phase, I<​sub>​c</​sub>​ = calculated intensity and //d// is the reflection d-spacing.  The name N returns the sum of the //​phase_penalties//​ and it can be used in equations and in particular //penalty// equations. <​sub>​{{Technical_Reference%20V4-1_files:​image166.gif?​20x25}}</​sub>​ is calculated from sites identified in [[#​k142|$sites]].+<​sub>​{{techref_files:​image162.gif?​444x50}}</​sub>​where <​sub>​{{techref_files:​image164.gif?​21x29}}</​sub>​= assigned phase, <​sub>​{{techref_files:​image166.gif?​20x25}}</​sub>​= calculated phase, I<​sub>​c</​sub>​ = calculated intensity and //d// is the reflection d-spacing.  The name N returns the sum of the //​phase_penalties//​ and it can be used in equations and in particular //penalty// equations. <​sub>​{{techref_files:​image166.gif?​20x25}}</​sub>​ is calculated from sites identified in [[#​k142|$sites]].
  
-#h, #k, #l are user defined hkls; they are used for formulating the phase penalties. #Re and #Im are the real and imaginary parts of <​sub>​{{Technical_Reference%20V4-1_files:​image164.gif?​21x29}}</​sub>​. An example use of phase penalties (see examples AE14-12.INP and AE5-AUTO.inp) is as follows:+#h, #k, #l are user defined hkls; they are used for formulating the phase penalties. #Re and #Im are the real and imaginary parts of <​sub>​{{techref_files:​image164.gif?​21x29}}</​sub>​. An example use of phase penalties (see examples AE14-12.INP and AE5-AUTO.inp) is as follows:
  
 penalty = pp1; penalty = pp1;
Line 1605: Line 1605:
 **[//​quick_refine//​ !E [//​quick_refine_remove//​ !E]]** **[//​quick_refine//​ !E [//​quick_refine_remove//​ !E]]**
  
-//​quick_refine//​ removes parameters that influence <​sub>​{{Technical_Reference%20V4-1_files:​image002.gif?​20x23}}</​sub>​ in a small manner during a [[#​k144|refinement cycle]]. Use of //​quick_refine//​ speeds up simulated annealing, see for example the macro Auto_T which is used in example AE1-AUTO.INP. All refined parameters are reinstated for refinement at the start of subsequent cycles. Large //​quick_refine//​ values aggressively removes parameters and convergence to low <​sub>​{{Technical_Reference%20V4-1_files:​image002.gif?​20x23}}</​sub>​ maybe hindered. A value of 0.1 works well.+//​quick_refine//​ removes parameters that influence <​sub>​{{techref_files:​image002.gif?​20x23}}</​sub>​ in a small manner during a [[#​k144|refinement cycle]]. Use of //​quick_refine//​ speeds up simulated annealing, see for example the macro Auto_T which is used in example AE1-AUTO.INP. All refined parameters are reinstated for refinement at the start of subsequent cycles. Large //​quick_refine//​ values aggressively removes parameters and convergence to low <​sub>​{{techref_files:​image002.gif?​20x23}}</​sub>​ maybe hindered. A value of 0.1 works well.
  
 //​quick_refine//​ has the following consequences:​ //​quick_refine//​ has the following consequences:​
  
-  * If parameters are not reinstated using //​quick_refine_remove//​ then<​sub>​{{Technical_Reference%20V4-1_files:​image002.gif?​20x23}}</​sub>​ does not get to its lowest possible value for a particular refinement cycle. +  * If parameters are not reinstated using //​quick_refine_remove//​ then<​sub>​{{techref_files:​image002.gif?​20x23}}</​sub>​ does not get to its lowest possible value for a particular refinement cycle. 
   * The degree of parameter randomization increases with increasing values of //​quick_refine//​. Thus randomization should be reduced as //​quick_refine//​ increases. Alternatively //​randomize_on_errros//​ can be used which automatically determines the amount a parameter is randomized.   * The degree of parameter randomization increases with increasing values of //​quick_refine//​. Thus randomization should be reduced as //​quick_refine//​ increases. Alternatively //​randomize_on_errros//​ can be used which automatically determines the amount a parameter is randomized.
  
 //​quick_refine_remove//​removes a parameter from refinement if it evaluates to non-zero or reinstates a parameter if it evaluates to zero. It can be a function of the reserved parameters QR_Removed or QR_Num_Times_Consecutively_Small and additionally global reserved parameter names such as Cycle_Iter, Cycle and T. If //​quick_refine_remove//​ is not defined then the removal scheme of section 5.6 is used and parameters are not reinstated until the next refinement cycle. //​quick_refine_remove//​removes a parameter from refinement if it evaluates to non-zero or reinstates a parameter if it evaluates to zero. It can be a function of the reserved parameters QR_Removed or QR_Num_Times_Consecutively_Small and additionally global reserved parameter names such as Cycle_Iter, Cycle and T. If //​quick_refine_remove//​ is not defined then the removal scheme of section 5.6 is used and parameters are not reinstated until the next refinement cycle.
  
-In most refinements the following will produce close to the lowest <​sub>​{{Technical_Reference%20V4-1_files:​image002.gif?​20x23}}</​sub>​ and in a shorter time period (see for example PAWLEY1.INP). ​+In most refinements the following will produce close to the lowest <​sub>​{{techref_files:​image002.gif?​20x23}}</​sub>​ and in a shorter time period (see for example PAWLEY1.INP). ​
  
 quick_refine .1 quick_refine .1
Line 1775: Line 1775:
 N of //​sites_flatten//​ returns a restraint term that decreases as the sites become coplanar; it is defined as follows: N of //​sites_flatten//​ returns a restraint term that decreases as the sites become coplanar; it is defined as follows:
  
-<​sub>​{{Technical_Reference%20V4-1_files:​image169.gif?​529x47}}</​sub>​ +<​sub>​{{techref_files:​image169.gif?​529x47}}</​sub>​ 
  
 where tol corresponds to //​sites_flatten_tol//,​ n corresponds to the number of sites defined with the //​site_to_restrain//​ keyword, b are Cartesian unit length vectors between the sites and the geometric centre of the sites. where tol corresponds to //​sites_flatten_tol//,​ n corresponds to the number of sites defined with the //​site_to_restrain//​ keyword, b are Cartesian unit length vectors between the sites and the geometric centre of the sites.
Line 1871: Line 1871:
 **[****//​swap_sites//​** **$sites_1 $sites_2]…** **[****//​swap_sites//​** **$sites_1 $sites_2]…**
  
-//​swap_sites//​ attempts to find a lower <​sub>​{{Technical_Reference%20V4-1_files:​image002.gif?​20x23}}</​sub>​ by swapping [[#​k142|sites defined]] in $sites_1 with those defined in $sites_2. The swapping continues until all swaps are performed. Outline of the algorithm:+//​swap_sites//​ attempts to find a lower <​sub>​{{techref_files:​image002.gif?​20x23}}</​sub>​ by swapping [[#​k142|sites defined]] in $sites_1 with those defined in $sites_2. The swapping continues until all swaps are performed. Outline of the algorithm:
  
 While //​swap_site//​ processes still to be processed { While //​swap_site//​ processes still to be processed {
Line 1881: Line 1881:
 Randomize the cation configuration according to //​swap_sites//​. Randomize the cation configuration according to //​swap_sites//​.
  
-Find the local minimum of <​sub>​{{Technical_Reference%20V4-1_files:​image002.gif?​20x23}}</​sub>​+Find the local minimum of <​sub>​{{techref_files:​image002.gif?​20x23}}</​sub>​
  
 k = k + 1 k = k + 1
  
-If <​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>​(k+1) > <​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>​(k) then reset site positions+If <​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>​(k+1) > <​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>​(k) then reset site positions
  
-While <​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>​(k+1) > <​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>​(k) or all swap possibility exhausted+While <​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>​(k+1) > <​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>​(k) or all swap possibility exhausted
  
 } }
Line 1921: Line 1921:
 The reserved parameter T returns the current temperature and it can be used in equations and in particular the //​[[#​x000|val_on_continue]]//​ attribute. The first //​temperature//​ defined becomes the starting temperature;​ subsequent //​temperature//​(s) become the current temperature. The reserved parameter T returns the current temperature and it can be used in equations and in particular the //​[[#​x000|val_on_continue]]//​ attribute. The first //​temperature//​ defined becomes the starting temperature;​ subsequent //​temperature//​(s) become the current temperature.
  
-If <​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>​ increases relative to a previous cycle then the temperature is advanced to the next //​temperature//​. If <​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>​ decreases relative to previous temperatures of lesser values then the current temperature is rewound to a previous temperature such that its previous is of a greater value.+If <​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>​ increases relative to a previous cycle then the temperature is advanced to the next //​temperature//​. If <​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>​ decreases relative to previous temperatures of lesser values then the current temperature is rewound to a previous temperature such that its previous is of a greater value.
  
 //​move_to_the_next_temperature_regardless_of_the_change_in_rwp//​ forces the refinement to move to the next temperature regardless of the change in Rwp from the previous temperature. //​move_to_the_next_temperature_regardless_of_the_change_in_rwp//​ forces the refinement to move to the next temperature regardless of the change in Rwp from the previous temperature.
Line 1945: Line 1945:
 temperature 1 temperature 1
  
-If the current temperature is the last one defined (the fourth one), and <​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>​ decreased relative to the second and third //​temperature//​s,​ then the current temperature is set to the second temperature.+If the current temperature is the last one defined (the fourth one), and <​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>​ decreased relative to the second and third //​temperature//​s,​ then the current temperature is set to the second temperature.
  
 The current temperature can be used in all equations using the reserved parameter T, for example: The current temperature can be used in all equations using the reserved parameter T, for example:
Line 1995: Line 1995:
 Change the cation configuration according to //​try_site_patterns//​ Change the cation configuration according to //​try_site_patterns//​
  
-Find the local minimum of <​sub>​{{Technical_Reference%20V4-1_files:​image002.gif?​20x23}}</​sub>​+Find the local minimum of <​sub>​{{techref_files:​image002.gif?​20x23}}</​sub>​
  
-If <​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>​(k+1) > <​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>​(k) then reset site positions+If <​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>​(k+1) > <​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>​(k) then reset site positions
  
 k = k + 1 k = k + 1
  
-While <​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>​(k+1) > <​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>​(k) or //k// < //​num_patterns_at_a_time//​+While <​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>​(k+1) > <​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>​(k) or //k// < //​num_patterns_at_a_time//​
  
 } }
Line 2031: Line 2031:
 //​try_site_patterns//​ "Ca Zr" //​num_patterns_at_a_time//​ 3 //​try_site_patterns//​ "Ca Zr" //​num_patterns_at_a_time//​ 3
  
-N<​sub>​CaZr</​sub>​=10 and thus //​try_site_patterns//​ will cycle through the 10 patterns searching for a reduction in <​sub>​{{Technical_Reference%20V4-1_files:​image002.gif?​20x23}}</​sub>​.+N<​sub>​CaZr</​sub>​=10 and thus //​try_site_patterns//​ will cycle through the 10 patterns searching for a reduction in <​sub>​{{techref_files:​image002.gif?​20x23}}</​sub>​.
  
 **[//​user_defined_convolution//​ E //min// E //max// E]...** **[//​user_defined_convolution//​ E //min// E //max// E]...**
Line 2067: Line 2067:
 **[//​weighting//​ !E  [//​recal_weighting_on_iter//​]]** **[//​weighting//​ !E  [//​recal_weighting_on_iter//​]]**
  
-Used for calculating the //xdd// dependent weighting function  in<​sub>​{{Technical_Reference%20V4-1_files:​image016.gif?​20x23}}</​sub>,​ see equation Eq. (5‑2). Can be a function of the reserved parameter names X, Yobs, Ycalc and  SigmaYobs. The default is as follows:+Used for calculating the //xdd// dependent weighting function  in<​sub>​{{techref_files:​image016.gif?​20x23}}</​sub>,​ see equation Eq. (5‑2). Can be a function of the reserved parameter names X, Yobs, Ycalc and  SigmaYobs. The default is as follows:
  
 weighting = 1 / Max(Yobs, 1); weighting = 1 / Max(Yobs, 1);
Line 2338: Line 2338:
  
 For obvious reasons, parameters should not be given the @ name within //for// constructs. The effect this would have is to give unique parameter names to the parameters iterated over; the output file would contain the parameter value corresponding to the last “//for xdds//” or “//for strs//” iteration. For obvious reasons, parameters should not be given the @ name within //for// constructs. The effect this would have is to give unique parameter names to the parameters iterated over; the output file would contain the parameter value corresponding to the last “//for xdds//” or “//for strs//” iteration.
 +
 +====== 9             Macros and Include Files ======
 +
 +INP files are pre-processed. The pre-processor comprises directives beginning with the character # and macros. Macros are used for grouping keywords. The directives are of two types, global directives and directives that are invoked on macro expansion, they are:
 +
 +Directives with global scope
 +
 +macro $user_defined_macro_name { … }
 +
 +#include $user_defined_macro_file_name
 +
 +#​delete_macros { $macros_to_be_deleted }
 +
 +#define, #undef, #ifdef, #ifndef, #else, #endif
 +
 +Directives invoked on macro expansion
 +
 +#m_ifarg, #m_else, #m_endif
 +
 +#m_code,  #m_eqn, #​m_code_refine,​ #m_one_word
 +
 +#m_argu, #​m_first_word,​ #​m_unique_not_refine
 +
 +===== 9.1        The macro directive =====
 +
 +Macros are defined using the macro directive; here's an example:
 +
 +macro Cubic(cv)
 +
 +{
 +
 +   a   cv
 +
 +   b = Get(a);
 +
 +   c = Get(a);
 +
 +}
 +
 +Macros can have multiple arguments or none at all; the Cubic macro above has one argument; here are some examples of the use of Cubic:
 +
 +Cubic(4.50671)
 +
 +Cubic(a_lp 4.50671  //min// 4.49671  //max// 4.52671)
 +
 +Cubic(!a_lp 4.50671)
 +
 +The first instance defines the //a//, //b// and //c// lattice parameters without a parameter name. The second defines the lattice parameters with a name indicating refinement of the a_lp parameter. In the third example, the a_lp parameter is preceded by the character !. This indicates that the a_lp parameter is not to be refined; it can however be used in equations. The definition of macros need not precede its use. For example, in the segment:
 +
 +xdd...
 +
 +Emission_Profile ' this is expanded
 +
 +macro Emission_Profile { CuKa2(0.001) }
 +
 +Emission_Profile is expanded to "​CuKa2(0.001)"​ even though Emission_Profile has been defined after its use.
 +
 +Macro names need not be unique; in cases where more than one macro have the same name then the actual macro expanded is determined by the number of arguments. For example, if the macro Slit_Width(.1) is used then the Slit_Width(v) macro is expanded. On the other hand if the macro Slit_Width(sw,​ .1) is used then the Slit_Width(c,​ v) macro is expanded.
 +
 +Macros can also expand to other macro names. For example, the macro Crystallite_Size expands to CS and since CS is a macro then the CS macro will be expanded.
 +
 +==== 9.1.1              Directives with global scope ====
 +
 +**#include $user_defined_macro_file_name**
 +
 +Include files are used to group macros. The file TOPAS.INC contains standard macros; a good place to view examples. Text within include files are inserted at the position of the #include directive, thus the following:
 +
 +#include "my include file.inc"​
 +
 +inserts the text within //"//​my include file.inc//"//​ at the position of the #include directive. The standard macro file TOPAS.INC is always included by default.
 +
 +#​delete_macros { $macros_to_be_deleted }
 +
 +Macros can be deleted using the #​delete_macroskeyword,​ for example,
 +
 +#​delete_macros { LP_Factor SW ZE }
 +
 +will delete all macros previously defined with the names LP_Factor, SW and ZE including macros of the same name but with different arguments.
 +
 +**#define, #undef, #ifdef, #ifndef, #else, #endif**
 +
 +The #define and #undef directives works similar to the c pre-processor directives of the same name. #define and #undef is typically used with #ifdef, #else, #endif directives to control macro expansion in INP files. For example, the following:
 +
 +#ifdef STANDARD_MACROS
 +
 +//xdd//...
 +
 +#endif
 +
 +will expand to contain the //xdd// keyword if STANDARD_MACROS has been previously defined using a #define directive. The following will also expand to contain the //xdd// keyword if STANDARD_MACROS has not been defined using a #define directive,
 +
 +#ifdef !STANDARD_MACROS
 +
 +   #define STANDARD_MACROS
 +
 +   xdd...
 +
 +#endif
 +
 +or,
 +
 +#ifndef STANDARD_MACROS
 +
 +   #define STANDARD_MACROS
 +
 +   xdd...
 +
 +#endif
 +
 +Note the use of the ‘!’ character placed before STANDARD_MACROS which means if STANDARD_MACROS is not defined.
 +
 +==== 9.1.2              Directives invoked on macro expansion ====
 +
 +**#m_ifarg, #m_else, #m_endif**
 +
 +These are conditional directives that are invoked on macro expansion. #m_ifarg operates on two statements immediately following its use; the first must refer to a macro argument and the second can be any of the following:​  #m_code, #m_eqn, #​m_code_refine,​ #m_one_word and “some string”. #m_ifarg evaluates to true according to the rules of Table 9‑1.
 +
 + 
 +
 +**Table 9‑1**  #m_ifarg syntax and meaning.
 +
 +|   | Evaluates to true if the following is true |
 +| #m_ifarg  c #m_code | If the macro argument c has a letter or the character ! as the first character and if it is not an equation. |
 +| #m_ifarg  c #m_eqn | If the macro argument c is an equation. |
 +| #m_ifarg  c #​m_code_refine | If the macro argument c has a letter as the first character and if it is not an equation. |
 +| #m_ifarg c “some_string” | If the macro argument c == “some_string”. |
 +| #m_ifarg  v #​m_one_word. | If the macro argument v consists of one word. |
 +
 + 
 +
 +**#m_argu, #​m_first_word,​ #​m_unique_not_refine**
 +
 +These operate on one macro argument with the intention of changing the value of the argument according to the rules of Table 9‑2.
 +
 + 
 +
 +**Table 9‑2**  Directives that operate and maybe change the value of a macro argument.
 +
 +|   | Meaning |
 +| #m_argu c | Change the macro argument c to a unique parameter name if it has @ as the first character. |
 +| #​m_unique_not_refine c  | Change the macro argument c to a unique parameter name that is not to be refined. |
 +| #​m_first_word v | Replace the macro argument v with the first word in the macro argument v. |
 +
 + 
 +
 +===== 9.2        Overview =====
 +
 +The file TOPAS.INC is included into INP files by default; it contains commonly used standard macros. The meaning of the macro arguments in TOPAS.INC can be readily determined from the following conventions:​
 +
 +Ø       Arguments called "​c"​ correspond to a parameter name.
 +
 +Ø       Arguments called "​v"​ correspond to a parameter value.
 +
 +Ø       Arguments called "​cv"​ correspond to a parameter name and/or value.
 +
 +For example, the macro Cubic(cv) requires a value and/or a parameter name as an argument. Some examples are:
 +
 +Cubic(a_lp 10.604)
 +
 +Cubic(10.604)
 +
 +Cubic(@ 10.604  min 10.59 max 10.61)
 +
 +Here are some more examples for the Slit_Width macro:
 +
 +SW(@, .1)
 +
 +SW(sw, .1  min = Val-.02; max = Val+.02;)
 +
 +SW%%((%%ap+bp)/​cp,​ 0) ' where ap, bp anc cp are parameters defined elsewhere
 +
 +==== 9.2.1              xdd macros ====
 +
 +RAW(path_no_ext)
 +
 +RAW(path_no_ext,​ range_num)
 +
 +DAT(path_no_ext)
 +
 +XDD(path_no_ext)
 +
 +XY(path_no_ext,​ calc_step)
 +
 +XYE(path_ext)
 +
 +SCR(path_no_ext)
 +
 +SHELX_HKL4(path_no_ext)
 +
 +==== 9.2.2              Lattice parameters ====
 +
 +Cubic(cv)
 +
 +Tetragonal(a_cv,​ c_cv)
 +
 +Hexagonal(a_cv,​ c_cv)
 +
 +Rhombohedral(a_cv,​ al_cv)
 +
 +==== 9.2.3              Emission profile macros ====
 +
 +| No_Th_Dependence CuKa1(yminymax) CuK1sharp(yminymax) CuKa2_analyt(yminymax) CuKa2(yminymax) CuKa4_Holzer(yminymax) CuKa5(yminymax) CuKa5_Berger(yminymax) CoKa3(yminymax) CoKa7_Holzer(yminymax) CrKa7_Holzer(yminymax) | FeKa7_Holzer(yminymax) MnKa7_Holzer(yminymax) NiKa5_Holzer(yminymax) MoKa2(yminymax) CuKb4_Holzer(yminymax) CoKb6_Holzer(yminymax) CrKb5_Holzer(yminymax) FeKb4_Holzer(yminymax) MnKb5_Holzer(yminymax) NiKb4_Holzer(yminymax)   |
 +
 +==== 9.2.4              Instrument and instrument convolutions ====
 +
 +**Radius(rp,​ rs)**
 +
 +Primary and secondary instrument radii in [mm]. For most diffractometers rp equals rs.
 +
 +**Specimen_Tilt(c,​ v)**
 +
 +Specimen tilt in mm.
 +
 +**Slit_Width(c,​ v) or SW(c, v)**
 +
 +Aperture of the receiving slit in the equitorial plane in mm.
 +
 +**Sample_Thickness(dc,​ dv)**
 +
 +Sample thickness in mm in the direction of the scattering vector.
 +
 +**Divergence(c,​ v)**
 +
 +Horizontal divergence of the beam in degrees in the equitorial plane.
 +
 +**Variable_Divergence(c,​ v)**
 +
 +**Variable_Divergence_Shape(c,​ v)**
 +
 +**Variable_Divergence_Intensity**
 +
 +Constant illuminated sample length in mm for variable slits (i.e. variable beam divergence). This Variable_Divergence macro applies both a shape and intensity correction.
 +
 +**Simple_Axial_Model(c,​ v)**
 +
 +Receiving slit length mm for describing peak asymmetry due to axial divergence.
 +
 +**Full_Axial_Model(filament_cv,​ sample_cv, detector_cv,​ psol_cv, ssol_cv)**
 +
 +Accurate model for describing peak asymmetry due to axial divergence of the beam.
 +
 +[filament_cv]:​ Tube filament length in [mm].
 +
 +[sample_cv]:​ Sample length in axial direction in [mm].
 +
 +[detector_cv]:​ Length of the detector (= receiving) slit in [mm].
 +
 +[psol_cv, ssol_cv]: Aperture of the primary and secondary Soller slit in [°].
 +
 +**Finger_et_al(s2,​ h2)**
 +
 +Finger et al., 1994. model for describing peak asymmetry due to axial divergence.
 +
 +[s2, h2]: Sample length, receiving slit length.
 +
 +**Tube_Tails(source_width_c,​ source_width_v,​ z1_c, z1_v, z2_c, z2_v, z1_z2_h_c, z1_z2_h_v)**
 +
 +Model for description of tube tails (Bergmann, 2000).
 +
 +[source_width_c,​ source_width_v]:​ Tube filament width in [mm].
 +
 +[z1_c, z1_v]: Effective width of tube tails in the equatorial plane perpendicular to the X-ray beam - negative z-direction [mm].
 +
 +[z2_c, z2_v]: Effective width of tube tails in the equatorial plane perpendicular to the X-ray beam - positive z-direction [mm].
 +
 +[z1_z2_h_c, z1_z2_h_v]: Fractional height of the tube tails relative to the main beam.
 +
 +**UVW(u, uv, v, vv, w, wv)**
 +
 +Cagliotti relation (Cagliotti et al., 1958).
 +
 +[u, v, w]: Parameter names.
 +
 +[uv, vv, wv]: Halfwidth value.
 +
 +==== 9.2.5              Phase peak_type'​s ====
 +
 +**PV_Peak_Type(ha,​ hav, hb, hbv, hc, hcv, lora, lorav, lorb, lorbv, lorc, lorcv)**
 +
 +**TCHZ_Peak_Type(u,​ uv, v, vv, w, wv, x, xv, y, yv, z, zv)**
 +
 +**PVII_Peak_Type(ha,​ hav, hb, hbv, hc, hcv, ma, mav, mb, mbv, mc, mcv)**
 +
 +Pseudo-Voigt,​ TCHZ pseudo-Voigt and PearsonVII functions.
 +
 +For the definition of the functions and function parameters refer to section 0.
 +
 +==== 9.2.6              Quantitative Analysis ====
 +
 +**Apply_Brindley_Spherical_R_PD( R, PD)**
 +
 +Applies the Brindley correction for quantitative analysis (Brindley, 1945).
 +
 +**MVW(m_v, v_v, w_v)**
 +
 +Returns cell mass, cell volume and weight percent.
 +
 +==== 9.2.7              2q Corrections ====
 +
 +**Zero_Error or ZE(c, v)**
 +
 +Zero point error.
 +
 +**Specimen_Displacement(c,​ v) or SD(c, v)**
 +
 +Specimen displacement error.
 +
 +==== 9.2.8              Intensity Corrections ====
 +
 +**LP_Factor(c,​ v)**
 +
 +Lorentz and Lorentz-Polarisation factor.
 +
 +[c, v]: Monochromator angle in [°2q]
 +
 +For unpolarized radiation v is 90 (e.g. X-ray diffractometers without any monochromator),​ for fully polarized radiation v is 0 (e.g. synchrotron radiation).
 +
 +Values for most common monochromators (Cu radiation) are:
 +
 +Ge              : 27.3
 +
 +Graphite      : 26.4
 +
 +Quartz        : 26.6
 +
 +**Lorentz_Factor**
 +
 +Lorentz_Factor for fixed wavelength neutron data. 
 +
 +**Surface_Roughness_Pitschke_et_al(a1c,​ a1v, a2c, a2v)**
 +
 +**Surface_Roughness_Suortti(a1c,​ a1v, a2c, a2v)**
 +
 +Suortti and Pitschke_et_al intensity corrections each with two parameters a1 and a2.
 +
 +**Preferred_Orientation(c,​ v, ang, hkl) or PO(c, v, ang, hkl)**
 +
 +Preferred orientation correction based on March (1932).
 +
 +[c, v]: March parameter value.
 +
 +[ang, hkl]: Lattice direction.
 +
 +**PO_Two_Directions(c1,​ v1, ang1, hkl1, c2, v2, ang2, hkl2,  w1c, w1v)**
 +
 +Preferred orientation correction based on March (1932) considering two preferred orientation directions.
 +
 +[c1, v1]: March parameter value for the first preferred orientation direction.
 +
 +[ang1, hkl1]: Parameter name and lattice plane for the first preferred orientation direction.
 +
 +[c2, v2]: March parameter value for the second preferred orientation direction.
 +
 +[ang2, hkl2]: Lattice direction for the second preferred orientation direction.
 +
 +[w1c, w1v]: Fraction of crystals oriented into first preferred orientation direction.
 +
 +**PO_Spherical_Harmonics(sh,​ order)**
 +
 +Preferred orientation correction based on spherical harmonics according to Järvinen (1993).
 +
 +%%[(%%sh, order)]: Parameter name, spherical harmonics order.
 +
 +==== 9.2.9              Bondlength penalty functions ====
 +
 +**Anti_Bump(ton,​ s1, s2, ro, wby)**
 +
 +**AI_Anti_Bump(s1,​ s2, ro, wby, num_cycle_iters),​ AI_Anti_Bump(s1,​ s2, ro, wby)**
 +
 +Applies a penalty function as a function of the distance between atoms. The closer the atoms are the higher the penalty is.
 +
 +[ton]: Sets to_N of the box_interaction keyword.
 +
 +[s1, s2]: Sites.
 +
 +[ro]: Distance.
 +
 +[wby]: Relative weighting given to the penalty function.
 +
 +For more details refer to box_interaction and ai_anti_bump..
 +
 +**Parabola_N(n1,​ n2, s1, s2, ro, wby)**
 +
 +Applies a penalty function as a function of the distance between atoms. The closer the atoms are the higher the penalty is.
 +
 +[n1]: The closest n1 number of atoms of type s2 is soft constrained to a distance ro away from s1 .
 +
 +[n2]: The closest n2 number of atoms of type s2 (excluding the closest n1 number of atoms of type s2) is repelled from s1, if the distance between s1 and s2 is less than ro .
 +
 +[s1, s2]: Sites.
 +
 +[ro]: Distance.
 +
 +[wby]: Relative weighting given to the penalty function.
 +
 +**Grs_Interaction(s1,​ s2, wqi, wqj, c, ro, n)**
 +
 +Penalty function applying the GRS series according to Coelho & Cheary (1997).
 +
 +[s1, s2]: Sites.
 +
 +[wqi, wqj]: Valence charge of the atoms.
 +
 +[c]: Name of the GRS.
 +
 +[ro]: Distance.
 +
 +[n]: The exponent of the repulsion part of the Lennard-Jones potential.
 +
 +For more details refer to grs_interaction.
 +
 +**Grs_No_Repulsion(s1,​ s2, wqi, wqj, c)**
 +
 +Used for calculating the Madelung constants.
 +
 +[s1, s2]: Sites.
 +
 +[wqi, wqj]: Valence charge of the atoms.
 +
 +[c]: Name of the GRS.
 +
 +**Grs_BornMayer(s1,​ s2, wqi, wqj, c, ro, b)**
 +
 +Uses the GRS series with a Born-Mayer equation for the repulsion term.
 +
 +[s1, s2]: Sites.
 +
 +[wqi, wqj]: Valence charge of the atoms.
 +
 +[c]: Name of the GRS.
 +
 +[ro]: Mean distance.
 +
 +[b]: b-constant for the repulsion part of the Born-Mayer potential.
 +
 +**Distance_Restrain(sites,​ t, t_calc, tol, wscale)**
 +
 +**Angle_Restrain(sites,​ t, t_calc, tol, wscale)**
 +
 +**Flatten(sites,​ t_calc, tol, wscale)**
 +
 +**Distance_Restrain_Keep_Within(sites,​ r, wby, num_cycle_iters)**
 +
 +**Distance_Restrain_Keep_Out(sites,​ r, wby, num_cycle_iters)**
 +
 +Applies penalties restraining  distances and angles between sites. .
 +
 +'​sites'​ must comprise two sites for the distance restraints and three for the angle restraints.. For Flatten '​sites'​ must contain more than three sites. wby is a scaling constant applied to the penalty.
 +
 +**Keep_Atom_Within_Box(size) - this is a constraint macro.**
 +
 +Applies constraints such that the present site cannot more outside of a box with a length of 2*size.
 +
 +==== 9.2.10          Reporting macros ====
 +
 +**Create_2Th_Ip_file(file)**
 +
 +Creates a file with positions (2) and intensities.
 +
 +**Create_d_Ip_file(file)**
 +
 +Creates a file with positions (d) and intensities.
 +
 +**Create_hklm_d_Th2_Ip_file(file)**
 +
 +Creates a file with the following information for each peak: h, k, l, multiplicity,​ positions d and 2q and intensities.
 +
 +**Out_Yobs_Ycalc_and_Difference(file)**
 +
 +Outputs the x-axis, Yobs, Ycalc and difference.
 +
 +**Out_X_Yobs(file),​ Out_X_Ycalc(file),​ Out_X_Difference(file)**
 +
 +Outputs the x-axis, Yobs, Ycalc and Difference.to files.
 +
 +**Out_F2_Details(file),​ Out_A01_A11_B01_B11(file)**
 +
 +Outputs structure factor details, see section 7.3.2.
 +
 +**Out_FCF(file)**
 +
 +Outputs a CIF file representation of structure factor details suitable for generating Fourier maps using ShelX..
 +
 +**Out_CIF_STR(file)**
 +
 +Outputs structure details in CIF format.
 +
 +==== 9.2.11          Rigid body macros ====
 +
 +**Set_Length(s0,​ s1, r, xc, yc, zc, cva, cvb)**
 +
 +Fixes the distance between two sites.
 +
 +[s0, s1]: Site names.
 +
 +[r]: Distance in Angstroms.
 +
 +[xc, yc, zc]: The parameter names for the coordinates of s0.
 +
 +[cva, cvb]: Parameter names and values for rotations about the x and y axes
 +
 +**Set_Lengths(s0,​ s1, s2, r, xc, yc, zc, cva1, cvb1, cva2, cvb2)**
 +
 +**Set_Lengths(s0,​ s1, s2, s3, r, xcv, ycv, zcv, cva1, cvb1, cva2, cvb2, cva3, cvb3)**
 +
 +Fixes the distance between two and three sites, respectively.
 +
 +Set_Lengths(s0,​ s1, s2, r, xc, yc, zc, cva1, cvb1, cva2, cvb2) is defined as
 +
 +macro Set_Lengths(s0,​ s1, s2, r, xc, yc, zc,cva1, cvb1, cva2, cvb2)
 +
 +{
 +
 +   Set_Length(s0,​ s1, r, xc, yc, zc, cva1, cvb1)
 +
 +   Set_Length(s0,​ s2, r, xc, yc, zc, cva2, cvb2)
 +
 +}
 +
 +and so on.
 +
 +**Triangle(s1,​ s2, s3, r)**
 +
 +**Triangle(s0,​ s1, s2, s3, r)**
 +
 +**Triangle(s0,​ s1, s2, s3, r, xc, yc, zc, cva, cvb, cvc)**
 +
 +Defines a regular triangle without and with a central atom (s0).
 +
 +[s0, s1, s2, s3]: Site names. s0 is the central atom of the triangle.
 +
 +[r]: Distance in Angstroms.
 +
 +[xc, yc, zc]: Parameter names for the fractional coordinates of the geometric center of the triangle.
 +
 +[cva, cvb, cvc]: Parameter names and values for rotations about the x, y and z axes.
 +
 +**Tetrahedra(s0,​ s1, s2, s3, s4, r, xc, yc, zc, cva, cvb, cvc)**
 +
 +Defines a tetrahedra with a central atom.
 +
 +[s0, s1, s2, s3, s4]: Site names. s0 is the central atom of the tetrahedra.
 +
 +[r]: Distance in Angstroms.
 +
 +[xc, yc, zc]: Parameter names for the fractional coordinates of the geometric center of the tetrahedra.
 +
 +[cva, cvb, cvc]: Parameter names and values for rotations about the x, y and z axes.
 +
 +**Octahedra(s0,​ s1, s2, s3, s4, s5, s6, r)**
 +
 +**Octahedra(s0,​ s1, s2, s3, s4, s5, s6, r, xc, yc, zc, cva, cvb, cvc)**
 +
 +Defines an octahedra with a central atom.
 +
 +[s0, s1, s2, s3, s4, s5, s6]: Site names. s0 is the central atom of the octahedra.
 +
 +[r]: Distance in Angstroms.
 +
 +[xc, yc, zc]: Parameter names for the fractional coordinates of the geometric center of the octahedra.
 +
 +[cva, cvb, cvc]: Parameter names and values for rotations about the x, y and z axes.
 +
 +**Hexagon_sitting_on_point_in_xy_plane(s1,​ s2, s3, s4, s5, s6, a)**
 +
 +**Hexagon_sitting_on_side_in_xy_plane(s1,​ s2, s3, s4, s5, s6, a)**
 +
 +Defines a regular hexagon, where the hexagon is sitting on a point or on a side in the x-y plane, respectively.
 +
 +[s1, s2, s3, s4, s5, s6]: Site names.
 +
 +[a]: Distance in Angstroms.
 +
 +**Translate(acv,​ bcv, ccv)**
 +
 +**Translate(acv,​ bcv, ccv, ops)**
 +
 +Performs a translation of the rigid body.
 +
 +[acv, bcv, ccv]: Amount of the translation in fractional coordinates.
 +
 +[ops]: Operates on previously defined sites in “ops”.
 +
 +**Translate_with_site_start_values(s0,​ xc, yc, zc)**
 +
 +Performs a translation using the coordinates of s0 as start values.
 +
 +[s0]: Site name.
 +
 +[xc, yc, zc]: Parameter names for the coordinates of s0.
 +
 +**Rotate_about_points(cv,​ a, b)**
 +
 +**Rotate_about_points(cv,​ a, b, pts)**
 +
 +Performs a rotation about a rotation vector specified by two sites.
 +
 +[cv]: Amount the rigid body is rotated about the specified rotation vector in degrees.
 +
 +[a, b]: Rotation vector defined by the sites a and b.
 +
 +[pts]: Operates on previously defined point_for_site(s).
 +
 +Note: Do not include points rotated about in the “operate on points” list of the
 +
 +Rotate_about_points macro. For example, in
 +
 +Rotate_about_points(@ 1 0, C1, C2, " C3 C4 C5 C6 ")
 +
 +the points C1 and C2 are not included in the “points operated on” list. Note also that Rotate_about_points without a “points operated on” list will operate on all previously defined point_for_site(s). Therefore, when an “operate on points” list is not defined then it is necessary to place the “points rotated about” after the Rotate_about_points macro. It is best to specify an “operate on points” list when in doubt.
 +
 +**Rotate_about_these_points(cv,​ a, b, ops)**
 +
 +Performs a rotation about a rotation vector specified by two sites.
 +
 +[cv]: Amount the rigid body is rotated about the specified rotation vector in degrees.
 +
 +[a, b]: Rotation vector defined by the sites a and b.
 +
 +[ops]: Operates on previously defined point_for_site(s).
 +
 +**Rotate_about_axies(cva,​ cvb)**
 +
 +**Rotate_about_axies(cva,​ cvb, cvc)**
 +
 +Performs a rotation about the axis of the rigid body.
 +
 +[cva, cvb, cvc]: Parameter names and values for rotations about the x, y and z axes.
 +
 +Rotation_vector_from_points(a,​ b)
 +
 +Determines a rotation vector form two points.
 +
 +[a, b]: Rotation vector defined by the sites a and b.
 +
 +==== 9.2.12          Background functions using fit_objects ====
 +
 +**One_on_X(c,​ v)**
 +
 +1/X background function ideal to describe background intensity at low angles due to air scattering
 +
 +**Bkg_Diffuse(b,​ bv, bb, bbv)**
 +
 +Defines a function to describe short range order effects.
 +
 +[b, bv]: Parameter name, refineable weight.
 +
 +[bb, bbv]: Parameter name, correlation shell radii.
 +
 +**PV(a, xo, fwhm, g)**
 +
 +**PV(a, xo, fwhm, g, av, xov, fwhmv, gv)**
 +
 +Defines a pseudo-Voigt function.
 +
 +[a, av]: Parameter name, area.
 +
 +[xo, xov]: Parameter name, Position in [° 2q].
 +
 +[fwhm, fwhmv]: Parameter name, full width at half maximum in [° 2q].
 +
 +[g, gv]: Parameter name, pseudo-Voigt mixing parameter.
 +
 +**PV_Left_Right(a,​ xo, fwhm1, fwhm2, g)**
 +
 +**PV_Left_Right(a,​ xo, fwhm1, fwhm2, g, av, xov, fwhm1v, fwhm2v, gv)**
 +
 +Defines a split-pseudo-Voigt function.
 +
 +[a, av]: Parameter name, area.
 +
 +[xo, xov]: Parameter name, Position in [° 2q].
 +
 +[fwhm1, fwhm1v]: Full width at half maximum in [° 2q] for the left composite function.
 +
 +[fwhm2, fwhm2v]: Full width at half maximum in [° 2q] for the right composite function.
 +
 +[g, gv]: Pseudo-Voigt mixing parameter.
 +
 +==== 9.2.13          Sample convolutions ====
 +
 +**Absorption(c,​ v), AB(c, v)**
 +
 +Linear absorption coefficient in t in cm-1 used for adjusting the peak shape due to sample transparency.
 +
 +**Absorption_With_Sample_Thickness_mm_Shape(u,​ uv, d, dv)**
 +
 +Corrects the peak shape for absorption effects.
 +
 +[u, uv]: Parameter name, linear absorption coefficient in cm-1.
 +
 +[d, dv]: Parameter name, sample thickness in [mm].
 +
 +**Absorption_With_Sample_Thickness_mm_Shape_Intensity(u,​ uv, d, dv)**
 +
 +Corrects the peak intensity for absorption effects.
 +
 +[u, uv]: Parameter name, absorption coefficient in cm-1.
 +
 +[d, dv]: Parameter name, sample thickness in [mm].
 +
 +**CS_L(c,v) or Crystallite_Size(c,​ v) or CS(c, v)**
 +
 +Applies a Lorentzian convolution with a FWHM that varies according to the relation lor_fwhm = c / Cos(Th).
 +
 +[c, v]: Parameter name, crystallite size in [nm].
 +
 +**CS_G(c, v)**
 +
 +Applies a Gaussian convolution with a FWHM that varies according to the relation gauss_fwhm = c / Cos(Th).
 +
 +[c, v]: Parameter name, crystallite size in [nm].
 +
 +**Strain_L(c,​ v) or Microstrain(c,​ v) or MS(c, v)**
 +
 +Applies a Lorentzian convolution with a FWHM that varies according to the relation lor_fwhm = c Tan(Th).
 +
 +**Strain_G(c,​ v)**
 +
 +Applies a Gaussian convolution with a FWHM that varies according to the relation gauss_fwhm = c Tan(Th).
 +
 +**LVol_FWHM_CS_G_L(k,​ lvol, kf, lvolf, csgc, csgv, cslc, cslv)**
 +
 +Calculates FWHM and IB (integral breadth) based volume-weighted column heights (LVol). For details refer to section 7.2.
 +
 +[k, lvol]: shape factor (fixed to 1), integral breadth based LVol.
 +
 +[kf, lvolf]: shape factor (defaults to 0.89), FWHM based LVol.
 +
 +[csgc, csgv]: Parameter name, Gaussian component.
 +
 +[cslc, cslv]: Parameter name, Lorentzian component.
 +
 +==== 9.2.14          Neutron TOF ====
 +
 +**TOF_XYE(path,​ calc_step), TOF_GSAS(path,​ calc_step)**
 +
 +Includes the neutron_data keyword and the calculation step size.
 +
 +**TOF_LAM(w_ymin_on_ymax)**
 +
 +Defines a simple emission profile suitable for TOF data
 +
 +**TOF_x_axis_calibration(t0,​ t0v, t1, t1v, t2, t2v)**
 +
 +Writes the pk_xo equation in terms of the three calibration constants t0, t1, t2 converting d-spacing to x-axis space.
 +
 +**TOF_Exponential(a0,​ a0v, a1, a1v, wexp, t1, lr)**
 +
 +An exponential convolution applied to the TOF peaks - see example TOF_BANK2_1.INP.
 +
 +**TOF_CS_L(c,​ v, t1), TOF_CS_G(c, v, t1)**
 +
 +Lorentzian and Gaussian components for crystallite size. t1 is the calibration constant appearing in the argument of the macro TOF_x_axis_calibration.
 +
 +**TOF_PV(fwhm,​ fwhmv, lor, lorv, t1)**
 +
 +A pseudo-Voigt used to describe the instrumental broadening t1 is the calibration constant appearing in the argument of the macro TOF_x_axis_calibration,​ see examples tof_balzar_br1.inp and tof_balzar_sh1.inp.
 +
 +==== 9.2.15          Miscalleneous ====
 +
 +**Temperature_Regime**
 +
 +Defines a temperature regime. See the temperature keyword.
 +
 +**STR(sg)**
 +
 +Signals the start of structure information with a space group of sg.
 +
 +**Exclude**
 +
 +Defines excluded regions. See the exclude keyword.
 +
 +**Decompose(diff_toll)**
 +
 +Decompose a diffraction pattern into data points at peak positions only. Data points closer than diff_toll to another data point is not included. Decompose also sets x_calculation_step to the value of diff_toll.
 +
 +**ADPs_Keep_PD**
 +
 +**Mixture_LAC_1_on_cm(mlac)**
 +
 +**Phase_Density_g_on_cm3(pd)**
 +
 +**Phase_LAC_1_on_cm(u)**
 +
 +**Gauss(xo, fwhm), Lorentzian(xo,​ fwhm)**
 +
 +An equation defines a unit area Gaussian or Lorentzian with a position of xo and a FWHM of fwhm 
 +
 +====== 10       File types and formats ======
 +
 +| **Table** **10‑1**  File types. ||
 +| File Type | Comments |
 +| *.PRO | Project files. |
 +| *.INP | INP format Input file. |
 +| *.OUT | Output file created on termination of refinement. Same format as *.INP. |
 +| *.STR | Structure data. Same format as *.INP. |
 +| *.LAM | Source emission profile data. Same format as *.INP. |
 +| *.DEF | Program defaults. Same format as *.INP. |
 +| *.LOG | TOPAS.log and Tc.log. Useful for tracking input errors. |
 +| **Measurement Data** ||
 +| *.RAW | Bruker AXS binaries (DIFFRAC AT and DIFFRAC//<​sup>​plus</​sup>//​) |
 +| *.DAT *.XDD / *.CAL *.XY, *XYE | ASCII file formats, see Table 10‑2 |
 +| *.SCR | ASCII file format comprising lines of h, k, l, m, d, 2q, and Fo. |
 +| *.HKL | ShelX HKL4 format. |
 +| **Structure and structure factor data** ||
 +| *.CIF | Crystallographic Information File;  International Union for Crystallography (IUCr). |
 +| *.FCF | CIF file representation of structure factor details suitable for generating Fourier maps using ShelX. |
 +
 + 
 +
 +| **Table** **10****‑2**  ASCII input data file formats. *.XY, *.XYE, *.XDD and *.CAL are delimited by white space characters and can contain line and block comments. |||
 +| File Type | Format | Explanation |
 +| ***.DAT,  LHPM/​RIET7/​CSRIET** ||   |
 +|   | Line 1-4 | Comments |
 +|   | Line 5 | Start angle, step width, finish angle |
 +|   | Line 6 onwards | Observed XRD data points (any number of rows) |
 +| **GSAS** ("std - const",​ "alt - ralf"​),​ use keyword //​gsas_format//​ |||
 +|   | Line 1 | Legend |
 +|   | Line 2 | Item 3: Number of data points |
 +|   | Line 3 onwards | Depending of item10 and item5 |
 +|   |   | For item10 = "​STD"​ and item5 = "​CONST"​ xmin = item6/div step =item7/div read(10(i2,​F6.0) iww(i),​y(i)              i=1, npts sigma(i)=sqr(y(i)/​iww(i))                  i=1, npts For item10 = "​ALT"​ and item5 = "​RALF"​ xmin = item6/32 step = item7/32 read(4(F8.0,​F7.4,​F5.4) x(i), y(i), sigma(i)     i=1, npts x(i) = x(i)/​32                      i=1, npts do i = 1, npts-1    div = x(i+1)-x(i)    y(i) =1000 * y(i)/div    sigma(i) = 1000 * sigma(i)/​div end do rk (constant wavelength data):     div = 100 rk (time of flight data):           div = 1 |
 +| **FullProf** (INSTRM = 0: free format file), use keyword fullprof//​_format//​ |||
 +|   | Line 1 | Start angle, step width, finish angle, comments |
 +|   | Line 2 onwards | Observed XRD data points (any number of rows) |
 +| ***.XDD / *.CAL** | Line 1 | Optional line for comments |
 +|   | Number 2 | Start angle |
 +|   | Number 3 | Step width |
 +|   | Number 4 | Finish angle |
 +|   | Number 5 | Counting time |
 +|   | Number 6 | Unused |
 +|   | Number 7 | Unused |
 +|   | Number 8 onwards | Observed XRD data points |
 +| ***.XY** |   | 2q and intensity data values |
 +| ***.XYE** |   | 2q, intensity and intensity error values. |

Personal Tools