Commit 4de9ac12 authored by Sean Leavey's avatar Sean Leavey

Fix bug with gauss command dumping

parent 43725ae5
......@@ -739,9 +739,9 @@ class Node(object):
raise pkex.BasePyKatException("Node {0} is not connected to {1}".format(self.name, self.__q_comp.name))
if self.__q_x == self.__q_y:
rtn.append("gauss* {name} {comp} {node} {w0:.15g} {z:.15g}".format(name=name, node=self.name, comp=self.__q_comp.name, w0=self.__q_x.z, z=self.__q_x.zr))
rtn.append("gauss* {name} {comp} {node} {w0:.15g} {z:.15g}".format(name=name, node=self.name, comp=self.__q_comp.name, w0=self.__q_x.w0, z=self.__q_x.z))
else:
rtn.append("gauss* {name} {comp} {node} {w0x:.15g} {zx:.15g} {w0y:.15g} {zy:.15g}".format(name=name, node=self.name, comp=self.__q_comp.name, w0x=self.__q_x.z, zx=self.__q_x.zr, w0y=self.__q_y.z, zy=self.__q_y.zr))
rtn.append("gauss* {name} {comp} {node} {w0x:.15g} {zx:.15g} {w0y:.15g} {zy:.15g}".format(name=name, node=self.name, comp=self.__q_comp.name, w0x=self.__q_x.w0, zx=self.__q_x.z, w0y=self.__q_y.w0, zy=self.__q_y.z))
return rtn
......
  • 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
    Edited by Daniel Brown
  • Ah, so the gauss* command has different syntax. But it then looks like qy is not being set correctly. In the example above, the qx and qy 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
  • At least it's not dumping complex numbers when it probably should, right?

  • And the string in "gauss* {name} {comp} {node} {w0:.15g} {z:.15g}".format(...) needs changed to reference q and qy instead of w0 and z.

  • 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 a z zr pair no need for any j or i.

  • 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 to z and qy is being set to zr. If I understand correctly, when both q and qy are specified with gauss*, then it assumes q is qx. In that case, we're setting qx to z and qy to zr. That can't be right...?

  • Is q not parsed by Finesse as a single (complex) number? Does it allow two numbers with a space between?

  • 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]

  • Ah I see, thanks for clarifying that. I'll close this PR.

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment