Differences

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

Link to this comparison view

flat-plate_transmission [2017/02/03 01:56] (current)
rowlesmr3 created
Line 1: Line 1:
 +
 +
 +====== Parallel beam, thin-plate transmission ======
 +
 +This is a collection of macros that are used to model the effects of a flat plate sample in transmission,​ either in asymmetric or symmetric geometry. ​
 +
 +There is a (nice) overview of their application in [1]. The required equations for reflection and capillary geometry are also reviewed, as are preferred orientation issues.
 +
 +Contributor:​ Matthew Rowles
 +
 +
 +[1] [[http://​dx.doi.org/​10.1107/​S1600576717000085|Rowles,​ M. R., and C. E. Buckley. 2017. "​Aberration Corrections for Non-Bragg-Brentano Diffraction Geometries."​ Journal of Applied Crystallography 50 (1): 240-251.]].
 +
 +
 +
 +
 +===== Master macros =====
 +
 +These are probably the macros you'll actually put in your input files. They have all of the commonly used corrections.
 +
 +
 +<code topas>
 +''​master macro to encapsulate all asymmetric transmission corrections in a single macro
 +macro Asymmetric_Transmission(omega,​ omega_v, beam, beam_v, sd, sd_v, mu, mu_v, t, t_v)
 +{
 + Asymmetric_Transmission_Intensity_Correction(omega,​ omega_v, mu, mu_v, t, t_v)
 + Asymmetric_Transmission_Absorption_Correction(omega,​ omega_v, mu, mu_v, t, t_v)
 + Asymmetric_Transmission_Parallel_Footprint_Correction(omega,​ omega_v, beam, beam_v)
 + Asymmetric_Transmission_Specimen_Displacement(omega,​ omega_v, sd, sd_v)
 +}
 +</​code>​
 +
 +<code topas>
 +''​master macro to encapsulate all symmetric transmission corrections in a single macro
 +macro Symmetric_Transmission(beam,​ beam_v, sd, sd_v, mu, mu_v, t, t_v)
 +{
 + Symmetric_Transmission_Intensity_Correction(mu,​ mu_v, t, t_v)
 + Symmetric_Transmission_Absorption_Correction(t,​ t_v)
 + Symmetric_Transmission_Parallel_Footprint_Correction(beam,​ beam_v)
 + Symmetric_Transmission_Specimen_Displacement(sd,​ sd_v)
 +}
 +</​code>​
 +
 +
 +===== The actual working macros =====
 +
 +These are the macros that actually do the maths.
 +
 +
 +<code topas>
 +''​Intensity correction in asymmetric transmission - equation 22
 +macro Asymmetric_Transmission_Intensity_Correction(omega,​ omega_v, mu, mu_v, t, t_v)
 +{
 +   #​m_argu omega ''​in degrees
 +   #​m_argu mu    ''​in cm^-1
 +   #​m_argu t     ''​in mm
 +   ​If_Prm_Eqn_Rpt(omega,​ omega_v, min 0.0001 max 90)
 +   ​If_Prm_Eqn_Rpt(mu,​ mu_v, min 3 max 500)
 +   ​If_Prm_Eqn_Rpt(t,​ t_v, min 0.001 max 5)
 +
 +   prm #m_unique beta = (180 - ((2 Th) Rad + CeV(omega, omega_v))); ''​ in degrees
 +   prm #m_unique mu_s = CeV(mu, mu_v) / 10; ''​converts cm^-1 --> mm^-1 for dimensional consistency
 + 
 +   ​scale_pks = 2 Exp(-mu_s CeV(t, t_v) / Sin(beta Deg)) (Sin(beta Deg) /  (Sin(CeV(omega,​ omega_v) ​ Deg) - Sin(beta Deg))) (Exp(-mu_s CeV(t, t_v) (Sin(beta Deg) - Sin(CeV(omega,​ omega_v) ​ Deg)) / (Sin(CeV(omega,​ omega_v) ​ Deg) Sin(beta Deg))) - 1);
 +}
 +</​code>​
 +
 +<code topas>
 +''​Intensity correction in symmetric transmission - equation 24
 +macro Symmetric_Transmission_Intensity_Correction(mu,​ mu_v, t, t_v)
 +{
 +   #​m_argu mu    ''​in cm^-1
 +   #​m_argu t     ''​in mm
 +   ​If_Prm_Eqn_Rpt(mu,​ mu_v, min 3 max 500)
 +   ​If_Prm_Eqn_Rpt(t,​ t_v, min 0.001 max 5)
 +
 +   prm #m_unique mu_s = CeV(mu, mu_v) / 10; ''​converts cm^-1 --> mm^-1 for dimensional consistency
 + 
 +   ​scale_pks = (2 mu_s CeV(t, t_v) Exp(-mu_s CeV(t, t_v) / Cos(Th))) / Cos(Th);
 +}
 +</​code>​
 +
 +<code topas>
 +''​Relative intensity scaling for buried layers in asymmetric transmission geometry -- Equation 25
 +macro Asymmetric_Transmission_Intensity_Correction_for_prelayers(omega,​ omega_v, mu, mu_v, t, t_v)
 +{
 +   #​m_argu omega ''​in degrees
 +   #​m_argu mu    ''​in cm^-1
 +   #​m_argu t     ''​in mm
 +   ​If_Prm_Eqn_Rpt(omega,​ omega_v, min 0.0001 max 90)
 +   ​If_Prm_Eqn_Rpt(mu,​ mu_v, min 3 max 500)
 +   ​If_Prm_Eqn_Rpt(t,​ t_v, min 0.001 max 5)
 + 
 +   prm #m_unique mu_s = CeV(mu, mu_v) / 10; ''​converts cm^-1 --> mm^-1 for dimensional consistency
 + 
 +   ​scale_pks = Exp((-mu_s CeV(t, t_v)) / Sin(CeV(omega,​ omega_v) Deg)) ;
 +}
 +</​code>​
 +
 +<code topas>
 +''​Relative intensity scaling for buried layers in asymmetric transmission geometry -- Equation 26
 +macro Asymmetric_Transmission_Intensity_Correction_for_postlayers(omega,​ omega_v, mu, mu_v, t, t_v)
 +{
 +   #​m_argu omega ''​in degrees
 +   #​m_argu mu    ''​in cm^-1
 +   #​m_argu t     ''​in mm
 +   ​If_Prm_Eqn_Rpt(omega,​ omega_v, min 0.0001 max 90)
 +   ​If_Prm_Eqn_Rpt(mu,​ mu_v, min 3 max 500)
 +   ​If_Prm_Eqn_Rpt(t,​ t_v, min 0.001 max 5)
 + 
 +   prm #m_unique beta = (180 - ((2 Th) Rad + CeV(omega, omega_v))); ''​ in degrees
 +   prm #m_unique mu_s = CeV(mu, mu_v) / 10; ''​converts cm^-1 --> mm^-1 for dimensional consistency
 + 
 +   ​scale_pks = Exp((-mu_s CeV(t, t_v)) / Sin(beta Deg) ;
 +}
 +</​code>​
 +
 +<code topas>
 +''​Relative intensity scaling for buried layers in symmetric transmission geometry -- implied from Equation 25 & 26
 +macro Symmetric_Transmission_Intensity_Correction_for_prepostlayers(omega,​ omega_v, mu, mu_v, t, t_v)
 +{
 +   #​m_argu mu    ''​in cm^-1
 +   #​m_argu t     ''​in mm
 +  If_Prm_Eqn_Rpt(mu,​ mu_v, min 3 max 500)
 +   ​If_Prm_Eqn_Rpt(t,​ t_v, min 0.001 max 5)
 + 
 +   prm #m_unique mu_s = CeV(mu, mu_v) / 10; ''​converts cm^-1 --> mm^-1 for dimensional consistency
 + 
 +   ​scale_pks = Exp((-mu_s CeV(t, t_v)) / Cos(Th)) ;
 +}
 +</​code>​
 +
 +<code topas>
 +''​Line profile correction due to absorption in asymmetric transmission - equation 36
 +macro Asymmetric_Transmission_Absorption_Correction(omega,​ omega_v, mu, mu_v, t, t_v)
 +{
 +   #​m_argu omega ''​in degrees
 +   #​m_argu mu    ''​in cm^-1
 +   #​m_argu t     ''​in mm
 +   ​If_Prm_Eqn_Rpt(omega,​ omega_v, min 0.0001 max 90)
 +   ​If_Prm_Eqn_Rpt(mu,​ mu_v, min 3 max 500)
 +   ​If_Prm_Eqn_Rpt(t,​ t_v, min 0.001 max 5)
 +
 +   prm #m_unique beta = (180 - ((2 Th) Rad + CeV(omega, omega_v))); ''​ in degrees
 +   prm #m_unique mu_s = CeV(mu, mu_v) / 10; ''​converts cm^-1 --> mm^-1 for dimensional consistency
 +
 +   prm #m_unique g = Exp(-mu_s ((X Rs/Sin(2 Th) Deg   ​(Sin(CeV(omega,​ omega_v) Deg)/​Sin(beta Deg) - 1) + (ts/​Sin(beta Deg))));
 + 
 +   ​user_defined_convolution =g; ''​convolutions are automatically normalised
 +    min =(-CeV(t, t_v)/Rs) (Sin2 Th)/​Sin(CeV(omega,​ omega_v) Deg)) Rad;
 +    max 0
 +}
 +</​code>​
 +
 +<code topas>
 +''​Line profile correction due to absorption in symmetric transmission - equation 37
 +macro Symmetric_Transmission_Absorption_Correction(t,​ t_v)
 +{
 +   #​m_argu t     ''​in mm
 +   ​If_Prm_Eqn_Rpt(t,​ t_v, min 0.001 max 5)
 +   
 +   prm #m_unique eps_min = (-2 CeV(t, t_v)/Rs) Sin(Th) Rad;
 +
 +   ​user_defined_convolution = -1/eps_min;
 +    min =eps_min;
 +    max 0
 +}
 +</​code>​
 +
 +<code topas>
 +''​Line profile correction due to footprint in asymetric transmission - equation 38
 +macro Asymmetric_Transmission_Parallel_Footprint_Correction(omega,​ omega_v, beam, beam_v)
 +{
 +   #​m_argu omega ''​in degrees
 +   #​m_argu beam  ''​height in mm
 +   ​If_Prm_Eqn_Rpt(omega,​ omega_v, min 0.0001 max 90)
 +   ​If_Prm_Eqn_Rpt(beam,​ beam_v, min 0.001 max 5)
 +
 +   prm #m_unique beta = (180 - ((2 Th) Rad + CeV(omega, omega_v))); ''​ in degrees
 + 
 +   hat = ((CeV(beam, beam_v) Sin(beta Deg)) / (Rs Sin(CeV(omega,​ omega_v) ​ Deg))) Rad;
 +}
 +</​code>​
 +
 +<code topas>
 +''​Line profile correction due to footprint in symetric transmission - implied by equation 38
 +macro Symmetric_Transmission_Parallel_Footprint_Correction(beam,​ beam_v)
 +{
 +   #​m_argu beam  ''​height in mm
 +   ​If_Prm_Eqn_Rpt(beam,​ beam_v, min 0.001 max 5)
 +
 +   hat = (CeV(beam, beam_v)/ Rs) Rad;
 +}
 +</​code>​
 +
 +<code topas>
 +''​Specimen displacement in asymmetric transmission -- equation 39
 +macro Asymmetric_Transmission_Specimen_Displacement(omega,​ omega_v, sd, sd_v)
 +{
 +   #​m_argu omega ''​ degrees
 +   #​m_argu sd    ''​displacement of the sample in mm
 +   ​If_Prm_Eqn_Rpt(omega,​ omega_v, min 0.0001 max 90)
 +   ​If_Prm_Eqn_Rpt(sd,​ sd_v, min -2 max 2)
 + 
 +   ​th2_offset = (CeV(sd, sd_v) / Rs) (Sin(2 Th)/​Sin(CeV(omega,​ omega_v) Deg)) Rad;
 +}
 +</​code>​
 +
 +<code topas>
 +''​Specimen displacement in symmetric transmission -- equation 40
 +macro Symmetric_Transmission_Specimen_Displacement(sd,​ sd_v)
 +{
 +   #​m_argu sd    ''​displacement of the sample in mm
 +   ​If_Prm_Eqn_Rpt(sd,​ sd_v, min -2 max 2)
 + 
 +   ​th2_offset = (CeV(sd, sd_v) / Rs) (2 Sin(Th)) Rad;
 +}
 +</​code>​
 +
  

Personal Tools