Maintenance will be performed on git.ligo.org, chat.ligo.org, containers.ligo.org, and docs.ligo.org starting 2 March 2020 at approximately 8am MST. It is expected to take around 10 minutes and will include a short period of downtime towards the end of the maintenance window. Please direct any comments, concerns, or questions to computing-help@igwn.org.

Commit f62e5c79 authored by John Douglas Veitch's avatar John Douglas Veitch

Initial running version

parent 1f4733d8
......@@ -17,16 +17,16 @@ struct integrand_args
double dist_integral(double rho_opt, double rho_match, double dist_min, double dist_max)
{
size_t limit=100;
size_t limit=1000;
double result,abserr;
gsl_function F;
gsl_integration_workspace *workspace = gsl_integration_workspace_alloc (limit);
F.function = &dist_snr_pdf;
struct integrand_args args = {rho_opt, rho_match};
struct integrand_args args = {.A=rho_opt, .B=rho_match};
F.params = &args;
gsl_integration_qag (&F, dist_min, dist_max, 0, 1e-6, limit, GSL_INTEG_GAUSS61, workspace, &result, &abserr);
gsl_integration_qag (&F, dist_min, dist_max, 0.1, 1e-6, limit, GSL_INTEG_GAUSS61, workspace, &result, &abserr);
gsl_integration_workspace_free(workspace);
return(result / (dist_max-dist_min));
}
......@@ -35,6 +35,7 @@ double dist_integral(double rho_opt, double rho_match, double dist_min, double d
double dist_snr_pdf(double dL, void *args)
{
struct integrand_args *a = (struct integrand_args *)args;
return exp(-a->A/dL/dL + a->B/dL)*dL*dL;
double result = exp(-a->A/dL/dL + a->B/dL)*dL*dL;
return result;
}
......@@ -1289,13 +1289,14 @@ LALInferenceModel *LALInferenceInitCBCModel(LALInferenceRunState *state) {
distanceVary = LALINFERENCE_PARAM_FIXED;
}
LALInferenceRegisterUniformVariableREAL8(state, model->params, "logdistance", log(Dinitial), log(Dmin), log(Dmax), distanceVary) ;
if(LALInferenceGetProcParamVal(commandLine,"--margdist"))
{
/* If using margdist, remove the distance parameters and add the ranges into the model params as a way of passing them in */
REAL8 a = log(Dmin), b=log(Dmax);
LALInferenceAddMinMaxPrior(model->params, "logdistance", &a, &b, LALINFERENCE_REAL8_t);
LALInferenceRemoveVariable(model->params, "logdistance");
}
else
LALInferenceRegisterUniformVariableREAL8(state, model->params, "logdistance", log(Dinitial), log(Dmin), log(Dmax), distanceVary) ;
LALInferenceRegisterUniformVariableREAL8(state, model->params, "polarisation", zero, psiMin, psiMax, LALINFERENCE_PARAM_LINEAR);
LALInferenceRegisterUniformVariableREAL8(state, model->params, "costheta_jn", zero, costhetaJNmin, costhetaJNmax,LALINFERENCE_PARAM_LINEAR);
......
......@@ -1209,7 +1209,7 @@ static REAL8 LALInferenceFusedFreqDomainLogLikelihood(LALInferenceVariables *cur
if(1){
double dist_min, dist_max;
LALInferenceGetMinMaxPrior(model->params, "logdistance", &dist_min, &dist_max);
double marg_l = dist_integral(OptimalSNR, 2.0*d_inner_h, exp(dist_min), exp(dist_max));
double marg_l = dist_integral(OptimalSNR*OptimalSNR, 2.0*d_inner_h, exp(dist_min), exp(dist_max));
loglikelihood = -D + log(marg_l);
}
......
......@@ -304,6 +304,8 @@ LALInferenceVariables *LALInferenceParseProposalArgs(LALInferenceRunState *runSt
ProcessParamsTable *command_line = runState->commandLine;
if(LALInferenceGetProcParamVal(command_line, "--margdist")) distance=0;
INT4 verbose = 0;
if (LALInferenceGetProcParamVal(command_line, "--verbose"))
verbose = 1;
......
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