Commit 0381cc3b authored by Daniel Brown's avatar Daniel Brown
Browse files

adding in gouy, fsep, and ABCD element outputs for the cp detector

parent aff4bf41
......@@ -49,6 +49,10 @@ syntax change:
added features:
o Cavity `trace 2` output will now show the roundtrip Gouy phase in degrees
and the mode separation frequency.
o cp detector now has the options:
gouy: roundtrip gouy phase of the cavity in degrees
fsep: mode separation frequency
A, B, C or D: Elements of the roundtrip ABCD matrix
o Added a homodyne detector output. The main usage is:
hd name phase node1 node2
......
......@@ -1984,6 +1984,9 @@ typedef struct cavity {
double stability_x; /** x direction stability factor */
double stability_y; /** y direction stability factor */
double rt_gouy_x; /** Roundtrip gouy x*/
double rt_gouy_y; /** Roundtrip gouy y*/
int stable; //!< is cavity stable?
complex_t qx; //!< Gaussian beam parameter of eigenmode (horizontal)
complex_t qy; //!< Gaussian beam parameter of eigenmode (vertical)
......
......@@ -4399,7 +4399,12 @@ 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));
if(cavity->rt_gouy_x > PI) cavity->rt_gouy_x -= TWOPI;
if(cavity->rt_gouy_y > PI) cavity->rt_gouy_y -= TWOPI;
if (inter.trace & 2) {
message(" finesse : %g, round-trip power loss: %.8g [\%/100]\n",
cavity->finesse, cavity->loss);
......@@ -4411,25 +4416,16 @@ void compute_cavity_params(void) {
if(cavity->stable){
if(cavity->stability_x == cavity->stability_y) {
double gouy_rt = 2 * acos( msign(cavity->Mx.B) * sqrt((cavity->stability_x+1)/2));
if(gouy_rt > PI) gouy_rt -= TWOPI;
message(" RT Gouy: %s deg (mode sep.: %sHz)\n",
xdouble_form(gouy_rt*DEG),
xdouble_form(gouy_rt/TWOPI * cavity->FSR));
xdouble_form(cavity->rt_gouy_x*DEG),
xdouble_form(cavity->rt_gouy_x/TWOPI * cavity->FSR));
} else {
double gouyx_rt = 2 * acos( msign(cavity->Mx.B) * sqrt((cavity->stability_x+1)/2));
double gouyy_rt = 2 * acos( msign(cavity->My.B) * sqrt((cavity->stability_y+1)/2));
if(gouyx_rt > PI) gouyx_rt -= TWOPI;
if(gouyy_rt > PI) gouyy_rt -= TWOPI;
message(" (x) RT Gouy: %s deg, mode sep. %sHz\n",
xdouble_form(gouyx_rt*DEG),
xdouble_form(gouyx_rt/TWOPI * cavity->FSR));
xdouble_form(cavity->rt_gouy_x*DEG),
xdouble_form(cavity->rt_gouy_x/TWOPI * cavity->FSR));
message(" (y) RT Gouy: %s deg, mode sep. %sHz\n",
xdouble_form(gouyy_rt*DEG),
xdouble_form(gouyy_rt/TWOPI * cavity->FSR));
xdouble_form(cavity->rt_gouy_y*DEG),
xdouble_form(cavity->rt_gouy_y/TWOPI * cavity->FSR));
}
}
......
......@@ -2285,6 +2285,42 @@ void fill_detectors(void) {
case CPQ:
output_data->signal = *q;
break;
case CPGOUY:
if (cpout.x)
output_data->signal = co(cav->rt_gouy_x * DEG, 0);
else
output_data->signal = co(cav->rt_gouy_y * DEG, 0);
break;
case CPFSEP:
if (cpout.x)
output_data->signal = co(cav->rt_gouy_x/TWOPI * cav->FSR, 0);
else
output_data->signal = co(cav->rt_gouy_y/TWOPI * cav->FSR, 0);
break;
case CPA:
if (cpout.x)
output_data->signal = co(cav->Mx.A, 0);
else
output_data->signal = co(cav->My.A, 0);
break;
case CPB:
if (cpout.x)
output_data->signal = co(cav->Mx.B, 0);
else
output_data->signal = co(cav->My.B, 0);
break;
case CPC:
if (cpout.x)
output_data->signal = co(cav->Mx.C, 0);
else
output_data->signal = co(cav->My.C, 0);
break;
case CPD:
if (cpout.x)
output_data->signal = co(cav->Mx.D, 0);
else
output_data->signal = co(cav->My.D, 0);
break;
default:
message("action %d\n", cpout.action);
bug_error("No such parameter (detector outputs cp 1)");
......
......@@ -209,6 +209,12 @@
#define CPRC 11 //!< Detect radius of curvature Rc
#define CPS 12 //!< Detect stability factor
#define CPZR 13 //!< Detect raleigh range
#define CPGOUY 14 //!< Round trip gouy phase
#define CPA 15 //!< A element of roundtrip ABCD matrix
#define CPB 16 //!< B element of roundtrip ABCD matrix
#define CPC 17 //!< C element of roundtrip ABCD matrix
#define CPD 18 //!< D element of roundtrip ABCD matrix
#define CPFSEP 19 //!< Frequency separation
#define REAL 1 //!< Real valued number
#define COMPLEX 2 //!< Complex valued number
......
......@@ -4531,8 +4531,20 @@ void read_cavity_param_out(const char *command_string) {
cavity_param_out->action = CPFWHM;
} else if (strncasecmp(parameter_string, "pole", 4) == 0) {
cavity_param_out->action = CPPOLE;
} else {
gerror("Line `%s':\npossible paramters are w/w0/z/r/q/finesse/loss/length/FSR/FWHM/pole/stability'\n",
} else if (strncasecmp(parameter_string, "gouy", 4) == 0) {
cavity_param_out->action = CPGOUY;
} else if (strncasecmp(parameter_string, "fsep", 4) == 0) {
cavity_param_out->action = CPFSEP;
} else if (strncasecmp(parameter_string, "A", 1) == 0) {
cavity_param_out->action = CPA;
} else if (strncasecmp(parameter_string, "B", 1) == 0) {
cavity_param_out->action = CPB;
} else if (strncasecmp(parameter_string, "C", 1) == 0) {
cavity_param_out->action = CPC;
} else if (strncasecmp(parameter_string, "D", 1) == 0) {
cavity_param_out->action = CPD;
} else {
gerror("Line `%s':\npossible paramters are w/w0/z/r/q/finesse/loss/length/FSR/FWHM/pole/stability/gouy/fsep/A/B/C/D'\n",
command_string);
}
......
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