Commit a615d21c authored by Carl-Johan Haster's avatar Carl-Johan Haster

Merge branch 'lalinference_spin_prior_o2' into 'lalinference_o2'

Fix spin tilt prior for lalinference_o2 branch

See merge request !604
parents f7640018 c5fa75f1
...@@ -473,22 +473,6 @@ REAL8 LALInferenceInspiralPrior(LALInferenceRunState *runState, LALInferenceVari ...@@ -473,22 +473,6 @@ REAL8 LALInferenceInspiralPrior(LALInferenceRunState *runState, LALInferenceVari
if(LALInferenceGetVariableVaryType(params,"declination")==LALINFERENCE_PARAM_LINEAR) if(LALInferenceGetVariableVaryType(params,"declination")==LALINFERENCE_PARAM_LINEAR)
logPrior+=log(fabs(cos(*(REAL8 *)LALInferenceGetVariable(params,"declination")))); logPrior+=log(fabs(cos(*(REAL8 *)LALInferenceGetVariable(params,"declination"))));
} }
if(LALInferenceCheckVariable(params,"tilt_spin1"))
{
LALInferenceParamVaryType vtype=LALInferenceGetVariableVaryType(params,"tilt_spin1");
if(vtype!=LALINFERENCE_PARAM_FIXED && vtype!=LALINFERENCE_PARAM_OUTPUT)
{
logPrior+=log(fabs(sin(*(REAL8 *)LALInferenceGetVariable(params,"tilt_spin1"))));
}
}
if(LALInferenceCheckVariable(params,"tilt_spin2"))
{
LALInferenceParamVaryType vtype=LALInferenceGetVariableVaryType(params,"tilt_spin2");
if(vtype!=LALINFERENCE_PARAM_FIXED && vtype!=LALINFERENCE_PARAM_OUTPUT)
{
logPrior+=log(fabs(sin(*(REAL8 *)LALInferenceGetVariable(params,"tilt_spin2"))));
}
}
if(LALInferenceCheckVariable(params,"logmc")) { if(LALInferenceCheckVariable(params,"logmc")) {
mc=exp(*(REAL8 *)LALInferenceGetVariable(params,"logmc")); mc=exp(*(REAL8 *)LALInferenceGetVariable(params,"logmc"));
...@@ -600,9 +584,9 @@ REAL8 LALInferenceInspiralPrior(LALInferenceRunState *runState, LALInferenceVari ...@@ -600,9 +584,9 @@ REAL8 LALInferenceInspiralPrior(LALInferenceRunState *runState, LALInferenceVari
if(volumetric_spins) if(volumetric_spins)
{ {
/* Volumetric prior marginalised onto z component */ /* Volumetric prior marginalised onto z component */
REAL8 a = LALInferenceGetREAL8Variable(params,"a_spin1"); REAL8 a = LALInferenceGetREAL8Variable(params,"a_spin2");
REAL8 a_max,a_min; REAL8 a_max,a_min;
LALInferenceGetMinMaxPrior(runState->priorArgs,"a_spin1",&a_min,&a_max); LALInferenceGetMinMaxPrior(runState->priorArgs,"a_spin2",&a_min,&a_max);
REAL8 V = (4./3.)*LAL_PI * (a_max*a_max*a_max); REAL8 V = (4./3.)*LAL_PI * (a_max*a_max*a_max);
logPrior+=log(fabs((3./4.)*(a_max*a_max - a*a)))-log(fabs(V)); logPrior+=log(fabs((3./4.)*(a_max*a_max - a*a)))-log(fabs(V));
......
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