Commit 59af5517 authored by Katerina Chatziioannou's avatar Katerina Chatziioannou
Browse files

switch some flags

parent 58e15430
Pipeline #159525 failed with stages
in 1 minute and 5 seconds
...@@ -622,7 +622,7 @@ int main(int argc, char *argv[]) ...@@ -622,7 +622,7 @@ int main(int argc, char *argv[])
struct bayesCBC *bayescbc = malloc(sizeof(struct bayesCBC)); struct bayesCBC *bayescbc = malloc(sizeof(struct bayesCBC));
if (data->bayesCBCFlag) if (data->cbcModelFlag)
{ {
// Initialize baeyscbc with default values & allocate memory // Initialize baeyscbc with default values & allocate memory
...@@ -679,6 +679,7 @@ int main(int argc, char *argv[]) ...@@ -679,6 +679,7 @@ int main(int argc, char *argv[])
data->cleanFlag = 1; data->cleanFlag = 1;
data->glitchFlag = 1; data->glitchFlag = 1;
data->signalFlag = 0; data->signalFlag = 0;
data->cbcFlag = 0;
data->runPhase = 0; data->runPhase = 0;
...@@ -948,6 +949,7 @@ int main(int argc, char *argv[]) ...@@ -948,6 +949,7 @@ int main(int argc, char *argv[])
data->cleanFlag = 0; data->cleanFlag = 0;
data->glitchFlag = 0; data->glitchFlag = 0;
data->signalFlag = 1; data->signalFlag = 1;
data->cbcFlag = 0;
initialize_chain(chain,1); initialize_chain(chain,1);
...@@ -990,6 +992,7 @@ int main(int argc, char *argv[]) ...@@ -990,6 +992,7 @@ int main(int argc, char *argv[])
data->cleanFlag = 0; data->cleanFlag = 0;
data->glitchFlag = 1; data->glitchFlag = 1;
data->signalFlag = 0; data->signalFlag = 0;
data->cbcFlag = 0;
initialize_chain(chain,1); initialize_chain(chain,1);
...@@ -1026,6 +1029,7 @@ int main(int argc, char *argv[]) ...@@ -1026,6 +1029,7 @@ int main(int argc, char *argv[])
data->cleanFlag = 0; data->cleanFlag = 0;
data->glitchFlag = 0; data->glitchFlag = 0;
data->signalFlag = 0; data->signalFlag = 0;
data->cbcFlag = 0;
initialize_chain(chain,1); initialize_chain(chain,1);
...@@ -1068,6 +1072,7 @@ int main(int argc, char *argv[]) ...@@ -1068,6 +1072,7 @@ int main(int argc, char *argv[])
data->cleanFlag = 0; data->cleanFlag = 0;
data->glitchFlag = 1; data->glitchFlag = 1;
data->signalFlag = 1; data->signalFlag = 1;
data->cbcFlag = 0;
initialize_chain(chain,1); initialize_chain(chain,1);
...@@ -1084,6 +1089,49 @@ int main(int argc, char *argv[]) ...@@ -1084,6 +1089,49 @@ int main(int argc, char *argv[])
data->fullModelFlag = 0; data->fullModelFlag = 0;
} }
/******************************************************************************/
/* */
/* CBC Characterization phase */
/* */
/******************************************************************************/
if(data->cbcModelFlag)
{
data->runPhase = 1;
reset_priors(data, prior);
//Initialize proposal ratios for GW search phase
chain->modelRate = 1; //always do signal model updates
if(data->constantLogLFlag)
chain->rjmcmcRate = 0.01;
else
chain->rjmcmcRate = 0.5;
//Shut off RJMCMC if --fixD argument given
if(data->rjFlag==0) chain->rjmcmcRate = 0.0;
data->cleanFlag = 0;
data->cbcFlag = 1;
if (data->GlitchCBCFlag) data->glitchFlag = 1; //cbc signal + glitch wavelets
if (data->SignalCBCFlag) data->signalFlag = 1; //cbc signal + signal wavelets
initialize_chain(chain,1);
reset_likelihood(data);
reset_priors(data, prior);
reset_model(data, chain, prior, model);
printf("characterizing cbc model...\n\n");
RJMCMC(data, model, bayesline, bayescbc, chain, prior, &data->logZsignal, &data->varZsignal);
//shut off signal model for checkpointing
data->cbcModelFlag = 0;
}
fprintf(evidence,"CBC %.12g %lg\n",data->logZsignal,data->varZsignal);
fflush(evidence);
/******************************************************************************/ /******************************************************************************/
/* */ /* */
/* Output log- and normalized evidence */ /* Output log- and normalized evidence */
......
...@@ -288,23 +288,26 @@ struct Data ...@@ -288,23 +288,26 @@ struct Data
int runPhase; // (0: cleaning, 1: not cleaning phase) int runPhase; // (0: cleaning, 1: not cleaning phase)
int noiseSimFlag; // REMOVE int noiseSimFlag; // REMOVE
int bayesLineFlag; // use BayesLine int bayesLineFlag; // use BayesLine
int bayesCBCFlag; // use BayesCBC
int stochasticFlag; // whether you use the stochastic model int stochasticFlag; // whether you use the stochastic model
// type of run modes available (uses a combination of the models below) // type of run modes available (uses a combination of the models below)
int fullModelFlag; int fullModelFlag;
int noiseModelFlag; int noiseModelFlag;
int glitchModelFlag; int glitchModelFlag;
int signalModelFlag; int signalModelFlag;
int cleanModelFlag; int cleanModelFlag;
int cleanOnlyFlag; int cbcModelFlag;
int cbcOnlyFlag; int GlitchCBCFlag;
int SignalCBCFlag;
int cleanOnlyFlag;
// models available // models available
int cleanFlag; int cleanFlag;
int glitchFlag; int glitchFlag;
int signalFlag; int signalFlag;
int noiseFlag; int noiseFlag;
int cbcFlag;
int skyFixFlag; //fix the sky location to the given values int skyFixFlag; //fix the sky location to the given values
......
...@@ -864,13 +864,11 @@ void print_run_flags(FILE *fptr, struct Data *data, struct Prior *prior) ...@@ -864,13 +864,11 @@ void print_run_flags(FILE *fptr, struct Data *data, struct Prior *prior)
fprintf(fptr, " signal model is .......... "); fprintf(fptr, " signal model is .......... ");
if(!data->signalFlag) fprintf(fptr, "DISABLED"); if(!data->signalFlag) fprintf(fptr, "DISABLED");
else if(!data->glitchFlag || data->cbcOnlyFlag) fprintf(fptr, "REQUIRED");
else fprintf(fptr, "ENABLED"); else fprintf(fptr, "ENABLED");
fprintf(fptr, "\n"); fprintf(fptr, "\n");
fprintf(fptr, " cbc model is ............. "); fprintf(fptr, " cbc model is ............. ");
if(!data->bayesCBCFlag) fprintf(fptr, "DISABLED"); if(!data->cbcModelFlag) fprintf(fptr, "DISABLED");
else if(data->cbcOnlyFlag) fprintf(fptr, "REQUIRED");
else fprintf(fptr, "ENABLED"); else fprintf(fptr, "ENABLED");
fprintf(fptr, "\n"); fprintf(fptr, "\n");
...@@ -961,6 +959,8 @@ void print_cbc_run_stats(FILE *fptr, struct Data *data, struct bayesCBC *bayescb ...@@ -961,6 +959,8 @@ void print_cbc_run_stats(FILE *fptr, struct Data *data, struct bayesCBC *bayescb
fprintf(fptr, " ============ BayesCBC Settings ===========\n"); fprintf(fptr, " ============ BayesCBC Settings ===========\n");
fprintf(fptr, " nr. semi-intrinsic params (NX) %i\n", bayescbc->NX); fprintf(fptr, " nr. semi-intrinsic params (NX) %i\n", bayescbc->NX);
//ADD INFO ABOUT WHETHER YOU ARE RUNNING WITH SIGNAL OR GLITCH
fprintf(fptr, " tidal version "); fprintf(fptr, " tidal version ");
if(bayescbc->NRTidal_version == NoNRT_V) fprintf(fptr,"NoNRT_V"); if(bayescbc->NRTidal_version == NoNRT_V) fprintf(fptr,"NoNRT_V");
else if(bayescbc->NRTidal_version == NRTidal_V) fprintf(fptr,"NRTidal_V"); else if(bayescbc->NRTidal_version == NRTidal_V) fprintf(fptr,"NRTidal_V");
...@@ -1012,7 +1012,7 @@ void print_chain_files(struct Data *data, struct Chain *chain, struct Model **mo ...@@ -1012,7 +1012,7 @@ void print_chain_files(struct Data *data, struct Chain *chain, struct Model **mo
} }
//print bayescbc parameters //print bayescbc parameters
if(data->bayesCBCFlag) if(data->cbcModelFlag)
{ {
print_cbc_model(chain->cbcChainFile[ic], bayescbc, chain->index[ic], data->Tobs); print_cbc_model(chain->cbcChainFile[ic], bayescbc, chain->index[ic], data->Tobs);
} }
...@@ -1045,7 +1045,7 @@ void flush_chain_files(struct Data *data, struct Chain *chain, int ic) ...@@ -1045,7 +1045,7 @@ void flush_chain_files(struct Data *data, struct Chain *chain, int ic)
} }
//flush cbc file //flush cbc file
if(data->bayesCBCFlag) fflush(chain->cbcChainFile[ic]); if(data->cbcModelFlag) fflush(chain->cbcChainFile[ic]);
} }
void print_model(FILE *fptr, struct Data *data, struct Chain *chain, struct Model *model) void print_model(FILE *fptr, struct Data *data, struct Chain *chain, struct Model *model)
...@@ -1443,7 +1443,9 @@ void parse_command_line(struct Data *data, struct Chain *chain, struct Prior *pr ...@@ -1443,7 +1443,9 @@ void parse_command_line(struct Data *data, struct Chain *chain, struct Prior *pr
//models off by default //models off by default
data->fullModelFlag = 0; data->fullModelFlag = 0;
data->cleanOnlyFlag = 0; data->cleanOnlyFlag = 0;
data->cbcOnlyFlag = 0; data->cbcModelFlag = 0;
data->GlitchCBCFlag = 0;
data->SignalCBCFlag = 0;
//assume the data are analyzable //assume the data are analyzable
data->loudGlitchFlag = 0; data->loudGlitchFlag = 0;
...@@ -1588,12 +1590,31 @@ void parse_command_line(struct Data *data, struct Chain *chain, struct Prior *pr ...@@ -1588,12 +1590,31 @@ void parse_command_line(struct Data *data, struct Chain *chain, struct Prior *pr
{ {
data->noiseModelFlag = 0; data->noiseModelFlag = 0;
data->glitchModelFlag = 0; data->glitchModelFlag = 0;
data->signalModelFlag = 1; data->signalModelFlag = 0;
data->fullModelFlag = 0; data->fullModelFlag = 0;
data->cbcOnlyFlag = 1; data->cbcModelFlag = 1;
data->bayesCBCFlag = 1; }
// TODO: This should also make fixIntrinsicParameters required ppt = LALInferenceGetProcParamVal(commandLine, "--GlitchCBC");
if(ppt)
{
data->noiseModelFlag = 0;
data->glitchModelFlag = 0;
data->signalModelFlag = 0;
data->fullModelFlag = 0;
data->cbcModelFlag = 1;
data->GlitchCBCFlag = 1;
}
ppt = LALInferenceGetProcParamVal(commandLine, "--SignalCBC");
if(ppt)
{
data->noiseModelFlag = 0;
data->glitchModelFlag = 0;
data->signalModelFlag = 0;
data->fullModelFlag = 0;
data->cbcModelFlag = 1;
data->SignalCBCFlag = 1;
} }
ppt = LALInferenceGetProcParamVal(commandLine, "--fullOnly"); ppt = LALInferenceGetProcParamVal(commandLine, "--fullOnly");
...@@ -1708,10 +1729,6 @@ void parse_command_line(struct Data *data, struct Chain *chain, struct Prior *pr ...@@ -1708,10 +1729,6 @@ void parse_command_line(struct Data *data, struct Chain *chain, struct Prior *pr
if(ppt) data->bayesLineFlag = 1; if(ppt) data->bayesLineFlag = 1;
else data->bayesLineFlag = 0; else data->bayesLineFlag = 0;
ppt = LALInferenceGetProcParamVal(commandLine, "--bayesCBC");
if(ppt) data->bayesCBCFlag = 1;
else data->bayesCBCFlag = 0;
ppt = LALInferenceGetProcParamVal(commandLine, "--bayesCBC-tidal"); ppt = LALInferenceGetProcParamVal(commandLine, "--bayesCBC-tidal");
data->NX = 7; data->NX = 7;
if(ppt) if(ppt)
......
...@@ -195,9 +195,9 @@ void recompute_residual(struct Data *data, struct Model **model, struct Chain *c ...@@ -195,9 +195,9 @@ void recompute_residual(struct Data *data, struct Model **model, struct Chain *c
for(i=0; i<data->N; i++) for(i=0; i<data->N; i++)
{ {
data->r[ifo][i] = data->s[ifo][i]; data->r[ifo][i] = data->s[ifo][i];
if(data->glitchFlag && !data->cbcOnlyFlag) data->r[ifo][i] -= model_x->glitch[ifo]->templates[i]; if(data->glitchFlag) data->r[ifo][i] -= model_x->glitch[ifo]->templates[i];
if(data->signalFlag && !data->cbcOnlyFlag) data->r[ifo][i] -= model_x->response[ifo][i]; if(data->signalFlag) data->r[ifo][i] -= model_x->response[ifo][i];
if(data->bayesCBCFlag) data->r[ifo][i] -= model_x->cbctemplate[ifo][i]; if(data->cbcModelFlag) data->r[ifo][i] -= model_x->cbctemplate[ifo][i];
} }
} }
...@@ -390,7 +390,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx ...@@ -390,7 +390,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx
} }
} }
if(data->bayesCBCFlag) if(data->cbcModelFlag)
{ {
//subtract current CBC model from residual //subtract current CBC model from residual
for(i=0; i<N; i++) for(i=0; i<N; i++)
...@@ -678,7 +678,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx ...@@ -678,7 +678,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx
r[ifo][j] -= ry[ifo][j]; r[ifo][j] -= ry[ifo][j];
r[ifo][k] -= ry[ifo][k]; r[ifo][k] -= ry[ifo][k];
} }
if(data->bayesCBCFlag) if(data->cbcModelFlag)
{ {
r[ifo][j] -= my->cbctemplate[ifo][j]; r[ifo][j] -= my->cbctemplate[ifo][j];
r[ifo][k] -= my->cbctemplate[ifo][k]; r[ifo][k] -= my->cbctemplate[ifo][k];
...@@ -704,7 +704,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx ...@@ -704,7 +704,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx
r[det][j] = s[det][j] - ry[det][j] - gy[det][j]; r[det][j] = s[det][j] - ry[det][j] - gy[det][j];
r[det][k] = s[det][k] - ry[det][k] - gy[det][k]; r[det][k] = s[det][k] - ry[det][k] - gy[det][k];
if (data->bayesCBCFlag) if (data->cbcModelFlag)
{ {
r[det][j] -= my->cbctemplate[det][j]; r[det][j] -= my->cbctemplate[det][j];
r[det][k] -= my->cbctemplate[det][k]; r[det][k] -= my->cbctemplate[det][k];
...@@ -760,7 +760,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx ...@@ -760,7 +760,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx
r[ifo][j] -= ry[ifo][j]; r[ifo][j] -= ry[ifo][j];
r[ifo][k] -= ry[ifo][k]; r[ifo][k] -= ry[ifo][k];
} }
if(data->bayesCBCFlag) if(data->cbcModelFlag)
{ {
r[ifo][j] -= my->cbctemplate[ifo][j]; r[ifo][j] -= my->cbctemplate[ifo][j];
r[ifo][k] -= my->cbctemplate[ifo][k]; r[ifo][k] -= my->cbctemplate[ifo][k];
...@@ -788,7 +788,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx ...@@ -788,7 +788,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx
r[det][j] = s[det][j] - ry[det][j] - gy[det][j]; r[det][j] = s[det][j] - ry[det][j] - gy[det][j];
r[det][k] = s[det][k] - ry[det][k] - gy[det][k]; r[det][k] = s[det][k] - ry[det][k] - gy[det][k];
if (data->bayesCBCFlag) if (data->cbcModelFlag)
{ {
r[det][j] -= my->cbctemplate[det][j]; r[det][j] -= my->cbctemplate[det][j];
r[det][k] -= my->cbctemplate[det][k]; r[det][k] -= my->cbctemplate[det][k];
...@@ -815,7 +815,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx ...@@ -815,7 +815,7 @@ double EvaluateMarkovianLogLikelihood(int typ, int ii, int det, struct Model *mx
{ {
r[ifo][i] -= ry[ifo][i]; r[ifo][i] -= ry[ifo][i];
} }
if(data->bayesCBCFlag) if(data->cbcModelFlag)
{ {
r[ifo][i] -= my->cbctemplate[ifo][i]; r[ifo][i] -= my->cbctemplate[ifo][i];
} }
...@@ -883,7 +883,7 @@ double EvaluateExtrinsicMarkovianLogLikelihood(struct Network *projection, doubl ...@@ -883,7 +883,7 @@ double EvaluateExtrinsicMarkovianLogLikelihood(struct Network *projection, doubl
//compute instrument response from cbc waveform at geocenter with extrinsic params //compute instrument response from cbc waveform at geocenter with extrinsic params
if(data->bayesCBCFlag) if(data->cbcModelFlag)
{ {
// for(i=0; i<NI; i++) for(n=0; n<N; n++) c[i][n] = 0.0; // for(i=0; i<NI; i++) for(n=0; n<N; n++) c[i][n] = 0.0;
projectCBCWaveform(amphase, N, NI, fmin, data->Tobs, params, c, projection->dtimes, projection->Fplus, projection->Fcross); projectCBCWaveform(amphase, N, NI, fmin, data->Tobs, params, c, projection->dtimes, projection->Fplus, projection->Fcross);
...@@ -895,9 +895,9 @@ double EvaluateExtrinsicMarkovianLogLikelihood(struct Network *projection, doubl ...@@ -895,9 +895,9 @@ double EvaluateExtrinsicMarkovianLogLikelihood(struct Network *projection, doubl
for(n=0; n<N; n++) for(n=0; n<N; n++)
{ {
r[ifo][n] = d[ifo][n]; r[ifo][n] = d[ifo][n];
if(data->signalFlag && !data->cbcOnlyFlag) r[ifo][n] -= h[ifo][n]; if(data->signalFlag) r[ifo][n] -= h[ifo][n];
if(data->glitchFlag && !data->cbcOnlyFlag) r[ifo][n] -= g[ifo][n]; if(data->glitchFlag) r[ifo][n] -= g[ifo][n];
if(data->bayesCBCFlag) r[ifo][n] -= c[ifo][n]; if(data->cbcModelFlag) r[ifo][n] -= c[ifo][n];
} }
logL += loglike(imin, imax, r[ifo], invSnf[ifo]); logL += loglike(imin, imax, r[ifo], invSnf[ifo]);
} }
...@@ -945,7 +945,7 @@ double EvaluateExtrinsicSearchLogLikelihood(struct Network *projection, double * ...@@ -945,7 +945,7 @@ double EvaluateExtrinsicSearchLogLikelihood(struct Network *projection, double *
waveformProject(data, projection, params, h, t, data->fmin, data->fmax); waveformProject(data, projection, params, h, t, data->fmin, data->fmax);
//compute instrument response from cbc waveform at geocenter with extrinsic params //compute instrument response from cbc waveform at geocenter with extrinsic params
if(data->bayesCBCFlag) if(data->cbcModelFlag)
{ {
projectCBCWaveform(amphase, N, NI, fmin, data->Tobs, params, c, projection->dtimes, projection->Fplus, projection->Fcross); projectCBCWaveform(amphase, N, NI, fmin, data->Tobs, params, c, projection->dtimes, projection->Fplus, projection->Fcross);
} }
...@@ -956,9 +956,9 @@ double EvaluateExtrinsicSearchLogLikelihood(struct Network *projection, double * ...@@ -956,9 +956,9 @@ double EvaluateExtrinsicSearchLogLikelihood(struct Network *projection, double *
for(n=0; n<N; n++) for(n=0; n<N; n++)
{ {
r[ifo][n] = d[ifo][n]; r[ifo][n] = d[ifo][n];
if(data->signalFlag && !data->cbcOnlyFlag) r[ifo][n] -= h[ifo][n]; if(data->signalFlag) r[ifo][n] -= h[ifo][n];
if(data->glitchFlag && !data->cbcOnlyFlag) r[ifo][n] -= g[ifo][n]; if(data->glitchFlag) r[ifo][n] -= g[ifo][n];
if(data->bayesCBCFlag) r[ifo][n] -= c[ifo][n]; if(data->cbcModelFlag) r[ifo][n] -= c[ifo][n];
} }
} }
...@@ -992,7 +992,7 @@ double EvaluateExtrinsicSearchLogLikelihood(struct Network *projection, double * ...@@ -992,7 +992,7 @@ double EvaluateExtrinsicSearchLogLikelihood(struct Network *projection, double *
waveformProject(data, projection, params, h, t, data->fmin, data->fmax); waveformProject(data, projection, params, h, t, data->fmin, data->fmax);
// compute instrument response from cbc waveform at geocenter with extrinsic params // compute instrument response from cbc waveform at geocenter with extrinsic params
if(data->bayesCBCFlag) if(data->cbcModelFlag)
{ {
projectCBCWaveform(amphase, N, NI, fmin, data->Tobs, params, c, projection->dtimes, projection->Fplus, projection->Fcross); projectCBCWaveform(amphase, N, NI, fmin, data->Tobs, params, c, projection->dtimes, projection->Fplus, projection->Fcross);
} }
...@@ -1003,9 +1003,9 @@ double EvaluateExtrinsicSearchLogLikelihood(struct Network *projection, double * ...@@ -1003,9 +1003,9 @@ double EvaluateExtrinsicSearchLogLikelihood(struct Network *projection, double *
for(n=0; n<N; n++) for(n=0; n<N; n++)
{ {
r[ifo][n] = d[ifo][n]; r[ifo][n] = d[ifo][n];
if(data->signalFlag && !data->cbcOnlyFlag) r[ifo][n] -= h[ifo][n]; if(data->signalFlag) r[ifo][n] -= h[ifo][n];
if(data->glitchFlag && !data->cbcOnlyFlag) r[ifo][n] -= g[ifo][n]; if(data->glitchFlag) r[ifo][n] -= g[ifo][n];
if(data->bayesCBCFlag) r[ifo][n] -= c[ifo][n]; if(data->cbcModelFlag) r[ifo][n] -= c[ifo][n];
} }
} }
logL = 0.0; logL = 0.0;
......
...@@ -344,9 +344,9 @@ static void restart_sampler(struct Data *data, struct Chain *chain, struct Prior ...@@ -344,9 +344,9 @@ static void restart_sampler(struct Data *data, struct Chain *chain, struct Prior
for(i=0; i<data->N; i++) for(i=0; i<data->N; i++)
{ {
data->r[ifo][i] = data->s[ifo][i]; data->r[ifo][i] = data->s[ifo][i];
if(data->signalFlag && !data->cbcOnlyFlag) data->r[ifo][i] -= model[ic]->response[ifo][i]; if(data->signalFlag) data->r[ifo][i] -= model[ic]->response[ifo][i];
if(data->glitchFlag && !data->cbcOnlyFlag) data->r[ifo][i] -= glitch[ifo]->templates[i]; if(data->glitchFlag) data->r[ifo][i] -= glitch[ifo]->templates[i];
if(data->bayesCBCFlag) data->r[ifo][i] -= model[ic]->cbctemplate[ifo][i]; if(data->cbcModelFlag) data->r[ifo][i] -= model[ic]->cbctemplate[ifo][i];
} }
if(!data->constantLogLFlag) if(!data->constantLogLFlag)
{ {
...@@ -407,7 +407,7 @@ static void restart_sampler(struct Data *data, struct Chain *chain, struct Prior ...@@ -407,7 +407,7 @@ static void restart_sampler(struct Data *data, struct Chain *chain, struct Prior
} }
//Parameters for reproducing CBC model //Parameters for reproducing CBC model
if(data->bayesCBCFlag) if(data->cbcModelFlag)
{ {
sprintf(filename,"chains/cbc_model.dat.%i",ic); sprintf(filename,"chains/cbc_model.dat.%i",ic);
chain->cbcChainFile[ic] = fopen(filename,"w"); chain->cbcChainFile[ic] = fopen(filename,"w");
...@@ -1025,7 +1025,7 @@ void RJMCMC(struct Data *data, struct Model **model, struct BayesLineParams ***b ...@@ -1025,7 +1025,7 @@ void RJMCMC(struct Data *data, struct Model **model, struct BayesLineParams ***b
print_run_stats(stdout, data, chain); print_run_stats(stdout, data, chain);
print_run_flags(stdout, data, prior); print_run_flags(stdout, data, prior);
if (data->bayesCBCFlag) print_cbc_run_stats(stdout, data, bayescbc); if (data->cbcModelFlag) print_cbc_run_stats(stdout, data, bayescbc);
int N = data->N; int N = data->N;
int NI = data->NI; int NI = data->NI;
...@@ -1246,7 +1246,7 @@ void RJMCMC(struct Data *data, struct Model **model, struct BayesLineParams ***b ...@@ -1246,7 +1246,7 @@ void RJMCMC(struct Data *data, struct Model **model, struct BayesLineParams ***b
/******************************************************************************/ /******************************************************************************/
// BayesCBC model independent burnin // BayesCBC model independent burnin
if (data->runPhase && (data->signalFlag||data->glitchFlag||data->fullModelFlag) && data->bayesCBCFlag) if (data->runPhase && data->cbcModelFlag)
{ {
// Pass the most recent model parameters to BayesCBC structure // Pass the most recent model parameters to BayesCBC structure
...@@ -1318,16 +1318,16 @@ void RJMCMC(struct Data *data, struct Model **model, struct BayesLineParams ***b ...@@ -1318,16 +1318,16 @@ void RJMCMC(struct Data *data, struct Model **model, struct BayesLineParams ***b
chain->beta = 1./chain->temperature[ic]; chain->beta = 1./chain->temperature[ic];
//This function executes [cycle] intrinsic parameter updates for the geocenter signal(RJMCMC or MCMC) //This function executes [cycle] intrinsic parameter updates for the geocenter signal(RJMCMC or MCMC)
if(!data->fixIntrinsicFlag) EvolveIntrinsicParameters(data, prior, model, chain, tf, chain->seed, ic); if((data->glitchFlag || data->signalFlag) && !data->fixIntrinsicFlag) EvolveIntrinsicParameters(data, prior, model, chain, tf, chain->seed, ic);
//This function executes [cycle] extrinsic parameter updates, common to all geocenter wavelets. //This function executes [cycle] extrinsic parameter updates, common to all geocenter wavelets.
if((model[chain->index[ic]]->signal[0]->size>0 || data->bayesCBCFlag) && !data->fixExtrinsicFlag && chain->mc > 1) EvolveExtrinsicParameters(data, prior, model, chain, chain->seed, ic); if((model[chain->index[ic]]->signal[0]->size>0 || data->cbcModelFlag) && !data->fixExtrinsicFlag && chain->mc > 1) EvolveExtrinsicParameters(data, prior, model, chain, chain->seed, ic);
//update PSD with BayesLine //update PSD with BayesLine
if(data->bayesLineFlag) EvolveBayesLineParameters(data, model, bayesline, chain, prior, ic); if(data->bayesLineFlag) EvolveBayesLineParameters(data, model, bayesline, chain, prior, ic);
// Evolve BayesCBC // Evolve BayesCBC
if(data->bayesCBCFlag) EvolveBayesCBCParameters(data, model, bayescbc, chain, ic); if(data->cbcModelFlag) EvolveBayesCBCParameters(data, model, bayescbc, chain, ic);
} }
...@@ -1642,9 +1642,9 @@ void EvolveBayesLineParameters(struct Data *data, struct Model **model, struct B ...@@ -1642,9 +1642,9 @@ void EvolveBayesLineParameters(struct Data *data, struct Model **model, struct B
for(i=0; i<N; i++) for(i=0; i<N; i++)
{ {
data->r[ifo][i] = data->s[ifo][i]; data->r[ifo][i] = data->s[ifo][i];
if(data->signalFlag && !data->cbcOnlyFlag) data->r[ifo][i] -= model_x->response[ifo][i]; if(data->signalFlag) data->r[ifo][i] -= model_x->response[ifo][i];
if(data->glitchFlag && !data->cbcOnlyFlag) data->r[ifo][i] -= model_x->glitch[ifo]->templates[i];