Commit 7b4c60f8 authored by Ian Harry's avatar Ian Harry
Browse files

Make the output amplitude parameters option work, also add a placeholder for outputting distance

Original: 6bf8e8cbf1cc61f276fb9933d09feb21d690dd15
parent ada9c12e
......@@ -1796,6 +1796,19 @@ void coh_PTF_calculate_coherent_SNR(
continue;
}
snrData[currPointLoc] = sqrt(max_eigen);
if (params->storeAmpParams)
{
coh_PTF_calculate_rotated_vectors(params,PTFqVec,v1p,v2p,Fplus,Fcross,
timeOffsetPoints,eigenvecs,eigenvals,
params->numTimePoints,i,vecLength,vecLengthTwo,LAL_NUM_IFO);
for (j = 0 ; j < vecLengthTwo ; j++)
{
pValues[j]->data->data[currPointLoc] = \
v1p[j] / (pow(gsl_vector_get(eigenvals,j),0.5));
pValues[j+vecLengthTwo]->data->data[currPointLoc] = \
v2p[j] / (pow(gsl_vector_get(eigenvals,j),0.5));
}
}
}
else
{
......@@ -1856,8 +1869,10 @@ void coh_PTF_calculate_coherent_SNR(
{
for (j = 0 ; j < vecLengthTwo ; j++)
{
pValues[j]->data->data[currPointLoc] = v1p[j];
pValues[j+vecLengthTwo]->data->data[currPointLoc] = v2p[j];
pValues[j]->data->data[currPointLoc] = \
v1p[j] / (pow(gsl_vector_get(eigenvals,j),0.5));
pValues[j+vecLengthTwo]->data->data[currPointLoc] = \
v2p[j] / (pow(gsl_vector_get(eigenvals,j),0.5));
}
}
}
......@@ -2642,40 +2657,48 @@ MultiInspiralTable* coh_PTF_create_multi_event(
}
}
}
REAL8 sigmasqCorrFac, invSigmaCorrFac;
sigmasqCorrFac = ( (REAL8)fcTmplt->tmpltNorm);
sigmasqCorrFac *= ( (REAL8)params->tempCorrFac);
invSigmaCorrFac = 1. / pow(sigmasqCorrFac, 0.5);
if (pValues[0])
currEvent->amp_term_1 = pValues[0]->data->data[currPos];
currEvent->amp_term_1 = pValues[0]->data->data[currPos] * invSigmaCorrFac;
if (pValues[1])
currEvent->amp_term_2 = pValues[1]->data->data[currPos];
currEvent->amp_term_2 = pValues[1]->data->data[currPos] * invSigmaCorrFac;
if (pValues[2])
currEvent->amp_term_3 = pValues[2]->data->data[currPos];
currEvent->amp_term_3 = pValues[2]->data->data[currPos] * invSigmaCorrFac;
if (pValues[3])
currEvent->amp_term_4 = pValues[3]->data->data[currPos];
currEvent->amp_term_4 = pValues[3]->data->data[currPos] * invSigmaCorrFac;
/* If here, also populate distance and other parameters */
currEvent->distance = ( currEvent->amp_term_1*currEvent->amp_term_1 + \
currEvent->amp_term_2*currEvent->amp_term_2 + \
currEvent->amp_term_3*currEvent->amp_term_3 + \
currEvent->amp_term_4*currEvent->amp_term_4 );
currEvent->distance = pow(2. / currEvent->distance, 0.5);
if (pValues[4])
currEvent->amp_term_5 = pValues[4]->data->data[currPos];
currEvent->amp_term_5 = pValues[4]->data->data[currPos] * invSigmaCorrFac;
if (pValues[5])
currEvent->amp_term_6 = pValues[5]->data->data[currPos];
currEvent->amp_term_6 = pValues[5]->data->data[currPos] * invSigmaCorrFac;
if (pValues[6])
currEvent->amp_term_7 = pValues[6]->data->data[currPos];
currEvent->amp_term_7 = pValues[6]->data->data[currPos] * invSigmaCorrFac;
if (pValues[7])
currEvent->amp_term_8 = pValues[7]->data->data[currPos];
currEvent->amp_term_8 = pValues[7]->data->data[currPos] * invSigmaCorrFac;
if (pValues[8])
currEvent->amp_term_9 = pValues[8]->data->data[currPos];
currEvent->amp_term_9 = pValues[8]->data->data[currPos] * invSigmaCorrFac;
if (pValues[9])
currEvent->amp_term_10 = pValues[9]->data->data[currPos];
currEvent->amp_term_10 = pValues[9]->data->data[currPos] * invSigmaCorrFac;
/* Note that these two terms are only used for debugging
* at the moment. When they are used properly they will be
* moved into sane columns! For spin they give Amp*cos(Phi_0) and
* Amp*sin(Phi_0). For non spinning the second is 0 and the
* first is some arbitrary amplitude. */
* * at the moment. When they are used properly they will be
* * moved into sane columns! For spin they give Amp*cos(Phi_0) and
* * Amp*sin(Phi_0). For non spinning the second is 0 and the
* * first is some arbitrary amplitude. */
if (gammaBeta[0])
{
currEvent->g1quad = crectf( gammaBeta[0]->data->data[currPos], gammaBeta[1]->data->data[currPos] );
}
REAL8 sigmasqCorrFac;
sigmasqCorrFac = ( (REAL8)fcTmplt->tmpltNorm);
sigmasqCorrFac *= ( (REAL8)params->tempCorrFac);
if (snrComps[LAL_IFO_G1])
{
currEvent->snr_g = snrComps[LAL_IFO_G1]->data->
......
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