Commit 19b70ae7 authored by Marcella Wijngaarden's avatar Marcella Wijngaarden

Add wavelet frequency prior cmd option

parent 6a8be6f5
Pipeline #172904 passed with stages
in 1 minute and 50 seconds
......@@ -1270,8 +1270,10 @@ void print_help_message(void)
fprintf(stdout," --Dmin minimum number of wavelets total (1)\n");
fprintf(stdout," --Dmax maximum number of wavelets per channel (100)\n");
fprintf(stdout," --fixD fix # of wavelets for signal/IFO. Overrides --Dmin,--Dmax\n");
fprintf(stdout," --Qmin maximum quality factor for wavelets (0.1)\n");
fprintf(stdout," --Qmin minimum quality factor for wavelets (0.1)\n");
fprintf(stdout," --Qmax maximum quality factor for wavelets (40)\n");
fprintf(stdout," --waveletFmin minimum frequency for wavelets \n");
fprintf(stdout," --waveletFmax maximum frequency for wavelets \n");
fprintf(stdout," --noWaveletPrior revert to uniform p(D)\n");
fprintf(stdout," --clusterPrior use metric-based clustering prior (BROKEN)\n");
fprintf(stdout," --clusterPath full path to cluster prior normalization files\n");
......
......@@ -240,6 +240,9 @@ struct Prior
double Snmin; // minimum spline amplitude
double Snmax; // maximum spline amplitude
double waveletFmin; // minimum frequency for the wavelets
double waveletFmax; // maximum frequency for the wavelets
double TFV; // time-frequency volume
double logTFV; // log of time-frequency volume
......
......@@ -951,6 +951,9 @@ void print_run_flags(FILE *fptr, struct Data *data, struct Prior *prior)
else fprintf(fptr, "DISABLED");
fprintf(fptr, "\n");
fprintf(fptr, " min f for wavelets is .... %.0fHz\n", prior->waveletFmin);
fprintf(fptr, " max f for wavelets is .... %.0fHz\n", prior->waveletFmax);
fprintf(fptr, "\n");
}
......@@ -1178,7 +1181,7 @@ void print_cbc_chain_model(FILE *fptr, struct bayesCBC *bayescbc, int ic, double
// The below is for recreating the QuickCBC allchain file units
// Used for testing (but perhaps not necessary after?)
if (bayescbc->verbose==1)
if (bayescbc->debug==1)
{
fprintf(bayescbc->chainA,"%d %e %e %e %e %e %e %e %e %e %e %e %e %e %e %e %e %e %e", bayescbc->mxc[2], bayescbc->logLx[ic], Mchirp, Mtot, chieff, bayescbc->pallx[ic][4], \
......@@ -1554,6 +1557,14 @@ void parse_command_line(struct Data *data, struct Chain *chain, struct Prior *pr
if(ppt) data->Qmax = atof(ppt->value);
else data->Qmax = 40.0;
ppt = LALInferenceGetProcParamVal(commandLine, "--waveletFmin");
if(ppt) prior->waveletFmin = atof(ppt->value);
else prior->waveletFmin = -1;
ppt = LALInferenceGetProcParamVal(commandLine, "--waveletFmax");
if(ppt) prior->waveletFmax = atof(ppt->value);
else prior->waveletFmax = -1;
ppt = LALInferenceGetProcParamVal(commandLine, "--tempMin");
if(ppt) chain->tempMin = (double)atof(ppt->value);
else chain->tempMin = 1.0;
......
......@@ -457,13 +457,20 @@ void initialize_priors(struct Data *data, struct Prior *prior, int omax)
Amax = 1e-18;
}
// Check if wavelet frequency prior range was given,
// otherwise use data fmin/fmax
if (prior->waveletFmin < 0 ) prior->waveletFmin = data->fmin;
if (prior->waveletFmax < 0 ) prior->waveletFmax = data->fmax;
//double dt = data->Tobs/(double)data->tsize;
double Qmin = data->Qmin;
double Qmax = data->Qmax;
double tmin = 0;//dt*(int)((data->Tobs/16.)/dt);
double tmax = data->Tobs;//-tmin;
double fmin = data->fmin;
double fmax = data->fmax;
double fmin = prior->waveletFmin;
double fmax = prior->waveletFmax;
double betamin = -1.0;
double betamax = 1.0;
......@@ -588,12 +595,17 @@ void reset_priors(struct Data *data, struct Prior *prior)
Amax = 1e-18;
}
// Check if wavelet frequency prior range was given,
// otherwise use data fmin/fmax
if (prior->waveletFmin < 0 ) prior->waveletFmin = data->fmin;
if (prior->waveletFmax < 0 ) prior->waveletFmax = data->fmax;
double Qmin = data->Qmin;
double Qmax = data->Qmax;
double tmin = 0;//dt*(int)((data->Tobs/16.)/dt);
double tmax = data->Tobs;//-tmin;
double fmin = data->fmin;
double fmax = data->fmax;
double fmin = prior->waveletFmin;
double fmax = prior->waveletFmax;
double betamin = -1.0;
double betamax = 1.0;
double offset;
......
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