diff options
Diffstat (limited to 'src/anal_process.c')
-rw-r--r-- | src/anal_process.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/anal_process.c b/src/anal_process.c index 694b453..c66aea0 100644 --- a/src/anal_process.c +++ b/src/anal_process.c @@ -31,6 +31,8 @@ int main(int argc, char *argv[]) { uint_t nc = argc - 1; uint_t *Ls_c = (uint_t *)malloc(nc * sizeof(uint_t)); double *betas_c = (double *)malloc(nc * sizeof(double)); + double *vals_c1 = (double *)malloc(nc * sizeof(double)); + double *errors_c1 = (double *)malloc(nc * sizeof(double)); double *vals_c2 = (double *)malloc(nc * sizeof(double)); double *errors_c2 = (double *)malloc(nc * sizeof(double)); double *vals_c3 = (double *)malloc(nc * sizeof(double)); @@ -43,7 +45,7 @@ int main(int argc, char *argv[]) { char *fn = argv[1 + i]; char *buff = (char *)malloc(20 * sizeof(char)); uint_t pos = 0; uint_t c = 0; - while (c < 4) { + while (c < 5) { if (fn[pos] == '_') { c++; } @@ -78,6 +80,11 @@ int main(int argc, char *argv[]) { fread(dist, sizeof(uint32_t), dist_len, dist_file); fclose(dist_file); { + double mom1[2]; + mom(dist_len, 1, dist, mom1); + vals_c1[i] = mom1[0]; + errors_c1[i] = mom1[1]; + double mom2[2]; mom(dist_len, 2, dist, mom2); vals_c2[i] = mom2[0]; @@ -100,7 +107,7 @@ int main(int argc, char *argv[]) { FILE *out_file = fopen(out_filename, "w"); for (uint_t i = 0; i < nc; i++) { - fprintf(out_file, "%u %g %g %g %g %g\n", Ls_c[i], betas_c[i], vals_c2[i], errors_c2[i], vals_c3[i], errors_c3[i]); + fprintf(out_file, "%u %g %g %g %g %g %g %g\n", Ls_c[i], betas_c[i], vals_c1[i], errors_c1[i], vals_c2[i], errors_c2[i], vals_c3[i], errors_c3[i]); } fclose(out_file); @@ -108,6 +115,8 @@ int main(int argc, char *argv[]) { free(Ls_c); free(betas_c); + free(vals_c1); + free(errors_c1); free(vals_c2); free(errors_c2); free(vals_c3); |