Hi Both, thanks again for your help and patience with me on this!
johnsoevans For John's comment, I think that's correct, but for some reason that macro works just fine for the xray xdds and has never had an issue. I think possibly because it is defined in the "Stephens_lor_gauss" macro that it calls? For consistency, I have tried making the below macro, where I have replaced references to tan Th with D_spacing:
Macro:
macro TOF_Stephens_lor_gauss(etac, etav, mhkl)
{
#m_argu etac If_Prm_Eqn_Rpt(etac, etav, min 0 max 1)
local #m_unique pp_ = D_spacing2 * Sqrt(Max(mhkl,0)) D_spacing 0.0018/3.1415927;
gauss_fwhm = pp_ (1-CeV(etac, etav));
lor_fwhm = pp_ CeV(etac, etav);
}
macro TOF_Stephens_monoclinic
(
etac, etav,
s400c,s400v,
s040c,s040v,
s004c,s004v,
s220c,s220v,
s202c,s202v,
s022c,s022v,
s121c,s121v,
s103c,s103v,
s301c,s301v
)
{
#m_argu s400c If_Prm_Eqn_Rpt(s400c, s400v,)
#m_argu s040c If_Prm_Eqn_Rpt(s040c, s040v,)
#m_argu s004c If_Prm_Eqn_Rpt(s004c, s004v,)
#m_argu s220c If_Prm_Eqn_Rpt(s220c, s220v,)
#m_argu s202c If_Prm_Eqn_Rpt(s202c, s202v,)
#m_argu s022c If_Prm_Eqn_Rpt(s022c, s022v,)
#m_argu s121c If_Prm_Eqn_Rpt(s121c, s121v,)
#m_argu s103c If_Prm_Eqn_Rpt(s103c, s103v,)
#m_argu s301c If_Prm_Eqn_Rpt(s301c, s301v,)
TOF_Stephens_lor_gauss(
etac, etav,
CeV(s400c,s400v) H4 +
CeV(s040c,s040v) K4 +
CeV(s004c,s004v) L4 +
CeV(s220c,s220v) H2 K2 +
CeV(s202c,s202v) H2 L2 +
CeV(s022c,s022v) K2 L2 +
CeV(s121c,s121v) H K2 L +
CeV(s103c,s103v) H L3 +
CeV(s301c,s301v) H3 L
)
}
This yields the below error, when called like this (with the 20 arguments):
Call:
TOF_Stephens_monoclinic
(
etac, 0.5,
s400c, 200,
s040c, 200,
s004c, 200,
s220c, 200,
s202c, 200,
s022c, 200,
s121c, 200,
s103c, 200,
s301c, 200
)
Error:
" Uninitialized_Variable in equation: m672c9d7a_1b"
rowlesmr Taking Matt's approach for the below macro, is also resulting in a different error currently:
Macro:
macro TOF_Stephens_monoclinic(s400, s040, s004, s220, s202, s022, s301, s121, s103, eta)
{
prm mhkl = H4 s400 + K4 s040 + L4 s004 +
H2 K2 s220 + H2 L2 s202 + K2 L2 s022 +
H K2 L s121 +
H L3 s103 + H3 L s301;
prm pp = D_spacing2 * Sqrt(Max(mhkl,0)) / 1000;
gauss_fwhm = 1.8/3.1415927 pp (1-eta) D_spacing + 0.0001;
lor_fwhm = 1.8/3.1415927 pp eta D_spacing + 0.0001;
}
Call:
prm eta 0.5
prm s400 200
prm s040 200
prm s004 200
prm s220 200
prm s202 200
prm s022 200
prm s121 200
prm s103 200
prm s301 200
TOF_Stephens_monoclinic(eta, s400, s040, s004, s220, s202, s022, s121, s103, s301)
Error:
"Uninitialized_Variable in equation: K2"
I wonder if the error is the same between them both, just that it is named in the second macro and not in the first? Thanks again for your help!