Fix bug with gauss command dumping
-
Owner
I think it was correct before?
gauss name component node w0 z [wy0 zy] - set q parameter gauss* name component node q [qy] (q as 'z z_R') - set q parameter gauss** name component node w(z) Rc [wy(z) Rcy] - set q parameter
-
Maintainer
Ah, so the
gauss*
command has different syntax. But it then looks likeqy
is not being set correctly. In the example above, theqx
andqy
parameters should be the same (gauss gauss1 laser n0 52.228253u -18.352737
), but they're dumped as:gauss* gauss1 laser n0 -18.352737 0.00805414127545816
-
Maintainer
At least it's not dumping complex numbers when it probably should, right?
-
Maintainer
And the string in
"gauss* {name} {comp} {node} {w0:.15g} {z:.15g}".format(...)
needs changed to referenceq
andqy
instead ofw0
andz
. -
Owner
Yep, the stupid thing in the original code is that the literal strings in the format are wrong:
if self.__q_x == self.__q_y: rtn.append("gauss* {name} {comp} {node} {z:.15g} {zr:.15g}".format(name=name, node=self.name, comp=self.__q_comp.name, z=self.__q_x.z, zr=self.__q_x.zr)) else: rtn.append("gauss* {name} {comp} {node} {zx:.15g} {zrx:.15g} {zy:.15g} {zry:.15g}".format(name=name, node=self.name, comp=self.__q_comp.name, zx=self.__q_x.z, zrx=self.__q_x.zr, zy=self.__q_y.z, zry=self.__q_y.zr))
but otherwise it should dump the correct values,
q
is az zr
pair no need for anyj
ori
. -
Maintainer
But the
gauss*
command wants:gauss* name component node q [qy]
and it's being given:
gauss* {name} {comp} {node} {z:.15g} {zr:.15g}
i.e.
q
is being set toz
andqy
is being set tozr
. If I understand correctly, when bothq
andqy
are specified withgauss*
, then it assumesq
isqx
. In that case, we're settingqx
toz
andqy
tozr
. That can't be right...? -
Maintainer
Is
q
not parsed by Finesse as a single (complex) number? Does it allow two numbers with a space between? -
Owner
It's the bit in the parenthesis at the end:
gauss* name component node q [qy] (q as 'z z_R')
is:
gauss* name component node qx_z qx_zr [qy_z qy_zr]
-
Maintainer
Ah I see, thanks for clarifying that. I'll close this PR.