Skip to content
Snippets Groups Projects
Commit 2a991239 authored by Jonah Kanner's avatar Jonah Kanner :nerd:
Browse files

Attempt to output freq. domain waveforms

git-svn-id: https://svn.ligo.caltech.edu/svn/bayeswave/trunk@138 c56465c9-8126-4a4f-9d7d-ac845eff4865
parent c600488a
No related branches found
No related tags found
No related merge requests found
......@@ -323,15 +323,31 @@ int main(int argc, char *argv[])
fprintf(t_injOut[ifo], "# Each line is h(t) for one sample in the chain");
}
// Open output files for reconstructed freq domain waveform (colored noise)
FILE **f_recOut = malloc(NI*sizeof(FILE*));
for(ifo=0; ifo<NI; ifo++){
sprintf(filename,"f_recOut.dat.%i", ifo);
f_recOut[ifo] = fopen(filename,"w");
fprintf(f_recOut[ifo], "# Each line is h(f) for one sample in the chain: real img real img ...");
}
// Write out time and freq. samples
FILE *timesamp = fopen("timesamp.txt", "w");
FILE *freqsamp = fopen("freqsamp.txt", "w");
double t0 = Tobs-2.0;
double f;
double t;
for(i=0; i<N; i++) {
t = (i*Tobs)/N;
fprintf(timesamp, "%e \n", t-t0);
}
fclose(timesamp);
for (i=0;i<data->imax;i++) {
f = i*deltaF;
fprintf(freqsamp, "%e \n", f);
}
fclose(freqsamp);
mkdir("injected_waveforms",S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
......@@ -527,8 +543,10 @@ int main(int argc, char *argv[])
for(i=0; i<N; i++) {
fprintf(t_recOut[ifo], "%e ", hoft_rec[i]);
fprintf(t_injOut[ifo], "%e ", hoft_inj[i]);
fprintf(f_recOut[ifo], "%e ", hrec[ifo][i]);
}
fprintf(t_recOut[ifo], "\n");
fprintf(f_recOut[ifo], "\n");
fprintf(t_injOut[ifo], "\n");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment