Commit b48996d8 authored by Daniel Brown's avatar Daniel Brown

fixing round trip gouy phase sign

parent 3a244d9e
......@@ -21,6 +21,7 @@ added features:
o Introduced `--pykat=pipename` flag. This opens a pipe between Finesse and whatever else (typically Pykat) so that data can be sent and requested between the two.
bug fixes:
o fixed roundtrip gouy phase sign
o fixed bug with frequency signal/noise, i.e. when applying fsig
to a laser frequency
o Fixed error when using var, which would say that too many variables exist
......
......@@ -5070,8 +5070,8 @@ void compute_cavity_params(void) {
cavity->FSR = init.clight / cavity_length;
cavity->FWHM = init.clight / cavity_length / finesse(1.0 - cavity_power);
cavity->pole = 0.5 * init.clight / cavity_length / finesse(1.0 - cavity_power);
cavity->rt_gouy_x = 2 * acos(msign(cavity->Mx.B) * sqrt((cavity->stability_x + 1) / 2));
cavity->rt_gouy_y = 2 * acos(msign(cavity->My.B) * sqrt((cavity->stability_y + 1) / 2));
cavity->rt_gouy_x = 2 * acos(sign(cavity->Mx.B) * sqrt((cavity->stability_x + 1) / 2));
cavity->rt_gouy_y = 2 * acos(sign(cavity->My.B) * sqrt((cavity->stability_y + 1) / 2));
if (cavity->rt_gouy_x > PI) cavity->rt_gouy_x -= TWOPI;
if (cavity->rt_gouy_y > PI) cavity->rt_gouy_y -= TWOPI;
......
......@@ -49,6 +49,11 @@ static inline double msign(int n) {
return (n % 2) ? -1.0 : 1.0;
}
static inline double sign(double n) {
return (n < 0) ? -1.0 : 1.0;
}
// compute -1^n in order to determine whether a mode is mirrored or not
static inline double turnit(int n2) {
......
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