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

Fix SNRs when marginalising over time

parent 35992485
......@@ -833,15 +833,14 @@ static REAL8 LALInferenceFusedFreqDomainLogLikelihood(LALInferenceVariables *cur
}
}
d_inner_h += creal(this_ifo_d_inner_h);
// D gets the factor of 2 inside nullloglikelihood
// R gets a factor of 2 later, before entering the Bessel function
S += 0.5*this_ifo_s;
D += -dataPtr->nullloglikelihood;
Rcplx += 0.5*this_ifo_d_inner_h;
model->ifo_loglikelihoods[ifo] = creal(this_ifo_d_inner_h) - (0.5*this_ifo_s) + dataPtr->nullloglikelihood;
d_inner_h += creal(this_ifo_d_inner_h);
// D gets the factor of 2 inside nullloglikelihood
// R gets a factor of 2 later, before entering the Bessel function
S += 0.5*this_ifo_s;
D += -dataPtr->nullloglikelihood;
Rcplx += 0.5*this_ifo_d_inner_h;
model->ifo_loglikelihoods[ifo] = creal(this_ifo_d_inner_h) - (0.5*this_ifo_s) + dataPtr->nullloglikelihood;
switch(marginalisationflags)
{
......@@ -884,11 +883,13 @@ static REAL8 LALInferenceFusedFreqDomainLogLikelihood(LALInferenceVariables *cur
LALInferenceAddREAL8Variable(currentParams,varname,cplx_snr_phase,LALINFERENCE_PARAM_OUTPUT);
}
sprintf(varname,"%s_cplx_snr_arg",dataPtr->name);
REAL8 cplx_snr_phase = carg(this_ifo_d_inner_h);
LALInferenceAddREAL8Variable(currentParams,varname,cplx_snr_phase,LALINFERENCE_PARAM_OUTPUT);
}
else{
REAL8 *psd=&(dataPtr->oneSidedNoisePowerSpectrum->data->data[lower]);
REAL8 *psd=&(dataPtr->oneSidedNoisePowerSpectrum->data->data[lower]);
COMPLEX16 *dtilde=&(dataPtr->freqData->data->data[lower]);
COMPLEX16 *hptilde=&(model->freqhPlus->data->data[lower]);
COMPLEX16 *hctilde=&(model->freqhCross->data->data[lower]);
......@@ -1248,6 +1249,14 @@ static REAL8 LALInferenceFusedFreqDomainLogLikelihood(LALInferenceVariables *cur
if(margdist) /* If margdist enabled, scale snr to optimal distance */
{
OptimalSNR/=LALInferenceGetREAL8Variable(currentParams,"distance_maxl");
/* Adjust the snrs in the IFOs */
for(dataPtr=data;dataPtr;dataPtr=dataPtr->next)
{
char varname[VARNAME_MAX];
sprintf(varname,"%s_optimal_snr",dataPtr->name);
REAL8 *s = LALInferenceGetVariable(currentParams,varname);
if(s) *s/=LALInferenceGetREAL8Variable(currentParams,"distance_maxl");
}
}
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