Hi Both,
Thanks for your help here. I have modified the original stephens macro to replace tan Th with D_spacing as suggested:
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;
}
Which I am calling as such in the refinement (note for the XRD I call "Stephens_monoclinic" in this same way, with no issues):
TOF_Stephens_monoclinic
(
eta, 0.5,
s400, 200,
s040, 200,
s004, 200,
s220, 200,
s202, 200,
s022, 200,
s121, 200,
s103, 200,
s301, 200
)
However, I'm still receiving the same error message:
"Cannot find match for macro TOF_Stephens_monoclinic
Number of arguements 20"
As suggested above, it is saying that it cannot find this macro, which takes 20 arguments (corresponding to the 10 parameter names and 10 parameter values in the called macro).
I'm defining this, as I would any temporary macro, at the top of the file (as opposed to in the .inc). This works just fine for the other macros I have defined this way, such as the below:
macro Out_Tick_XRD_Q(file)
{
phase_out file load out_record out_fmt out_eqn
{
" %11.5f 200\n" = 2 *Pi / D_spacing;
}
}
Is there any reason why TOPAS would not be recognising this user defined macro? I have tried changing the name in case there is anything special about it, but I receive the same error, only with the new name. Functionally, the only differences between the macro I am trying to use (unsuccessfully), and the default stephens_monoclinic, is the new name, and the replacement of tan Th with D_spacing.
Checking the stephens_monoclinic macro in our topas.inc (V7) actually shows it is a bit different to that on the topas website:
macro 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,)
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
)
}
I am a little confused, as this seems to entirely remove reference to the tan Th, which we thought was causing the TOF incompatibility to begin with. Apologies for the wall of text, if you have any suggestions for why this might still not be working, any advice greatly appreciated!
Thanks again for your time and help!