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 1824a2ec authored by John Douglas Veitch's avatar John Douglas Veitch

Compute coherence when marginalising over distance

parent 3bed1ebd
......@@ -122,7 +122,7 @@ def as_array(table):
logParams=['logl','loglh1','loglh2','logll1','loglv1','deltalogl','deltaloglh1','deltalogll1','deltaloglv1','logw','logprior','logpost','nulllogl','chain_log_evidence','chain_delta_log_evidence','chain_log_noise_evidence','chain_log_bayes_factor']
#Parameters known to cbcBPP
relativePhaseParams=[ a+b+'_relative_phase' for a,b in combinations(['h1','l1','v1'],2)]
snrParams=['snr','optimal_snr','matched_filter_snr'] + ['%s_optimal_snr'%(i) for i in ['h1','l1','v1']] + ['%s_cplx_snr_amp'%(i) for i in ['h1','l1','v1']] + ['%s_cplx_snr_arg'%(i) for i in ['h1', 'l1', 'v1']] + relativePhaseParams
snrParams=['snr','optimal_snr','matched_filter_snr','coherence'] + ['%s_optimal_snr'%(i) for i in ['h1','l1','v1']] + ['%s_cplx_snr_amp'%(i) for i in ['h1','l1','v1']] + ['%s_cplx_snr_arg'%(i) for i in ['h1', 'l1', 'v1']] + relativePhaseParams
calAmpParams=['calamp_%s'%(ifo) for ifo in ['h1','l1','v1']]
calPhaseParams=['calpha_%s'%(ifo) for ifo in ['h1','l1','v1']]
calParams = calAmpParams + calPhaseParams
......
......@@ -1034,7 +1034,10 @@ static REAL8 LALInferenceFusedFreqDomainLogLikelihood(LALInferenceVariables *cur
sprintf(varname,"%s_cplx_snr_arg",dataPtr->name);
LALInferenceAddREAL8Variable(currentParams,varname,cplx_snr_phase,LALINFERENCE_PARAM_OUTPUT);
if(margdist )
{
model->ifo_loglikelihoods[ifo] = LALInferenceMarginalDistanceLogLikelihood(dist_min, dist_max, sqrt(this_ifo_S), 2.0*cabs(this_ifo_Rcplx)) ;
}
/* Clean up calibration if necessary */
if (!(calFactor == NULL)) {
XLALDestroyCOMPLEX16FrequencySeries(calFactor);
......@@ -1113,6 +1116,7 @@ static REAL8 LALInferenceFusedFreqDomainLogLikelihood(LALInferenceVariables *cur
loglikelihood -= D ;
REAL8 distance_maxl = 2.0*S/R;
LALInferenceAddVariable(currentParams, "distance_maxl", &distance_maxl, LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_OUTPUT);
}
break;
}
......@@ -1220,13 +1224,17 @@ static REAL8 LALInferenceFusedFreqDomainLogLikelihood(LALInferenceVariables *cur
{
OptimalSNR/=LALInferenceGetREAL8Variable(currentParams,"distance_maxl");
/* Adjust the snrs in the IFOs */
for(dataPtr=data;dataPtr;dataPtr=dataPtr->next)
REAL8 coherence=loglikelihood + D;
UINT4 ii;
for(dataPtr=data,ii=0;dataPtr;dataPtr=dataPtr->next,ii++)
{
char varname[VARNAME_MAX];
sprintf(varname,"%s_optimal_snr",dataPtr->name);
REAL8 *s = LALInferenceGetVariable(currentParams,varname);
if(s) *s/=LALInferenceGetREAL8Variable(currentParams,"distance_maxl");
coherence -= model->ifo_loglikelihoods[ii];
}
LALInferenceAddREAL8Variable(currentParams, "coherence", coherence, LALINFERENCE_PARAM_OUTPUT);
}
LALInferenceAddVariable(currentParams,"optimal_snr",&OptimalSNR,LALINFERENCE_REAL8_t,LALINFERENCE_PARAM_OUTPUT);
......
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