Commit 06501193 authored by Daniel Brown's avatar Daniel Brown

adding in new --pykat flag. Adding in new named pipe for passing information...

adding in new --pykat flag. Adding in new named pipe for passing information to pykat. Removing progress from stderr output, now dumps to stdout, or in pykat mode, to the pykat named pipe. Also tidied up and removed debug and printf statements
parent 4ff19359
......@@ -18,8 +18,8 @@ main changes:
fixes to ensure quantum noise works with higher order modes.
o Windows binaries are now generated without any Cygwin dependencies.
This simplifies the distribution because we do no longer have to
provide multiple cygwin DLLs as well. Instead the Windows binaries
consist of just a single executable file, as for other OSes. The
provide multiple cygwin DLLs as well. Instead the Windows binaries
consist of just a single executable file, as for other OSes. The
downside to this is that certain features are no longer included
such as the server mode, the high-performance map integrator Cuba and
the multithreaded matrix solver NICSLU. If such features are required
......@@ -47,6 +47,7 @@ syntax change:
o The parameter 'epsilon_c' in kat.ini has been removed, instead
'amplitude_scaling' can be used for related scaling of light amplitudes
versus light power, see below.
o The '--perl1' flag is now '--pykat'
added features:
o Cavity `trace 2` output will now show the roundtrip Gouy phase in degrees
......@@ -154,7 +155,14 @@ added features:
is assuming the higher order modes not included do not contain any
quantum correllations, if they do your quantum noise values may still
require more modes to converge completely.
o The '--pykat' (was '--perl1') flag now setups up a separate named pipe
from which it passes information to Pykat. This currently only contains
the simulation progress and Finesse version number, but can be extended
to pass additional information without parsing unformatted stdout/stderr
or some other text file with data in. Running Finesse in pykat mode
will block the process until a process which reads from the named pipe
is connects to it. Thus, this flag is only to be used when calling
from a wrapper.
bug fixes:
......
......@@ -125,6 +125,10 @@ FILE *__merged_kat_file = NULL; /** This is a pointer to memory for storing a co
include command. Should not be accessed directly and
freed at the end of the run. */
int pykat_pipe;
int pykat_fd;
FILE* pykat_file;
//! The main routine
/*!
......@@ -132,7 +136,6 @@ FILE *__merged_kat_file = NULL; /** This is a pointer to memory for storing a co
* \param argv The array of input parameters
*/
int main(int argc, char *argv[]) {
getTime(&clock_start);
#ifdef OSUNIX
......@@ -397,7 +400,7 @@ int main(int argc, char *argv[]) {
--argc;
found = true;
} // process --perl1 option (switch off some output)
else if (strcasecmp(argv[1 + num_options], "--perl1") == 0) {
else if (strcasecmp(argv[1 + num_options], "--perl1") == 0 || strcasecmp(argv[1 + num_options], "--pykat") == 0) {
options.perl1 = 1;
++num_options;
--argc;
......@@ -625,6 +628,8 @@ int main(int argc, char *argv[]) {
#ifdef __CYGWIN__
strcpy(inter.basename, get_path_i(inter.basename, true));
#endif
strcpy(vglobal.pykat_fname, inter.basename);
strcat(vglobal.pykat_fname, ".pykat");
strcpy(vglobal.input_fname, inter.basename);
strcat(vglobal.input_fname, ".kat");
strcpy(vglobal.output_fname, inter.basename);
......@@ -671,6 +676,21 @@ int main(int argc, char *argv[]) {
strcat(vglobal.log_fname, ".log");
}
// setup pykat pipe if running
if (options.perl1) {
pykat_pipe = mkfifo(vglobal.pykat_fname, S_IRWXU);
int pykat_fd = open(vglobal.pykat_fname, O_RDWR);
// makes write pipe nonblocking when opened
//fcntl(pykat_fd, F_SETFL, fcntl(pykat_fd, F_GETFL) | O_NONBLOCK);
pykat_file = fdopen(pykat_fd, "w");
// inform pykat what version we're running
fprintf(pykat_file, "version:%s\n", VERSION);
}
int tid_main = startTimer("MAIN");
int tid_startup = startTimer("STARTUP");
......@@ -694,10 +714,11 @@ int main(int argc, char *argv[]) {
open_file_to_write_ascii(vglobal.log_fname, &fp_log);
// set up message reporting if perl1/quiet option isn't set
if (!options.perl1 && !options.quiet) {
if (!options.quiet) {
banner(stdout, vglobal.input_fname, vglobal.output_fname,
vglobal.gnuplot_fname);
}
// output the banner to the log file in any case
if (fp_log != NULL) {
banner(fp_log, vglobal.input_fname, vglobal.output_fname,
......@@ -857,13 +878,14 @@ int main(int argc, char *argv[]) {
if (inter.frequency_flag & PRINT_MODULATOR_COUPLINGS) {
for (i = 0; i < inter.num_modulators; i++) {
printf(" * Carrier Frequencies\n");
message("Carrier Frequencies\n");
print_frequency_couplings(inter.modulator_list[i].name, inter.num_carrier_freqs,
M_ifo_car.mod_does_f_couple[i],
M_ifo_car.mod_f_couple_order[i]);
if (inter.num_signal_freqs > 0) {
printf("* Signal Frequencies\n");
message("Signal Frequencies\n");
print_frequency_couplings(inter.modulator_list[i].name, inter.num_signal_freqs,
M_ifo_sig.mod_does_f_couple[i],
M_ifo_sig.mod_f_couple_order[i]);
......@@ -873,14 +895,14 @@ int main(int argc, char *argv[]) {
if (inter.frequency_flag & PRINT_MIRROR_COUPLINGS) {
for (i = 0; i < inter.num_mirror_dithers; i++) {
printf(" * Carrier Frequencies\n");
message("Carrier Frequencies\n");
print_frequency_couplings(inter.mirror_dither_list[i]->name, inter.num_carrier_freqs,
M_ifo_car.m_does_f_couple[i],
M_ifo_car.m_f_couple_order[i]);
if (inter.num_signal_freqs > 0) {
printf("* Signal Frequencies\n");
message("Signal Frequencies\n");
print_frequency_couplings(inter.mirror_dither_list[i]->name, inter.num_signal_freqs,
M_ifo_sig.m_does_f_couple[i],
M_ifo_sig.m_f_couple_order[i]);
......@@ -890,14 +912,14 @@ int main(int argc, char *argv[]) {
if (inter.frequency_flag & PRINT_BS_COUPLINGS) {
for (i = 0; i < inter.num_bs_dithers; i++) {
printf(" * Carrier Frequencies\n");
message("Carrier Frequencies\n");
print_frequency_couplings(inter.bs_dither_list[i]->name, inter.num_carrier_freqs,
M_ifo_car.bs_does_f_couple[i],
M_ifo_car.bs_f_couple_order[i]);
if (inter.num_signal_freqs > 0) {
printf("* Signal Frequencies\n");
message("Signal Frequencies\n");
print_frequency_couplings(inter.bs_dither_list[i]->name, inter.num_signal_freqs,
M_ifo_sig.bs_does_f_couple[i],
M_ifo_sig.bs_f_couple_order[i]);
......@@ -1197,7 +1219,7 @@ int main(int argc, char *argv[]) {
#ifdef SERVERMODE
initserver();
#else
printf("Servermode not implemented in Windows binary\n");
warn("Servermode not implemented in Windows binary\n");
#endif
} else {
x12_out();
......@@ -1233,8 +1255,8 @@ int main(int argc, char *argv[]) {
* \param output_fname The output file name
* \param gnuplot_fname The name of the gnuplot file
*/
void banner(FILE *fp, char *input_fname, char *output_fname,
char *gnuplot_fname) {
void banner(FILE *fp, char *input_fname, char *output_fname, char *gnuplot_fname) {
now = time(NULL);
char extra_space[80] = " ";
......
......@@ -2238,6 +2238,7 @@ typedef struct minimizer {
//! global variables
typedef struct global_var {
char pykat_fname[FNAME_LEN];
char input_fname[FNAME_LEN]; //!< input file name
char output_fname[FNAME_LEN]; //!< output file name
char gnuplot_fname[FNAME_LEN]; //!< gnuplot file name
......
This diff is collapsed.
......@@ -961,27 +961,27 @@ void _insert_frequency_to_list(frequency_node_t *insert_after, frequency_t *freq
}
void print_used_frequency_list(){
printf("** Total Frequency List (Difference from base Frequency %E Hz):\n", inter.f0);
message("** Total Frequency List (Difference from base Frequency %E Hz):\n", inter.f0);
int i, j;
for(i=0; i<inter.num_carrier_freqs; i++){
frequency_t *fc = inter.carrier_f_list[i];
printf(" %i %s %15.15gHz tuned=%i ", fc->index, fc->name, fc->f, fc->isTuned);
message(" %i %s %15.15gHz tuned=%i ", fc->index, fc->name, fc->f, fc->isTuned);
switch(fc->type){
case CARRIER_FIELD:
printf("Carrier\n");
message("Carrier\n");
break;
case MODULATOR_FIELD:
printf("Modulation\n");
message("Modulation\n");
break;
case SIGNAL_FIELD:
printf("Signal\n");
message("Signal\n");
break;
case USER_FIELD:
printf("User\n");
message("User\n");
break;
}
......@@ -989,7 +989,7 @@ void print_used_frequency_list(){
frequency_t *fs = inter.signal_f_list[j];
if(fs->carrier == fc)
printf(" %i %s %15.15gHz tuned=%i Signal\n", fs->index, fs->name, fs->f, fs->isTuned);
message(" %i %s %15.15gHz tuned=%i Signal\n", fs->index, fs->name, fs->f, fs->isTuned);
}
}
}
......@@ -1348,26 +1348,26 @@ void update_frequency_coupling(int allocing){
void print_frequency_couplings(const char *name, int num_fs, int **does_f_couple, int **f_couple_order){
int i,j;
printf(" * Frequency coupling matrix for %s\n", name);
printf(" ");
message(" * Frequency coupling matrix for %s\n", name);
message(" ");
for(i=0; i < num_fs; i++)
printf("%-3i", i);
message("%-3i", i);
printf("\n");
message("\n");
for(i=0; i < num_fs; i++){
printf("%-3i", i);
message("%-3i", i);
for(j=0; j < num_fs; j++){
if(does_f_couple[i][j]){
printf("%-3i", f_couple_order[i][j]);
message("%-3i", f_couple_order[i][j]);
} else {
printf(" ");
message(" ");
}
}
printf("\n");
message("\n");
}
}
......
......@@ -667,13 +667,11 @@ complex_t calc_reflect_tilt_signal(signal_t *signal, complex_t **knm, int in, in
if(l < inter.num_fields) { // ensure not coupling to mode higher than we are simulating
mult = z_pl_z(mult, z_by_z( z_by_x(X_bar, sqrt(tn)), knm[l][out]));
printf("A [%i %i] X [%i %i]\n", in, tn+1, l, out);
}
if(tn > 0){
l = get_field_index_from_tem(tn - 1, tm);
mult = z_pl_z(mult, z_by_z( z_by_x(X_bar, sqrt(tn)), knm[l][out]));
printf("B [%i %i] X [%i %i]\n", in, tn, l, out);
}
} else if(signal->type == SIG_Y) {
......@@ -1913,10 +1911,6 @@ void fill_detectors(void) {
output_data = &(inter.output_data_list[output_index]);
detector_index = output_data->detector_index;
//if (inter.debug)
//printf("Detector: %d (%s) type:%d\n",
//i, output_data->name, output_data->detector_type);
if (output_data->detector_type == PD0 ||
output_data->detector_type == PD1 ||
output_data->detector_type == AD ||
......@@ -2525,8 +2519,6 @@ complex_t beam_shape(int detector_index) {
z_by_x(z_by_phr
(a_s[field_index][detector_index][j], -1.0 * phase),
bout.masking_factor[field_index]/SQRTTWO)));
//printf("i, j %d, %d - n %d tn %d tm %d: ", i, j, n, tn, tm);
//printf("aaa %s %s\n", complex_form(at1), complex_form(at2));
}
z_tmp = z_pl_z(z_tmp, z_by_zc(at1, at2));
}
......@@ -2631,8 +2623,6 @@ complex_t beam_convolution(int detector_index) {
z_by_x(z_by_phr
(a_s[field_index][detector_index][j], -1.0 * phase),
conv_out.masking_factor[field_index])));
//printf("i, j %d, %d - n %d tn %d tm %d: ", i, j, n, tn, tm);
//printf("aaa %s %s\n", complex_form(at1), complex_form(at2));
}
z_tmp = z_pl_z(z_tmp, z_by_zc(at1, at2));
}
......@@ -2919,8 +2909,6 @@ complex_t photo_detector0(int k) {
} // end outer frequency sum
// printf("n= %d z_tmp: %s\n", n, complex_form(z_tmp));
// E = \sum_n \sum_i c_n \sum_j a_i a_j^*
z_tmp2 = z_pl_z(z_tmp2, z_tmp);
......@@ -3085,7 +3073,7 @@ void create_data_array(complex_t *sol) {
if (options.servermode) {
// output data through socket
// to be removed here!!!!!
printf("Sending data\n");
message("Sending data\n");
} else {
// write data to temprorary memory array
// and compute max/min if -max is set.
......@@ -3268,7 +3256,7 @@ void do_locks(int lock_index) {
inter.lock_list[lock_index].value +=
inter.lock_list[lock_index].gain * (*(inter.lock_list[lock_index].input));
if (inter.debug & 2048) {
printf("lock no. %d, input=%g, value = %g\n",lock_index,*inter.lock_list[lock_index].input, inter.lock_list[lock_index].value);
debug_msg("lock no. %d, input=%g, value = %g\n",lock_index,*inter.lock_list[lock_index].input, inter.lock_list[lock_index].value);
}
}
}
......@@ -4575,8 +4563,6 @@ complex_t get_amplitude_sum(
int freq_index_outer;
//printf("\n");
for (freq_index_outer = 0; freq_index_outer < inter.num_frequencies; freq_index_outer++) {
int freq_index_inner;
for (freq_index_inner = 0; freq_index_inner < inter.num_frequencies; freq_index_inner++) {
......@@ -4633,7 +4619,6 @@ complex_t get_amplitude_sum(
a_s[field_index_inner][detector_index][freq_index_inner]),
factor * pdfactor);
amplitude_sum = z_pl_z(amplitude_sum, tmp);
//printf("%.15g %.15g %g %s %s %s %g %g\n",f_s[freq_index_outer],f_s[freq_index_inner], f_ref, complex_form15(tmp), complex_form15(a_s[field_index_outer][detector_index][freq_index_outer]),complex_form(a_s[field_index_inner][detector_index][freq_index_inner]), factor, pdfactor);
}
// apply the beam masks
......@@ -4871,7 +4856,6 @@ complex_t get_mixed_amplitude(
// append to the outer sum
z = z_pl_z(z, amplitude_sum);
//printf("Amplitude sum: %s\n", complex_form(amplitude_sum));
} // inner field index loop
} // outer field index loop
......
......@@ -354,8 +354,7 @@ void dump_beamshape(FILE *fp, int order, complex_t **coeff,
double x_step = x_range_width / num_x_steps;
double y_step = y_range_width / num_y_steps;
//printf("xs %g, ys:%g\n", stepx, stepy);
double x_point = x_start_point;
int x_step_index;
for (x_step_index = 0; x_step_index < num_x_steps; x_step_index++) {
......@@ -366,7 +365,6 @@ void dump_beamshape(FILE *fp, int order, complex_t **coeff,
int k, l;
for (k = 0; k <= order; k++) {
for (l = 0; l <= order; l++) {
//printf("coeff %d %d : %d\n", k, l, coeff[k][l]);
z1 = z_pl_z(z1, z_by_z(u_nm(k, l, qx, qy, x_point, y_point, nr), coeff[k][l]));
}
}
......@@ -496,7 +494,7 @@ void dump_powers(FILE *fp, ifo_matrix_vars_t *matrix) {
} // end inner frequency sum
}
} // end outer frequency sum
// printf("n= %d z_tmp: %s\n", n, complex_form(z_tmp));
// E = \sum_n \sum_i c_n \sum_j a_i a_j^*
z_tmp2 = z_pl_z(z_tmp2, z_tmp);
} // fields
......
......@@ -130,7 +130,6 @@ complex_t faltung_adapt(int n1, int n2, int m1, int m2,
restar = 0;
numofcalls = ifail = 0;
// printf("worklen %d", worklen);
dcuhre_(&dim1, &dim2, start, stop, &minop, &maxop, func_ptr,
&abserr, &relerr, &key, &worklen, &restar, result, error,
......
......@@ -129,9 +129,6 @@ void gnufile(int step, FILE *fp, char *fname, bool test_script) {
y2min=current_output.Omin[1];
}
}
//printf("total min: y1=%g, y2=%g\n",y1min, y2min);
//printf("total max: y1=%g, y2=%g\n",y1max, y2max);
if (inter.beam.set && inter.beam.swap) {
xy1 = 'y';
......@@ -739,7 +736,6 @@ void pythonfile(FILE *fp, char *fname) {
bool all_file_output=true;
for (k = 0; k < inter.num_pyterm_cmds; k++) {
all_file_output &= init.pyterm[inter.pyterm[k]].output_is_file;
//printf("xxxx %d\n,",init.pyterm[inter.pyterm[k]].output_is_file);
}
if (!all_file_output){
fprintf(fp,"\t\tplt.show()\n");
......@@ -1914,8 +1910,6 @@ void plot3Dmatlab(FILE *fp, int startcol) {
fputs("surfc(", fp);
// printf("i %d colstep %d startcol %d=%d\n",i,col_step, startcol, 1+i*col_step+startcol);
if (inter.beam.set && inter.beam.swap) {
fprintf(fp, "y,x,z(:,:,%d),\'EdgeColor\',\'none\');\n", 1 + i * col_step + startcol);
} else {
......
......@@ -405,7 +405,6 @@ void setup_system(void) {
// calculate the number of equations from number nodes the number of fields
// num_eqns gives the rank of the sparse matrix
// printf("reduced nodes %d (normal) %d\n",inter.num_reduced_nodes,inter.num_nodes);
// If we are using an IFO matrix solver which solves all frequencies at once
// then we have to use an extra factor of num_frequencies
......@@ -443,7 +442,6 @@ void setup_system(void) {
//int _n,_m,_p,_l;
//get_tem_modes_from_field_index(&_n, &_m, i);
//get_tem_modes_from_LG_field_index(&_p, &_l, i);
//printf("%i%i %s %i%i %s\n",_n,_m,complex_form15(A_hg[i]),_l,_p,complex_form15(pcl[i]));
pcl[i] = A_hg[i];
}
......@@ -488,7 +486,6 @@ void setup_system(void) {
for (field_index = 0; field_index < inter.num_fields; field_index++) {
get_tem_modes_from_field_index(&n, &m, field_index);
phase = ((n + 0.5) * gouy(qx) + (m + 0.5) * gouy(qy));
//printf("%g**********************************************\n", phase-phase00);
l.power_coeff_list[field_index] =
z_by_phr(l.power_coeff_list[field_index], phase - phase00);
......@@ -1732,10 +1729,6 @@ void set_gouy_phase_for_spaces(void) {
warn("q mismatch at space %s\n",
get_component_name(overall_component_index));
}
/*
printf("q1 %s , gouy1 %s\n", complex_form(qx1), double_form(gouy(qx1)));
printf("q2 %s , gouy2 %s\n", complex_form(qx2), double_form(gouy(qx2)));
*/
if ((space->attribs & GOUYX) == 0) {
space->gouy_x = DEG * fabs(gouy(qx2) - gouy(qx1));
......@@ -1819,8 +1812,6 @@ void read_env(void) {
strcpy(init.katinifile, s);
init.katini_filename_set = true;
}
//printf("KATINI: %s\n",init.katinifile);
}
void _set_default_gnucommand() {
......@@ -2390,7 +2381,6 @@ void ri_pdtype(char *sn, int l, FILE *fp) {
} else {
n[0] = strtol(sm1, &dummy, 10);
//printf("sm1: %s, dummy: %s\n", sm1, dummy);
if (dummy[0] != '\0') {
gerror("Init file 'kat.ini', pdtype %s:\n"
" expected `n1 m1 n2 m2 factor', e.g. '0 0 0 1 0.1'\n",
......@@ -2423,7 +2413,6 @@ void ri_pdtype(char *sn, int l, FILE *fp) {
} else {
n[1] = strtol(sm2, &dummy, 10);
//printf("sm2: %s, dummy: %s\n", sm2, dummy);
if (dummy[0] != '\0') {
gerror("Init file 'kat.ini', pdtype %s: "
"expected `n1 m1 n2 m2 factor', e.g. '0 0 0 1 0.1'\n",
......@@ -2455,7 +2444,6 @@ void ri_pdtype(char *sn, int l, FILE *fp) {
} else {
n[2] = strtol(sm3, &dummy, 10);
//printf("sm3: %s, dummy: %s\n", sm3, dummy);
if (dummy[0] != '\0') {
gerror("Init file 'kat.ini', pdtype %s: "
"expected `n1 m1 n2 m2 factor', e.g. '0 0 0 1 0.1'\n",
......@@ -2487,7 +2475,7 @@ void ri_pdtype(char *sn, int l, FILE *fp) {
m[3] = mem.hg_mode_order;
} else {
n[3] = strtol(sm4, &dummy, 10);
//printf("sm4: %s, dummy: %s\n", sm4, dummy);
if (dummy[0] != '\0') {
gerror("Init file 'kat.ini', pdtype %s: "
"expected `n1 m1 n2 m2 factor', e.g. '0 0 0 1 0.1'\n",
......@@ -3392,7 +3380,6 @@ void retrace(void) {
if ((inter.space_list[i].attribs & GOUYY) == 0) {
inter.space_list[i].gouy_y = DEG * fabs(gouy(qy2) - gouy(qy1));
}
//printf("g1 %d : %g \n", i, fabs(gouy(qx2)-gouy(qx1)));
}
}
......
......@@ -1622,6 +1622,7 @@ void write_bs_knm_to_matrix_file(char *filename, bs_knm_t *knm) {
//! Print the progress of the simulation to stderr
size_t prev_progress_print_size = 0;
extern FILE* pykat_file;
void clear_progress(){
int i=0;
......@@ -1655,31 +1656,31 @@ void print_progress(int num_points, int current_point) {
if (progress_percentage < 0)
progress_percentage = 0;
if(options.perl1)
text_length = fprintf(stderr, PROG_STRING, "*PROG*", progress_action, progress_percentage, progress_message);
else {
if(options.perl1) {
text_length = fprintf(pykat_file, "progress:%s\t%d\t%s\n", progress_action, progress_percentage, progress_message);
} else {
text_length = fprintf(stderr, PROG_STRING, "", progress_action, progress_percentage, progress_message);
}
// if the previous progress text length wasn't as long as the last then we
// might have some left over text showing.
int extra_chars = prev_progress_print_size - text_length;
if (extra_chars > 0){
for(i=0; i < extra_chars; i++){
fprintf(stderr," ");
// if the previous progress text length wasn't as long as the last then we
// might have some left over text showing.
int extra_chars = prev_progress_print_size - text_length;
if (extra_chars > 0){
for(i=0; i < extra_chars; i++){
fprintf(stderr," ");
}
}
if(options.no_output_bksp)
fprintf(stderr, PROG_END_NEWLINE);
// return to start of carriage so that any other printing just goes over
// the last progress output
fprintf(stderr,"\r");
fflush(stderr);
prev_progress_print_size = text_length;
}
if(options.no_output_bksp)
fprintf(stderr, PROG_END_NEWLINE);
// return to start of carriage so that any other printing just goes over
// the last progress output
fprintf(stderr,"\r");
fflush(stderr);
prev_progress_print_size = text_length;
}
/*
......@@ -1998,12 +1999,20 @@ void _debug_msg(const char *function_name, const char *message_string, ...) {
va_end(argptr); // clean up
}
extern FILE* pykat_file;
//! Flush stdout and stderr and exit program
/*!
* \param return_value the return value to return from the program as a whole
*/
void my_finish(int return_value) {
if(options.perl1){
fclose(pykat_file);
unlink(vglobal.pykat_fname);
}
#if INCLUDE_PARALUTION == 1
if(options.sparse_solver == PARALUTION)
cleanup_paralution();
......@@ -2045,12 +2054,12 @@ void print_version(FILE *file) {
*
*/
void print_help2(void) {
printf(
message(
"------------------------------------------------------------------------\n"
" FINESSE %s - Help Screen (2) - %s\n"
"------------------------------------------------------------------------\n",
VERSION, mydate);
printf(
message(
" ** Alternative calls:\n"
" kat --server <portnumber (11000 to 11010)> [options] inputfile \n"
" starts Finesse in server mode listening on a TCP/IP port\n"
......@@ -2213,7 +2222,7 @@ void print_help2(void) {
*/
void print_help() {
printf(
message(
"------------------------------------------------------------------------\n"
" FINESSE %s - Help Screen - %s\n"
"\n"
......@@ -2223,7 +2232,7 @@ void print_help() {
" Kat server mode - %s\n"
"------------------------------------------------------------------------\n",
VERSION, mydate, (INCLUDE_CUBA)? "yes" : "no", (INCLUDE_NICSLU)? "yes" : "no", (INCLUDE_NET)? "yes" : "no");
printf(
message(
"** Usage (1) kat [options] infile [outfile [gnufile]] \n"
" or (2) kat [options] basename\n"
" in (2) e.g. basename 'test' means input filename :"
......@@ -2242,7 +2251,7 @@ void print_help() {
" -klu : switch to KLU (Legacy solver)\n"
" --server : starts Finesse in server mode\n"
" --noheader : suppresses header information in output data files\n"
" --perl1 : suppresses printing of banner\n"
" --pykat : runs Finesse in Pykat interaction mode\n"
" --quiet : suppresses almost all screen outputs\n"
" --convert : convert knm files between text and binary formats\n"
"** Available interferometer components:\n"
......
......@@ -49,7 +49,6 @@ typedef enum KNM_COMPONENT{
BEAMSPLITTER_CMP=2
} KNM_COMPONENT_t;
void convert_knm_file(const char *filename, const char *newfilename, KNM_COMPONENT_t knmcmp);
bool read_knm_file(void *cmp, bool converting, KNM_COMPONENT_t knmcmp);
void write_knm_file(void *cmp, bool converting, KNM_COMPONENT_t knmcmp);
......
......@@ -731,8 +731,6 @@ static int integrand_cuba_para(const int *ndim, const double xx[], const int *nc
int k=0, i = 0;
double cos_alpha = 1.0;
//printf("%f %f %f %f\n",nr1,nr2,pbs->bs->alpha,asin(sin(pbs->bs->alpha*RAD) * pbs->nr1 / pbs->nr2)*DEG);
// now loop through each component, check whether we should calculate
// the knm, then interpolate etc.
for (k = min_k; k <= max_k; k++) {
......@@ -1175,61 +1173,61 @@ void do_para_cuhre_map_int(void *p, KNM_COMPONENT_t knmcmp, complex_t *results,
if (knmcmp == MIRROR_CMP) {
if (CALC_MR_KNM(pmr, 11)) {
printf("K11: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K11: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
if (CALC_MR_KNM(pmr, 12)) {
printf("K12: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K12: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
if (CALC_MR_KNM(pmr, 21)) {
printf("K21: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K21: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
if (CALC_MR_KNM(pmr, 22)) {
printf("K22: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K22: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
} else if (knmcmp == BEAMSPLITTER_CMP) {
if (CALC_BS_KNM(pbs, 12)) {
printf("K12: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K12: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
if (CALC_BS_KNM(pbs, 21)) {
printf("K21: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K21: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
if (CALC_BS_KNM(pbs, 34)) {
printf("K34: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K34: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
if (CALC_BS_KNM(pbs, 43)) {
printf("K43: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K43: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
if (CALC_BS_KNM(pbs, 13)) {
printf("K13: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K13: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
if (CALC_BS_KNM(pbs, 31)) {
printf("K31: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K31: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
if (CALC_BS_KNM(pbs, 24)) {
printf("K24: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K24: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
if (CALC_BS_KNM(pbs, 42)) {
printf("K42: %.3g+-i%.3g ", error[i], error[i + 1]);
debug_msg("K42: %.3g+-i%.3g ", error[i], error[i + 1]);
i += 2;
}
}
printf("\n");
debug_msg("\n");
}
if (inter.debug && map != NULL && map->show_knm_neval && !options.quiet)
message(" - %i%i->%i%i calculated with %i evaluations\n", n1, m1, n2, m2, neval);
debug_msg(" - %i%i->%i%i calculated with %i evaluations\n", n1, m1, n2, m2, neval);
}
//This J variable is needed for the INT_VAL macro
......@@ -1576,9 +1574,9 @@ void do_riemann_sum_new_int(void *userdata, KNM_COMPONENT_t knmcmp, complex_t *r
}
if (false & inter.debug && !options.quiet) {
printf(" Riemann sum statistics: dx=%e dy=%e ndx=%d ndy=%d da=%e\n", dx, dy, ndx, ndy, da);
printf(" x range: %e %e y range: %e %e\n", pmin[0], pmax[0], pmin[1], pmax[1]);