4#define PROGRAM_NAME "lalapps_coh_PTF_inspiral"
5#define CVS_REVISION "$Revision$"
6#define CVS_SOURCE "$Source$"
7#define CVS_DATE "$Date$"
36 for (ui=0; ui < len; ui++)
45int main(
int argc,
char **argv)
59 INT8 *slideIDList,currSlideID;
67 REAL4FFTPlan *fwdplan = NULL;
68 REAL4FFTPlan *psdplan = NULL;
69 REAL4FFTPlan *revplan = NULL;
70 COMPLEX8FFTPlan *invplan = NULL;
80 INT4 numSpinTmplts = 0;
81 INT4 numNoSpinTmplts = 0;
84 INT4 startTemplate = -1;
85 INT4 stopTemplate = -1;
95 UINT4 ifoNumber,spinTemplate;
99 UINT4 *acceptPointList = NULL;
100 UINT4 numAcceptPoints;
109 REAL4 *timeOffsets,*slidTimeOffsets;
114 REAL4 *timeSlideVectors;
134 UINT4 subBankSize = 0;
138 UINT4 timeStepPoints = 0;
140 REAL4 **overlapCont = NULL;
141 REAL4 **snglOverlapCont = NULL;
206 PTFM,PTFN,PTFqVec,fwdplan);
214 fwdplan,psdplan,revplan,&timeSlideVectors,
startTime);
224 &time_slide_map_head,&segment_table_head,\
225 &longTimeSlideList,&shortTimeSlideList,\
242 timeDiff =
params->endTime.gpsSeconds -
params->startTime.gpsSeconds + 1;
245 for (
i = 0; (
i < (
INT4) (timeDiff*
params->numShortSlides));
i++)
274 segments,Fplustrig,Fcrosstrig,timeOffsets,\
275 fwdplan,revplan,psdplan,timeSlideVectors,
startTime);
283 for(ifoNumber = 0; ifoNumber < (
LAL_NUM_IFO+1); ifoNumber++)
301 params->spinBankName,startTemplate, stopTemplate);
302 if (numSpinTmplts != 0)
304 PTFtemplate = PTFSpinTemplate;
315 params->noSpinBankName,startTemplate, stopTemplate);
316 if (numNoSpinTmplts != 0)
318 PTFtemplate = PTFNoSpinTemplate;
328 for (
i = 0; (
i < numNoSpinTmplts); PTFtemplate = PTFtemplate->
next,
i++)
330 if (
i == (numNoSpinTmplts - 1))
332 PTFtemplate->
next = PTFSpinTemplate;
333 numTmplts = numSpinTmplts + numNoSpinTmplts;
336 PTFtemplate = PTFNoSpinTemplate;
338 PTFbankhead = PTFtemplate;
345 params->lowTemplateFrequency,&cohSNR,&nullSNR,&traceSNR,bankVeto,\
346 autoVeto,chiSquare,snrComps,pValues,gammaBeta,numSpinTmplts);
351 for (ifoNumber = 0; ifoNumber <
LAL_NUM_IFO; ifoNumber++)
353 overlapCont[ifoNumber] = NULL;
354 snglOverlapCont[ifoNumber] = NULL;
355 if (
params->haveTrig[ifoNumber])
357 snglAcceptPoints[ifoNumber] = \
358 LALCalloc(
params->numAnalPointsBuf,
sizeof(
UINT4));
374 &bankOverlaps,&dataOverlaps,&bankFcTmplts,fcTmplt,fcTmpltParams,\
399 PTFtemplate = PTFbankhead;
402 for (ifoNumber = 0; ifoNumber <
LAL_NUM_IFO; ifoNumber++)
404 if (
params->haveTrig[ifoNumber])
441 if (
i >= numNoSpinTmplts)
455 for (uj = 0 ; uj < (
numPoints/2 +1) ; uj++)
462 verbose(
"Generated spin template %d at %ld\n",\
465 verbose(
"Generated nospin template %d at %ld\n",\
470 cohSNR,nullSNR,traceSNR,bankVeto,\
471 autoVeto,chiSquare,snrComps,pValues,gammaBeta,numSpinTmplts);
472 verbose(
"Initialized storage arrays for segment %d at %ld\n",\
477 PTFqVec,snrComps,snglAcceptPoints,snglAcceptCount,segments,\
478 invplan,spinTemplate,
j);
479 verbose(
"Calculated sngl filters for segment %d template %d at %ld\n",\
486 fcTmplt,invspec,bankOverlaps);
487 verbose(
"Calculated bank-veto filters for template %d at %ld\n",\
495 autoTempOverlaps,invspec,invplan,timeStepPoints);
496 verbose(
"Calculated auto-veto filters for template %d at %ld\n",\
504 PTFqVec,segments,invplan,spinTemplate,
j);
506 "Calculated null stream filters for segment %d template %d at %ld\n",\
510 verbose(
"Begin loop over sky points at %ld \n",
524 for (slideNum = 0; slideNum <
params->numShortSlides ; slideNum++)
531 for(ifoNumber = 0; ifoNumber <
LAL_NUM_IFO; ifoNumber++)
533 if (
params->haveTrig[ifoNumber])
535 slidTimeOffsets[ifoNumber] = timeOffsets[ifoNumber] + \
536 shortTimeSlideList[slideNum].timeSlideVectors[ifoNumber];
540 slidTimeOffsets[ifoNumber] = 0;
544 currSlideID = slideIDList[
j]*
params->numShortSlides;
545 currSlideID += shortTimeSlideList[slideNum].
timeSlideID;
550 params->faceOnStatistic = 1;
557 slidTimeOffsets, Fplus, Fcross,
558 j, pValues, gammaBeta, snrComps, nullSNR,
559 traceSNR, bankVeto, autoVeto,
560 chiSquare, subBankSize, bankOverlaps,
561 bankNormOverlaps, dataOverlaps, autoTempOverlaps,
562 fcTmplt, invspec, segments, invplan,
563 &chisqOverlaps,&chisqSnglOverlaps, frequencyRangesPlus,
564 frequencyRangesCross, overlapCont, snglOverlapCont,
566 shortTimeSlideList[slideNum].analStartPoint,
567 shortTimeSlideList[slideNum].analEndPoint,\
568 snglAcceptPoints,snglAcceptCount,acceptPointList);
570 verbose(
"Made coherent statistic for segment %d, template %d, "
571 "sky point %d at %ld \n",
j,
i, sp,
575 params->analStartPoint;
576 currAnalEnd = shortTimeSlideList[slideNum].
analEndPoint - \
577 params->analStartPoint;
580 if (!
params->writeSnglInspiralTable)
583 cohSNR, fcTmplt, *PTFtemplate, eventId,
585 pValues, gammaBeta, snrComps,
586 nullSNR, traceSNR, bankVeto,
587 autoVeto, chiSquare,
PTFM,
590 currSlideID, slidTimeOffsets,
591 acceptPointList,numAcceptPoints,
593 params->startTime.gpsSeconds);
598 &snglThisEvent,cohSNR,fcTmplt,*PTFtemplate,eventId,\
599 pValues,bankVeto,autoVeto,chiSquare,
PTFM,\
600 currAnalStart,currAnalEnd);
606 params->faceOnStatistic = 2;
610 slidTimeOffsets, Fplus, Fcross,
611 j, pValues, gammaBeta, snrComps, nullSNR,
612 traceSNR, bankVeto, autoVeto,
613 chiSquare, subBankSize, bankOverlaps,
614 bankNormOverlaps, dataOverlaps, autoTempOverlaps,
615 fcTmplt, invspec, segments, invplan,
616 &chisqOverlaps,&chisqSnglOverlaps, frequencyRangesPlus,
617 frequencyRangesCross, overlapCont, snglOverlapCont,
619 shortTimeSlideList[slideNum].analStartPoint,
620 shortTimeSlideList[slideNum].analEndPoint,\
621 snglAcceptPoints,snglAcceptCount,acceptPointList);
623 verbose(
"Made coherent statistic for segment %d, template %d, "
624 "sky point %d at %ld \n",
j,
i, sp,
628 cohSNR, fcTmplt, *PTFtemplate, eventId,
630 pValues, gammaBeta, snrComps,
631 nullSNR, traceSNR, bankVeto,
632 autoVeto, chiSquare,
PTFM,
635 currSlideID, slidTimeOffsets,
636 acceptPointList,numAcceptPoints,
638 params->startTime.gpsSeconds);
643 if (!
params->writeSnglInspiralTable)
646 timeDiff*
params->numShortSlides);
652 verbose(
"There are currently %d triggers.\n",
params->numEvents);
662 for(uj = 0; uj < 2*
params->numChiSquareBins; uj++)
666 if (chisqOverlaps[uj].PTFqVec[
k])
673 chisqOverlaps = NULL;
675 if (chisqSnglOverlaps)
677 for(uj = 0; uj <
params->numChiSquareBins; uj++)
681 if (chisqSnglOverlaps[uj].PTFqVec[
k])
688 chisqSnglOverlaps = NULL;
690 for(ifoNumber = 0; ifoNumber <
LAL_NUM_IFO+1; ifoNumber++)
692 if (frequencyRangesPlus[ifoNumber])
694 LALFree(frequencyRangesPlus[ifoNumber]);
695 frequencyRangesPlus[ifoNumber] = NULL;
697 if (frequencyRangesCross[ifoNumber])
699 LALFree(frequencyRangesCross[ifoNumber]);
700 frequencyRangesCross[ifoNumber] = NULL;
703 for(ifoNumber = 0; ifoNumber <
LAL_NUM_IFO; ifoNumber++)
705 if (overlapCont[ifoNumber])
707 LALFree(overlapCont[ifoNumber]);
708 overlapCont[ifoNumber] = NULL;
710 if (snglOverlapCont[ifoNumber])
712 LALFree(snglOverlapCont[ifoNumber]);
713 snglOverlapCont[ifoNumber] = NULL;
722 if (!
params->writeSnglInspiralTable)
725 timeDiff*
params->numShortSlides);
732 verbose(
"There are %d total triggers before cluster.\n",
params->numEvents);
733 if (
params->clusterFlag )
735 if (!
params->writeSnglInspiralTable)
738 params->numShortSlides, timeDiff);
746 verbose(
"There are %d total triggers after cluster.\n",
params->numEvents);
751 params->injectList, procpar, time_slide_head,\
752 time_slide_map_head, segment_table_head,
params);
756 chiSquare,pValues,gammaBeta,snrComps);
759 invspec,segments,finalEvents,snglEventList,\
760 PTFbankhead,fcTmplt,fcTmpltParams,
761 PTFM,PTFN,PTFqVec,timeOffsets,slidTimeOffsets,Fplus,Fcross,\
762 Fplustrig,Fcrosstrig,
skyPoints,time_slide_head,longTimeSlideList,
763 shortTimeSlideList,timeSlideVectors,
detectors, slideIDList,\
764 time_slide_map_head,segment_table_head);
768 dataOverlaps,autoTempOverlaps);
771 for (ifoNumber = 0; ifoNumber <
LAL_NUM_IFO; ifoNumber++)
773 if (
params->haveTrig[ifoNumber])
775 LALFree(snglAcceptPoints[ifoNumber]);
780 verbose(
"Generated output xml file, cleaning up and exiting at %ld \n",
816 COMPLEX8FFTPlan *invPlan,
819 REAL4 *frequencyRangesPlus[LAL_NUM_IFO+1],
820 REAL4 *frequencyRangesCross[LAL_NUM_IFO+1],
822 REAL4 **snglOverlapCont,
823 struct timeval startTime,
826 UINT4 **snglAcceptPoints,
827 UINT4 *snglAcceptCount,
828 UINT4 *acceptPointList
832 verbose(
"Entering the statistic loop at %ld \n",
839 UINT4 csVecLength,csVecLengthTwo;
840 UINT4 i,
j,
k, vecLength, vecLengthTwo;
846 UINT4 currPointLoc,numAcceptPoints;
848 gsl_matrix *eigenvecs,*eigenvecsNull,*Autoeigenvecs;
849 gsl_vector *eigenvals,*eigenvalsNull,*Autoeigenvals;
851 eigenvecsNull = NULL;
852 Autoeigenvecs = NULL;
854 eigenvalsNull = NULL;
855 Autoeigenvals = NULL;
859 gsl_matrix *Bankeigenvecs[50];
860 gsl_vector *Bankeigenvals[50];
872 vecLengthTwo = vecLength;
874 vecLengthTwo = 2* vecLength;
882 Autoeigenvals = NULL;
883 bankCohOverlaps = NULL;
884 autoCohOverlaps = NULL;
885 for (
i = 0;
i < 50;
i++)
887 Bankeigenvecs[
i] = NULL;
888 Bankeigenvals[
i] = NULL;
892 powerBinsPlus[
i] = NULL;
893 powerBinsCross[
i] = NULL;
895 eigenvecs = gsl_matrix_alloc(vecLengthTwo,vecLengthTwo);
896 eigenvals = gsl_vector_alloc(vecLengthTwo);
897 eigenvecsNull = gsl_matrix_alloc(vecLength,vecLength);
898 eigenvalsNull = gsl_vector_alloc(vecLength);
916 vecLength,vecLengthTwo,vecLength);
941 segStartPoint =
params->analStartPoint;
942 segEndPoint =
params->analEndPoint;
950 timeOffsetPoints,
PTFqVec,Fplus,Fcross,\
951 eigenvecs,eigenvals,segStartPoint,segEndPoint,\
952 vecLength,vecLengthTwo,spinTemplate,\
953 snglAcceptPoints,snglAcceptCount);
957 numPointCheck = floor(
params->timeWindow/cohSNR->
deltaT + 0.5);
960 cohSNR,acceptPointList,timeOffsetPoints,\
962 segStartPoint -
params->analStartPoint,\
963 segEndPoint -
params->analStartPoint,\
964 snglAcceptPoints,snglAcceptCount);
972 for (
j = 0;
j < numAcceptPoints; ++
j)
974 currPointLoc = acceptPointList[
j];
975 i = currPointLoc +
params->analStartPoint;
977 if (snrData[currPointLoc])
983 eigenvecsNull,eigenvalsNull,spinTemplate,vecLength,
i,\
991 eigenvals,Fplus,Fcross,timeOffsetPoints,spinTemplate,vecLength,\
992 vecLengthTwo,
i,currPointLoc);
1006 &bankCohOverlaps,bankOverlaps,Fplus,Fcross,PTFM,\
1007 bankNormOverlaps,csVecLength,csVecLengthTwo,vecLength);
1010 bankVeto[
LAL_NUM_IFO]->data->data[currPointLoc] = \
1011 coh_PTF_calculate_bank_veto(
params->numTimePoints,
i,subBankSize,\
1012 Fplus,Fcross,
params,bankCohOverlaps,NULL,dataOverlaps,NULL,\
1013 PTFqVec,NULL,timeOffsetPoints,Bankeigenvecs,Bankeigenvals,\
1018 if (
params->doSnglChiSquared)
1024 bankVeto[
k]->data->data[currPointLoc] = \
1025 coh_PTF_calculate_bank_veto(
params->numTimePoints,
i,\
1026 subBankSize,Fplus,Fcross,
params,NULL,bankOverlaps,\
1027 dataOverlaps,bankNormOverlaps,
PTFqVec,PTFM,\
1028 timeOffsetPoints,NULL,NULL,
k,1,1);
1042 &autoCohOverlaps,autoTempOverlaps,Fplus,Fcross,PTFM,\
1043 csVecLength,csVecLengthTwo,vecLength);
1045 autoVeto[
LAL_NUM_IFO]->data->data[currPointLoc] = \
1046 coh_PTF_calculate_auto_veto(
params->numTimePoints,
i,Fplus,Fcross,\
1048 Autoeigenvecs,Autoeigenvals,
LAL_NUM_IFO,csVecLength,\
1052 if (
params->doSnglChiSquared)
1058 autoVeto[
k]->data->data[currPointLoc] = \
1059 coh_PTF_calculate_auto_veto(
params->numTimePoints,
i,Fplus,\
1061 timeOffsetPoints,NULL,NULL,
k,1,1);
1076 for (
j = 0;
j < numAcceptPoints; ++
j)
1078 currPointLoc = acceptPointList[
j];
1079 i = currPointLoc +
params->analStartPoint;
1080 if (snrData[currPointLoc])
1083 if (
params->chiSquareCalcThreshold)
1089 autoVeto,currPointLoc ) )
1091 chiSquare[
LAL_NUM_IFO]->data->data[currPointLoc] = 0;
1109 &Autoeigenvals,frequencyRangesPlus,frequencyRangesCross,\
1110 powerBinsPlus,powerBinsCross,overlapCont,&chisqOverlaps,fcTmplt,\
1111 invspec,segments,Fplus,Fcross,PTFM,invPlan,segmentNumber,\
1112 csVecLength,csVecLengthTwo,vecLength);
1115 chiSquare[
LAL_NUM_IFO]->data->data[currPointLoc] = \
1116 coh_PTF_calculate_chi_square(
params,
i,chisqOverlaps,\
1117 PTFqVec,NULL,Fplus,Fcross,timeOffsetPoints,Autoeigenvecs,\
1122 if (
params->doSnglChiSquared)
1128 frequencyRangesCross,powerBinsPlus,powerBinsCross,\
1129 snglOverlapCont,&chisqSnglOverlaps,fcTmplt,invspec,segments,\
1130 PTFM,invPlan,segmentNumber);
1136 chiSquare[
k]->data->data[currPointLoc] = \
1137 coh_PTF_calculate_chi_square(
params,
i,\
1138 chisqSnglOverlaps,
PTFqVec,PTFM,Fplus,Fcross,\
1139 timeOffsetPoints,NULL,NULL,powerBinsPlus[
k],\
1140 powerBinsCross[
k],
k,1,1);
1153 for (
j = 0 ;
j < subBankSize+1 ;
j++)
1155 if (Bankeigenvecs[
j])
1156 gsl_matrix_free(Bankeigenvecs[
j]);
1157 if (Bankeigenvals[
j])
1158 gsl_vector_free(Bankeigenvals[
j]);
1160 if (bankCohOverlaps)
1162 for (
j = 0 ;
j < subBankSize ;
j++)
1164 gsl_matrix_free(bankCohOverlaps[
j].rotReOverlaps);
1165 gsl_matrix_free(bankCohOverlaps[
j].rotImOverlaps);
1174 gsl_matrix_free(Autoeigenvecs);
1175 Autoeigenvecs = NULL;
1177 gsl_vector_free(Autoeigenvals);
1178 Autoeigenvals = NULL;
1179 if (autoCohOverlaps)
1181 for (
j = 0 ;
j <
params->numAutoPoints ;
j++)
1183 gsl_matrix_free(autoCohOverlaps[
j].rotReOverlaps);
1184 gsl_matrix_free(autoCohOverlaps[
j].rotImOverlaps);
1193 gsl_matrix_free(Autoeigenvecs);
1195 gsl_vector_free(Autoeigenvals);
1198 if (powerBinsPlus[
k])
1200 if (powerBinsCross[
k])
1207 gsl_matrix_free(eigenvecs);
1208 gsl_vector_free(eigenvals);
1209 gsl_matrix_free(eigenvecsNull);
1210 gsl_vector_free(eigenvalsNull);
1212 *chisqOverlapsP = chisqOverlaps;
1213 *chisqSnglOverlapsP = chisqSnglOverlaps;
1215 verbose(
"-->Completed memory cleanup and exiting loop at %ld \n",\
1218 return numAcceptPoints;
1239 REAL4 rightAscension,
1243 UINT4 *acceptPointList,
1244 UINT4 numAcceptPoints,
1253 UINT4 currTimeDiff, currStorageID;
1260 for (
j = 0;
j < numAcceptPoints; ++
j)
1262 i = acceptPointList[
j];
1266 &eventId,spinTrigger,pValues,gammaBeta,snrComps,nullSNR,traceSNR,\
1267 bankVeto,autoVeto,chiSquare,PTFM,rightAscension,declination,slideId,\
1268 timeOffsetPoints,
i);
1280 currStorageID = timeDiff * slideNum + currTimeDiff;
1282 if (!eventList[currStorageID])
1284 eventList[currStorageID] = currEvent;
1285 thisEvent[currStorageID] = currEvent;
1289 lastEvent = thisEvent[currStorageID];
1290 if (!
params->clusterFlag)
1292 lastEvent->
next = currEvent;
1293 thisEvent[currStorageID] = currEvent;
1296 timeDiff, currTimeDiff,
1299 lastEvent->
next = currEvent;
1300 thisEvent[currStorageID] = currEvent;
1320 UINT4 slideNum, currTimeDiff, currStorageID;
1321 UINT4 triggerNum, lenTriggers;
1322 UINT4 **rejectTriggers;
1323 rejectTriggers =
LALCalloc(1, numSlides*timeDiff*
sizeof(
UINT4*));
1329 for (slideNum = 0; slideNum < numSlides; slideNum++)
1331 for (currTimeDiff = 0; currTimeDiff < (
UINT4)timeDiff; currTimeDiff++)
1333 currStorageID = timeDiff * slideNum + currTimeDiff;
1335 currEvent = eventList[currStorageID];
1344 currEvent = currEvent->
next;
1347 currEvent = eventList[currStorageID];
1348 rejectTriggers[currStorageID] =
LALCalloc(1, lenTriggers*
sizeof(
UINT4));
1355 timeDiff, currTimeDiff,
1358 rejectTriggers[currStorageID][triggerNum] = 0;
1363 rejectTriggers[currStorageID][triggerNum] = 1;
1366 currEvent = currEvent->
next;
1372 for (slideNum = 0; slideNum < numSlides; slideNum++)
1374 for (currTimeDiff = 0; currTimeDiff < (
UINT4)timeDiff; currTimeDiff++)
1377 currStorageID = timeDiff * slideNum + currTimeDiff;
1378 currEvent = eventList[currStorageID];
1382 if (! rejectTriggers[currStorageID][triggerNum])
1384 if (! *newEventHead)
1386 *newEventHead = currEvent;
1387 newEvent = currEvent;
1391 newEvent->
next = currEvent;
1392 newEvent = currEvent;
1394 currEvent = currEvent->
next;
1398 currEvent2 = currEvent->
next;
1400 currEvent = currEvent2;
1404 LALFree(rejectTriggers[currStorageID]);
1412 newEvent->
next = NULL;
1427 UINT4 loudTrigBefore=0,loudTrigAfter=0;
1434 for (checkOffset=-1; checkOffset < 2; checkOffset++)
1436 if ((currTimeDiff + checkOffset) == 0)
1440 if ((
INT4)(currTimeDiff + checkOffset) == timeDiff)
1445 currEvent = eventList[currStorageID+checkOffset];
1456 if (fabs(GPSDiff) <
params->clusterWindow)
1460 if (thisEvent.
snr < currEvent->
snr\
1466 else if ( GPSDiff < 0 )
1471 if (loudTrigBefore && loudTrigAfter)
1479 currEvent = currEvent->
next;
int InspiralTmpltBankFromLIGOLw(InspiralTemplate **bankHead, const CHAR *fileName, INT4 startTmplt, INT4 stopTmplt)
void LALCheckMemoryLeaks(void)
void coh_PTF_initialize_time_series(struct coh_PTF_params *params, LIGOTimeGPS segStartTime, REAL8 fLower, REAL4TimeSeries **cohSNRP, REAL4TimeSeries **nullSNRP, REAL4TimeSeries **traceSNRP, REAL4TimeSeries **bankVeto, REAL4TimeSeries **autoVeto, REAL4TimeSeries **chiSquare, REAL4TimeSeries **snrComps, REAL4TimeSeries **pValues, REAL4TimeSeries **gammaBeta, UINT4 spinTemplates)
int coh_PTF_output_events_xml(char *outputFile, MultiInspiralTable *events, SnglInspiralTable *snglEvents, SimInspiralTable *injections, ProcessParamsTable *processParamsTable, TimeSlide *time_slide_head, TimeSlideSegmentMapTable *time_slide_map_head, SegmentTable *segment_table_head, struct coh_PTF_params *params)
void coh_PTF_chi_square_sngl_setup(struct coh_PTF_params *params, REAL4 **frequencyRangesPlus, REAL4 **frequencyRangesCross, REAL4 **powerBinsPlus, REAL4 **powerBinsCross, REAL4 **overlapCont, struct bankDataOverlaps **chisqSnglOverlapsP, FindChirpTemplate *fcTmplt, REAL4FrequencySeries **invspec, RingDataSegments **segments, REAL8Array **PTFM, COMPLEX8FFTPlan *invPlan, INT4 segmentNumber)
void coh_PTF_set_null_input_REAL4(REAL4 **array, UINT4 length)
REAL4FFTPlan * coh_PTF_get_fft_revplan(struct coh_PTF_params *params)
void coh_PTF_calculate_bank_veto_template_filters(struct coh_PTF_params *params, FindChirpTemplate *bankFcTmplts, FindChirpTemplate *fcTmplt, REAL4FrequencySeries **invspec, struct bankComplexTemplateOverlaps *bankOverlaps)
void coh_PTF_create_time_slide_table(struct coh_PTF_params *params, INT8 *slideIDList, RingDataSegments **segments, TimeSlide **time_slide_headP, TimeSlideSegmentMapTable **time_slide_map_headP, SegmentTable **segment_table_headP, TimeSlideVectorList **longTimeSlideListP, TimeSlideVectorList **shortTimeSlideListP, REAL4 *timeSlideVectors, INT4 numSegments)
void coh_PTF_convert_time_offsets_to_points(struct coh_PTF_params *params, REAL4 *timeOffsets, INT4 *timeOffsetPoints)
void coh_PTF_setup_null_stream(struct coh_PTF_params *params, REAL4TimeSeries **channel, REAL4FrequencySeries **invspec, RingDataSegments **segments, REAL4 *Fplustrig, REAL4 *Fcrosstrig, REAL4 *timeOffsets, REAL4FFTPlan *fwdplan, REAL4FFTPlan *revplan, REAL4FFTPlan *psdplan, REAL4 *timeSlideVectors, struct timeval startTime)
void coh_PTF_calculate_single_detector_filters(struct coh_PTF_params *params, FindChirpTemplate *fcTmplt, REAL4FrequencySeries **invspec, REAL8Array **PTFM, COMPLEX8VectorSequence **PTFqVec, REAL4TimeSeries **snrComps, UINT4 **snglAcceptPoints, UINT4 *snglAcceptCount, RingDataSegments **segments, COMPLEX8FFTPlan *invPlan, UINT4 spinTemplate, UINT4 segNum)
UINT4 coh_PTF_trig_time_check(struct coh_PTF_params *params, LIGOTimeGPS segStartTime, LIGOTimeGPS segEndTime)
void coh_PTF_calculate_null_stream_snr(struct coh_PTF_params *params, REAL4TimeSeries *nullSNR, COMPLEX8VectorSequence **PTFqVec, gsl_matrix *eigenvecsNull, gsl_vector *eigenvalsNull, UINT4 spinTemplate, UINT4 vecLength, UINT4 vecLoc, UINT4 snrLoc)
void coh_PTF_bank_veto_coh_setup(struct coh_PTF_params *params, gsl_matrix **Bankeigenvecs, gsl_vector **Bankeigenvals, struct bankCohTemplateOverlaps **bankCohOverlapsP, struct bankComplexTemplateOverlaps *bankOverlaps, REAL4 *Fplus, REAL4 *Fcross, REAL8Array **PTFM, struct bankTemplateOverlaps *bankNormOverlaps, UINT4 csVecLength, UINT4 csVecLengthTwo, UINT4 vecLength)
void coh_PTF_destroy_time_series(REAL4TimeSeries *cohSNR, REAL4TimeSeries *nullSNR, REAL4TimeSeries *traceSNR, REAL4TimeSeries **bankVeto, REAL4TimeSeries **autoVeto, REAL4TimeSeries **chiSquare, REAL4TimeSeries **pValues, REAL4TimeSeries **gammaBeta, REAL4TimeSeries **snrComps)
UINT8 coh_PTF_add_sngl_triggers(struct coh_PTF_params *params, SnglInspiralTable **eventList, SnglInspiralTable **thisEvent, REAL4TimeSeries *cohSNR, FindChirpTemplate *fcTmplt, InspiralTemplate PTFTemplate, UINT8 eventId, REAL4TimeSeries **pValues, REAL4TimeSeries **bankVeto, REAL4TimeSeries **autoVeto, REAL4TimeSeries **chiSquare, REAL8Array **PTFM, UINT4 startPoint, UINT4 endPoint)
void coh_PTF_auto_veto_coh_setup(struct coh_PTF_params *params, gsl_matrix **AutoeigenvecsP, gsl_vector **AutoeigenvalsP, struct bankCohTemplateOverlaps **autoCohOverlapsP, struct bankComplexTemplateOverlaps *autoTempOverlaps, REAL4 *Fplus, REAL4 *Fcross, REAL8Array **PTFM, UINT4 csVecLength, UINT4 csVecLengthTwo, UINT4 vecLength)
int coh_PTF_parse_options(struct coh_PTF_params *params, int argc, char **argv)
void coh_PTF_bank_veto_segment_setup(struct coh_PTF_params *params, struct bankDataOverlaps *dataOverlaps, FindChirpTemplate *bankFcTmplts, RingDataSegments **segments, COMPLEX8VectorSequence **PTFqVec, COMPLEX8FFTPlan *invplan, INT4 segmentNum, struct timeval startTime)
UINT4 coh_PTF_initialize_bank_veto(struct coh_PTF_params *params, struct bankTemplateOverlaps **bankNormOverlapsP, struct bankComplexTemplateOverlaps **bankOverlapsP, struct bankDataOverlaps **dataOverlapsP, FindChirpTemplate **bankFcTmpltsP, FindChirpTemplate *fcTmplt, FindChirpTmpltParams *fcTmpltParams, REAL4FrequencySeries **invspec, struct timeval startTime)
void coh_PTF_set_null_input_RingDataSegments(RingDataSegments **segment, UINT4 length)
CohPTFSkyPositions * coh_PTF_generate_sky_points(struct coh_PTF_params *params)
void coh_PTF_initialize_structures(struct coh_PTF_params *params, FindChirpTemplate **fcTmpltP, FindChirpTmpltParams **fcTmpltParamsP, REAL8Array **PTFM, REAL8Array **PTFN, COMPLEX8VectorSequence **PTFqVec, REAL4FFTPlan *fwdplan)
UINT4 coh_PTF_initialize_auto_veto(struct coh_PTF_params *params, struct bankComplexTemplateOverlaps **autoTempOverlapsP, struct timeval startTime)
void coh_PTF_template(FindChirpTemplate *fcTmplt, InspiralTemplate *InspTmplt, FindChirpTmpltParams *params)
INT4 coh_PTF_data_condition(struct coh_PTF_params *params, REAL4TimeSeries **channel, REAL4FrequencySeries **invspec, RingDataSegments **segments, REAL4FFTPlan *fwdplan, REAL4FFTPlan *psdplan, REAL4FFTPlan *revplan, REAL4 **timeSlideVectors, struct timeval startTime)
REAL4FFTPlan * coh_PTF_get_fft_fwdplan(struct coh_PTF_params *params)
void coh_PTF_cleanup(struct coh_PTF_params *params, ProcessParamsTable *procpar, REAL4FFTPlan *fwdplan, REAL4FFTPlan *psdplan, REAL4FFTPlan *revplan, COMPLEX8FFTPlan *invPlan, REAL4TimeSeries **channel, REAL4FrequencySeries **invspec, RingDataSegments **segments, MultiInspiralTable *events, SnglInspiralTable *snglEvents, InspiralTemplate *PTFbankhead, FindChirpTemplate *fcTmplt, FindChirpTmpltParams *fcTmpltParams, REAL8Array **PTFM, REAL8Array **PTFN, COMPLEX8VectorSequence **PTFqVec, REAL4 *timeOffsets, REAL4 *slidTimeOffsets, REAL4 *Fplus, REAL4 *Fcross, REAL4 *Fplustrig, REAL4 *Fcrosstrig, CohPTFSkyPositions *skyPoints, TimeSlide *time_slide_head, TimeSlideVectorList *longTimeSlideList, TimeSlideVectorList *shortTimeSlideList, REAL4 *timeSlideVectors, LALDetector **detectors, INT8 *slideIDList, TimeSlideSegmentMapTable *time_slide_map_head, SegmentTable *segment_table_head)
void coh_PTF_calculate_trace_snr(struct coh_PTF_params *params, REAL4TimeSeries *traceSNR, COMPLEX8VectorSequence **PTFqVec, gsl_matrix *eigenvecs, gsl_vector *eigenvals, REAL4 *Fplus, REAL4 *Fcross, INT4 *timeOffsetPoints, UINT4 spinTemplate, UINT4 vecLength, UINT4 vecLengthTwo, UINT4 vecLoc, UINT4 snrLoc)
int coh_PTF_params_inspiral_sanity_check(struct coh_PTF_params *params)
UINT4 checkInjectionMchirp(struct coh_PTF_params *params, InspiralTemplate *tmplt, LIGOTimeGPS *epoch)
void coh_PTF_chi_square_coh_setup(struct coh_PTF_params *params, gsl_matrix **AutoeigenvecsP, gsl_vector **AutoeigenvalsP, REAL4 **frequencyRangesPlus, REAL4 **frequencyRangesCross, REAL4 **powerBinsPlus, REAL4 **powerBinsCross, REAL4 **overlapCont, struct bankDataOverlaps **chisqOverlapsP, FindChirpTemplate *fcTmplt, REAL4FrequencySeries **invspec, RingDataSegments **segments, REAL4 *Fplus, REAL4 *Fcross, REAL8Array **PTFM, COMPLEX8FFTPlan *invPlan, INT4 segmentNumber, UINT4 csVecLength, UINT4 csVecLengthTwo, UINT4 vecLength)
ProcessParamsTable * create_process_params(int argc, char **argv, const char *program)
void coh_PTF_calculate_det_stuff(struct coh_PTF_params *params, LALDetector **detectors, REAL4 *timeOffsets, REAL4 *Fplustrig, REAL4 *Fcrosstrig, CohPTFSkyPositions *skyPoints, UINT4 skyPointNum)
void coh_PTF_calculate_bmatrix(struct coh_PTF_params *params, gsl_matrix *eigenvecs, gsl_vector *eigenvals, REAL4 Fplus[LAL_NUM_IFO], REAL4 Fpcross[LAL_NUM_IFO], REAL8Array *PTFM[LAL_NUM_IFO+1], UINT4 vecLength, UINT4 vecLengthTwo, UINT4 PTFMlen)
REAL4FFTPlan * coh_PTF_get_fft_psdplan(struct coh_PTF_params *params)
void coh_PTF_calculate_auto_veto_template_filters(struct coh_PTF_params *params, FindChirpTemplate *fcTmplt, struct bankComplexTemplateOverlaps *autoTempOverlaps, REAL4FrequencySeries **invspec, COMPLEX8FFTPlan *invplan, UINT4 timeStepPoints)
void coh_PTF_set_null_input_UINT4(UINT4 **array, UINT4 length)
void coh_PTF_set_null_input_REAL4FrequencySeries(REAL4FrequencySeries **freqSeries, UINT4 length)
void coh_PTF_cluster_sngl_triggers(struct coh_PTF_params *params, SnglInspiralTable **eventList, SnglInspiralTable **thisEvent)
void coh_PTF_free_veto_memory(struct coh_PTF_params *params, struct bankTemplateOverlaps *bankNormOverlaps, FindChirpTemplate *bankFcTmplts, struct bankComplexTemplateOverlaps *bankOverlaps, struct bankDataOverlaps *dataOverlaps, struct bankComplexTemplateOverlaps *autoTempOverlaps)
void coh_PTF_calculate_null_stream_norms(UINT4 vecLength, gsl_matrix *eigenvecsNull, gsl_vector *eigenvalsNull, REAL8Array *PTFM[LAL_NUM_IFO+1])
UINT4 coh_PTF_template_time_series_cluster(struct coh_PTF_params *params, REAL4TimeSeries *cohSNR, UINT4 *acceptPoints, INT4 *timeOffsetPoints, INT4 numPointCheck, UINT4 startPoint, UINT4 endPoint, UINT4 **snglAcceptPoints, UINT4 *snglAcceptCount)
COMPLEX8FFTPlan * coh_PTF_get_fft_invplan(struct coh_PTF_params *params)
void findInjectionSegment(UINT4 *start, UINT4 *end, LIGOTimeGPS *epoch, struct coh_PTF_params *params)
void coh_PTF_set_null_input_LALDetector(LALDetector **detector, UINT4 length)
long int timeval_subtract(struct timeval *t1)
int coh_PTF_params_sanity_check(struct coh_PTF_params *params)
void coh_PTF_reset_time_series(struct coh_PTF_params *params, LIGOTimeGPS segStartTime, REAL4TimeSeries *cohSNR, REAL4TimeSeries *nullSNR, REAL4TimeSeries *traceSNR, REAL4TimeSeries **bankVeto, REAL4TimeSeries **autoVeto, REAL4TimeSeries **chiSquare, REAL4TimeSeries **snrComps, REAL4TimeSeries **pValues, REAL4TimeSeries **gammaBeta, UINT4 spinTemplates)
void coh_PTF_calculate_coherent_SNR(struct coh_PTF_params *params, REAL4 *snrData, REAL4TimeSeries **pValues, REAL4TimeSeries **snrComps, INT4 *timeOffsetPoints, COMPLEX8VectorSequence **PTFqVec, REAL4 *Fplus, REAL4 *Fcross, gsl_matrix *eigenvecs, gsl_vector *eigenvals, UINT4 segStartPoint, UINT4 segEndPoint, UINT4 vecLength, UINT4 vecLengthTwo, UINT4 spinTemplate, UINT4 **snglAcceptPoints, UINT4 *snglAcceptCount)
MultiInspiralTable * coh_PTF_create_multi_event(struct coh_PTF_params *params, REAL4TimeSeries *cohSNR, FindChirpTemplate *fcTmplt, InspiralTemplate PTFTemplate, UINT8 *eventId, UINT4 spinTrigger, REAL4TimeSeries **pValues, REAL4TimeSeries **gammaBeta, REAL4TimeSeries **snrComps, REAL4TimeSeries *nullSNR, REAL4TimeSeries *traceSNR, REAL4TimeSeries **bankVeto, REAL4TimeSeries **autoVeto, REAL4TimeSeries **chiSquare, REAL8Array **PTFM, REAL4 rightAscension, REAL4 declination, INT8 slideId, INT4 *timeOffsetPoints, UINT4 currPos)
void coh_PTF_set_null_input_REAL4TimeSeries(REAL4TimeSeries **timeSeries, UINT4 length)
UINT4 coh_PTF_test_veto_vals(struct coh_PTF_params *params, REAL4TimeSeries *cohSNR, REAL4TimeSeries *nullSNR, REAL4TimeSeries **bankVeto, REAL4TimeSeries **autoVeto, UINT4 currPointLoc)
void coh_PTF_calculate_null_stream_filters(struct coh_PTF_params *params, FindChirpTemplate *fcTmplt, REAL4FrequencySeries **invspec, REAL8Array **PTFM, COMPLEX8VectorSequence **PTFqVec, RingDataSegments **segments, COMPLEX8FFTPlan *invPlan, UINT4 spinTemplate, UINT4 segNum)
static struct coh_PTF_params * coh_PTF_get_params(int argc, char **argv)
int main(int argc, char **argv)
static int XLALCountMultiInspiralTable(MultiInspiralTable **head, UINT4 len)
UINT4 coh_PTF_accept_trig_check(struct coh_PTF_params *params, MultiInspiralTable **eventList, MultiInspiralTable thisEvent, INT4 timeDiff, UINT4 currTimeDiff, UINT4 currStorageID)
void coh_PTF_cluster_triggers(struct coh_PTF_params *params, MultiInspiralTable **eventList, MultiInspiralTable **newEventHead, UINT4 numSlides, INT4 timeDiff)
UINT4 coh_PTF_statistic(REAL4TimeSeries *cohSNR, REAL8Array *PTFM[LAL_NUM_IFO+1], COMPLEX8VectorSequence *PTFqVec[LAL_NUM_IFO+1], struct coh_PTF_params *params, UINT4 spinTemplate, REAL4 *timeOffsets, REAL4 *Fplus, REAL4 *Fcross, INT4 segmentNumber, REAL4TimeSeries *pValues[10], UNUSED REAL4TimeSeries *gammaBeta[2], REAL4TimeSeries *snrComps[LAL_NUM_IFO], REAL4TimeSeries *nullSNR, REAL4TimeSeries *traceSNR, REAL4TimeSeries *bankVeto[LAL_NUM_IFO+1], REAL4TimeSeries *autoVeto[LAL_NUM_IFO+1], REAL4TimeSeries *chiSquare[LAL_NUM_IFO+1], UINT4 subBankSize, struct bankComplexTemplateOverlaps *bankOverlaps, struct bankTemplateOverlaps *bankNormOverlaps, struct bankDataOverlaps *dataOverlaps, struct bankComplexTemplateOverlaps *autoTempOverlaps, FindChirpTemplate *fcTmplt, REAL4FrequencySeries *invspec[LAL_NUM_IFO+1], RingDataSegments *segments[LAL_NUM_IFO+1], COMPLEX8FFTPlan *invPlan, struct bankDataOverlaps **chisqOverlapsP, struct bankDataOverlaps **chisqSnglOverlapsP, REAL4 *frequencyRangesPlus[LAL_NUM_IFO+1], REAL4 *frequencyRangesCross[LAL_NUM_IFO+1], REAL4 **overlapCont, REAL4 **snglOverlapCont, struct timeval startTime, UINT4 segStartPoint, UINT4 segEndPoint, UINT4 **snglAcceptPoints, UINT4 *snglAcceptCount, UINT4 *acceptPointList)
UINT8 coh_PTF_add_triggers(struct coh_PTF_params *params, MultiInspiralTable **eventList, MultiInspiralTable **thisEvent, REAL4TimeSeries *cohSNR, FindChirpTemplate *fcTmplt, InspiralTemplate PTFTemplate, UINT8 eventId, UINT4 spinTrigger, REAL4TimeSeries *pValues[10], REAL4TimeSeries *gammaBeta[2], REAL4TimeSeries *snrComps[LAL_NUM_IFO], REAL4TimeSeries *nullSNR, REAL4TimeSeries *traceSNR, REAL4TimeSeries *bankVeto[LAL_NUM_IFO+1], REAL4TimeSeries *autoVeto[LAL_NUM_IFO+1], REAL4TimeSeries *chiSquare[LAL_NUM_IFO+1], REAL8Array *PTFM[LAL_NUM_IFO+1], REAL4 rightAscension, REAL4 declination, INT8 slideId, REAL4 *timeOffsets, UINT4 *acceptPointList, UINT4 numAcceptPoints, UINT4 slideNum, INT4 timeDiff, INT4 startTime)
void set_abrt_on_error(void)
void XLALDestroyCOMPLEX8VectorSequence(COMPLEX8VectorSequence *vecseq)
void XLALDestroyREAL4Vector(REAL4Vector *vector)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
LALDetector detectors[LAL_NUM_DETECTORS]
This structure contains a frequency domain template used as input to the FindChirpFilter() routine.
COMPLEX8Vector * data
Vector of length containing the frequency template data ; For a template generated in the frequency ...
COMPLEX8VectorSequence * PTFQtilde
UNDOCUMENTED.
This structure contains the parameters for generation of templates by the various template generation...
struct tagInspiralTemplate * next
struct tagMultiInspiralTable * next
COMPLEX8FrequencySeries * sgmnt
COMPLEX8Array * PTFM[LAL_NUM_IFO]
COMPLEX8VectorSequence * PTFqVec[LAL_NUM_IFO+1]
const char * channel[LAL_NUM_IFO]