41#include <lal/Segments.h>
42#include <lal/LALString.h>
43#include <lal/LineRobustStats.h>
51#define ALRealloc LALRealloc
57#define NUDGE 10*LAL_REAL8_EPS
63#define UNUSED __attribute__ ((unused))
68#define GET_GCT_CHECKPOINT read_gct_checkpoint
69#define SET_GCT_CHECKPOINT write_gct_checkpoint
81#define SKYREGION "allsky"
85#define FSTATTHRESHOLD 2.6
87#define FNAMEOUT "./HS_GCT.out"
89#define LAL_INT4_MAX 2147483647
92#define BLOCKSIZE_REALLOC 50
94#define Vorb_GCT = 2.9785e04;
95#define Vspin_GCT = 465.10;
96#define REARTH_GCT = 6.378140e06;
97#define C_GCT = 299792458;
100#define HSMAX(x,y) ( (x) > (y) ? (x) : (y) )
101#define HSMIN(x,y) ( (x) < (y) ? (x) : (y) )
103#define GETTIME() (uvar_outputTiming ? XLALGetCPUTime() : 0)
193void UpdateSemiCohToplists(
LALStatus *
status,
toplist_t *list1,
toplist_t *list2,
toplist_t *list3,
FineGrid *in,
REAL8 f1dot_fg,
REAL8 f2dot_fg,
REAL8 f3dot_fg,
UsefulStageVariables *usefulparams,
REAL4 NSegmentsInv,
REAL4 *NSegmentsInvX,
BOOLEAN have_f3dot );
206 REAL4 *NSegmentsInvX,
239int main(
int argc,
char *argv[] )
245 UINT4 skyGridCounter;
246 UINT4 f1dotGridCounter;
276 static LIGOTimeGPS minStartTimeGPS, maxStartTimeGPS;
301 UINT4 nf1dots_fg = 1;
302 REAL8 gammaRefine, sigmasq;
303 UINT4 nf2dots_fg = 1;
304 REAL8 gamma2Refine, sigma4;
305 UINT4 nf3dots_fg = 1;
306 REAL8 gamma3Refine = 1;
309 UINT4 if1dot_fg, if2dot_fg, if3dot_fg;
312 REAL8 myf0, freq_event, f1dot_event;
313 REAL8 dfreq_fg, df1dot_fg, freqmin_fg, f1dotmin_fg, freqband_fg;
314 REAL8 df2dot_fg, f2dotmin_fg;
315 REAL8 df3dot_fg, f3dotmin_fg;
316 REAL8 u1start, u1win, u1winInv;
317 REAL8 freq_fg, f1dot_fg, f2dot_fg, f3dot_fg, f1dot_event_fg;
324 REAL8 cosAlpha, sinAlpha, cosDelta, sinDelta;
343 UINT4 oldcg = 0, oldfg = 0;
349 CHAR *fnamelog = NULL;
354 CHAR *fnameSemiCohCand = NULL;
355 CHAR *fnameFstatVec1 = NULL;
356 FILE *fpFstat1 = NULL;
359 CHAR *uvar_fnameChkPoint = NULL;
377 REAL8 uvar_Fstar0sc = 0.0;
393 REAL8 uvar_dFreq = 0;
394 REAL8 uvar_df1dot = 0;
395 REAL8 uvar_df2dot = 0;
396 REAL8 uvar_df3dot = 0;
401 REAL8 uvar_minStartTime1 = 0;
409 REAL8 uvar_tStack = 0;
410 INT4 uvar_nStacksMax = 1;
411 CHAR *uvar_segmentList = NULL;
416 INT4 uvar_gammaRefine = 1;
417 INT4 uvar_gamma2Refine = 1;
420 INT4 uvar_skyPointIndex = -1;
426 CHAR *uvar_fnameout = NULL;
427 CHAR *uvar_DataFiles1 = NULL;
428 CHAR *uvar_skyGridFile = NULL;
429 INT4 uvar_numSkyPartitions = 0;
430 INT4 uvar_partitionIndex = 0;
431 INT4 uvar_SortToplist = 0;
433 CHAR *uvar_outputTiming = NULL;
434 CHAR *uvar_outputTimingDetails = NULL;
444 REAL8 tic_RecalcToplist, time_RecalcToplist = 0;
445 REAL8 tic_Fstat, time_Fstat = 0;
446 REAL8 tic_SumFine, time_SumFine = 0;
447 REAL8 tic_ExtraStats, time_ExtraStats = 0;
448 REAL8 tic_Start, time_Total = 0;
474 " - '<SFT file>;<SFT file>;...', where <SFT file> may contain wildcards\n - 'list:<file containing list of SFT files>'" ) ==
XLAL_SUCCESS,
XLAL_EFUNC );
524 XLAL_CHECK_MAIN(
XLALRegisterNamedUvar( &uvar_SortToplist,
"SortToplist",
INT4, 0, OPTIONAL,
"Sort toplist by: 0=Fstat, 1=nc, 2=B_S/GL, 3='Fstat + B_S/GL', 4=B_S/GLtL, 5=B_tS/GLtL, 6='B_S/GL + B_S/GLtL + B_tS/GLtL', 7='Fstat + B_S/GLtL + B_tS/GLtL' " ) ==
XLAL_SUCCESS,
XLAL_EFUNC );
563 if ( uvar_nStacksMax < 1 ) {
564 fprintf( stderr,
"Invalid number of segments!\n" );
568#ifndef EXP_NO_NUM_COUNT
574 if ( (
UINT8 )uvar_nStacksMax > maxseg ) {
577 "Compile without GC_SSE2_OPT to extend the available segment range\n",
585 fprintf( stderr,
"Invalid Running Median block size\n" );
589 if ( uvar_ThrF < 0 ) {
590 fprintf( stderr,
"Invalid value of F-statistic threshold\n" );
594 if ( uvar_f3dotBand != 0 && ( !
XLALUserVarWasSet( &uvar_gammaRefine ) || !
XLALUserVarWasSet( &uvar_gammaRefine ) || uvar_gammaRefine != 1 || uvar_gamma2Refine != 1 ) ) {
595 fprintf( stderr,
"Search over 3rd spindown is available only with gammaRefine AND gamma2Refine manually set to 1!\n" );
600#ifndef EXP_NO_NUM_COUNT
601 REAL4 TwoFthreshold = 2.0 * uvar_ThrF;
604 if ( ( uvar_SortToplist < 0 ) || ( uvar_SortToplist >=
SORTBY_LAST ) ) {
605 XLALPrintError(
"Invalid value %d specified for toplist sorting, must be within [0, %d]\n", uvar_SortToplist,
SORTBY_LAST - 1 );
612 fprintf( stderr,
"Toplist sorting by BSGL[tL] only possible if --computeBSGL given.\n" );
618 fprintf( stderr,
"Toplist sorting by B[t]SGLtL only possible if --getMaxFperSeg given.\n" );
626 XLAL_EFUNC,
"create_gctFstat_toplist() failed for nCand=%d and sortBy=%d\n", uvar_nCand1,
SORTBY_F );
628 XLAL_EFUNC,
"create_gctFstat_toplist() failed for nCand=%d and sortBy=%d\n", uvar_nCand1,
SORTBY_BSGL );
631 XLAL_EFUNC,
"create_gctFstat_toplist() failed for nCand=%d and sortBy=%d\n", uvar_nCand1,
SORTBY_BSGL );
638 XLAL_EFUNC,
"create_gctFstat_toplist() failed for nCand=%d and sortBy=%d\n", uvar_nCand1,
SORTBY_F );
645 XLAL_EFUNC,
"create_gctFstat_toplist() failed for nCand=%d and sortBy=%d\n", uvar_nCand1, uvar_SortToplist );
650 fnamelog =
LALCalloc( strlen( uvar_fnameout ) + 1 + 4,
sizeof(
CHAR ) );
651 strcpy( fnamelog, uvar_fnameout );
652 strcat( fnamelog,
".log" );
654 if ( ( fpLog = fopen( fnamelog,
"wb" ) ) == NULL ) {
655 fprintf( stderr,
"Unable to open file %s for writing\n", fnamelog );
664 fprintf( fpLog,
"# Log file for HierarchSearchGCT.c\n\n" );
665 fprintf( fpLog,
"# User Input:\n" );
666 fprintf( fpLog,
"#-------------------------------------------\n" );
667 fprintf( fpLog,
"# cmdline: %s\n", logstr );
671 fprintf( fpLog,
"# version: %s\n", VCSInfoString );
679 usefulParams.collectFstatTiming = ( uvar_outputTimingDetails != NULL );
682 coarsegrid.TwoF = NULL;
683 coarsegrid.TwoFX = NULL;
684 coarsegrid.Uindex = NULL;
701 if ( uvar_printCand1 ) {
702 fnameSemiCohCand =
LALCalloc( strlen( uvar_fnameout ) + 1,
sizeof(
CHAR ) );
703 if ( fnameSemiCohCand == NULL ) {
704 fprintf( stderr,
"error allocating memory [HierarchSearchGCT.c %d]\n", __LINE__ );
707 strcpy( fnameSemiCohCand, uvar_fnameout );
710 if ( uvar_printFstat1 ) {
711 const CHAR *append =
"_fstatVec1.dat";
712 fnameFstatVec1 =
LALCalloc( strlen( uvar_fnameout ) + strlen( append ) + 1,
sizeof(
CHAR ) );
713 strcpy( fnameFstatVec1, uvar_fnameout );
714 strcat( fnameFstatVec1, append );
715 if ( !( fpFstat1 = fopen( fnameFstatVec1,
"wb" ) ) ) {
716 fprintf( stderr,
"Unable to open Fstat file fstatvec1.out for writing.\n" );
726 usefulParams.sftbasename = uvar_DataFiles1;
731 XLALPrintError(
"Use EITHER (--nStacksMax and --tStack) OR --segmentList to define the coherent segments!\n\n" );
740 XLALPrintError(
"Need to set --tStack or --segmentList to define the coherent segments!\n\n" );
744 usefulParams.nStacks = uvar_nStacksMax;
745 usefulParams.tStack = uvar_tStack;
746 usefulParams.segmentList = NULL;
758 usefulParams.spinRange_refTime.fkdot[0] = uvar_Freq;
759 usefulParams.spinRange_refTime.fkdot[1] = uvar_f1dot;
760 usefulParams.spinRange_refTime.fkdot[2] = uvar_f2dot;
761 usefulParams.spinRange_refTime.fkdot[3] = uvar_f3dot;
762 usefulParams.spinRange_refTime.fkdotBand[0] = uvar_FreqBand;
763 usefulParams.spinRange_refTime.fkdotBand[1] = uvar_f1dotBand;
764 usefulParams.spinRange_refTime.fkdotBand[2] = uvar_f2dotBand;
765 usefulParams.spinRange_refTime.fkdotBand[3] = uvar_f3dotBand;
767 usefulParams.edat =
edat;
768 usefulParams.minStartTimeGPS = minStartTimeGPS;
769 usefulParams.maxStartTimeGPS = maxStartTimeGPS;
771 usefulParams.Dterms = uvar_Dterms;
772 usefulParams.DtermsRecalc = uvar_DtermsRecalc;
773 usefulParams.assumeSqrtSX = uvar_assumeSqrtSX;
774 usefulParams.SSBprec = uvar_SSBprecision;
775 usefulParams.Fmethod = uvar_FstatMethod;
776 usefulParams.FmethodRecalc = uvar_FstatMethodRecalc;
777 usefulParams.recalcToplistStats = uvar_recalcToplistStats;
779 usefulParams.mismatch1 = uvar_mismatch1;
785 XLALPrintWarning(
"Reference time will be set to mid-time of observation time\n" );
786 usefulParams.refTime = -1;
792 usefulParams.dFreqStack = uvar_dFreq;
798 usefulParams.dFreqStack = 0;
804 usefulParams.df1dot = uvar_df1dot;
806 XLALPrintError(
"--df1dot is required if --f1dotBand is given\n" );
810 usefulParams.df1dot = 0;
816 usefulParams.df2dot = uvar_df2dot;
818 XLALPrintError(
"--df2dot is required if --f2dotBand is given\n" );
822 usefulParams.df2dot = 0;
828 usefulParams.df3dot = uvar_df3dot;
830 XLALPrintError(
"--df3dot is required if --f3dotBand is given\n" );
834 usefulParams.df3dot = 0;
839 if ( uvar_injectionSources != NULL ) {
849 tStack = usefulParams.tStack;
850 tObs = usefulParams.tObs;
851 nStacks = usefulParams.nStacks;
852 midTstack = usefulParams.midTstack;
853 startTstack = usefulParams.startTstack;
854 endTstack = usefulParams.endTstack;
855 tMidGPS = usefulParams.spinRange_midTime.refTime;
856 refTimeGPS = usefulParams.spinRange_refTime.refTime;
857 fprintf( stderr,
"%% --- GPS reference time = %.4f , GPS data mid time = %.4f\n",
860 REAL4 *loudestTwoFPerSeg = NULL;
861 if ( uvar_loudestTwoFPerSeg ) {
866 if ( usefulParams.segmentList )
870 XLALFree( usefulParams.segmentList );
871 usefulParams.segmentList = NULL;
875 dFreqStack = usefulParams.dFreqStack;
876 df1dot = usefulParams.df1dot;
877 df2dot = usefulParams.df2dot;
878 df3dot = usefulParams.df3dot;
879 LogPrintf(
LOG_NORMAL,
"dFreqStack = %e, df1dot = %e, df2dot = %e, df3dot = %e\n", dFreqStack, df1dot, df2dot, df3dot );
883 gammaRefine = uvar_gammaRefine;
886 for (
k = 0;
k < nStacks;
k++ ) {
887 midTstackGPS = midTstack->
data[
k];
888 timeDiffSeg =
XLALGPSDiff( &midTstackGPS, &tMidGPS );
889 sigmasq = sigmasq + ( timeDiffSeg * timeDiffSeg );
891 sigmasq = sigmasq / ( nStacks * tStack * tStack );
893 gammaRefine = sqrt( 1.0 + 60 * sigmasq );
899 if ( uvar_gamma2Refine < 0 ) {
900 gamma2Refine = gammaRefine;
902 gamma2Refine = uvar_gamma2Refine;
905 sigmasq = sigma4 = 0.0;
906 for (
k = 0;
k < nStacks;
k++ ) {
907 midTstackGPS = midTstack->
data[
k];
908 timeDiffSeg =
XLALGPSDiff( &midTstackGPS, &tMidGPS );
909 sigmasq = sigmasq + ( timeDiffSeg * timeDiffSeg );
910 sigma4 = sigma4 + ( timeDiffSeg * timeDiffSeg * timeDiffSeg * timeDiffSeg );
912 sigmasq = sigmasq / ( nStacks * tStack * tStack );
913 sigma4 = sigma4 / ( nStacks * tStack * tStack * tStack * tStack );
916 gamma2Refine = sqrt( 2100.0 * ( sigma4 - sigmasq * sigmasq ) );
921 LogPrintf(
LOG_DETAIL,
"Frequency and spindown range at refTime (%d): [%f,%f], [%e,%e], [%e,%e], [%e,%e]\n",
922 usefulParams.spinRange_refTime.refTime.gpsSeconds,
923 usefulParams.spinRange_refTime.fkdot[0],
924 usefulParams.spinRange_refTime.fkdot[0] + usefulParams.spinRange_refTime.fkdotBand[0],
925 usefulParams.spinRange_refTime.fkdot[1],
926 usefulParams.spinRange_refTime.fkdot[1] + usefulParams.spinRange_refTime.fkdotBand[1],
927 usefulParams.spinRange_refTime.fkdot[2],
928 usefulParams.spinRange_refTime.fkdot[2] + usefulParams.spinRange_refTime.fkdotBand[2],
929 usefulParams.spinRange_refTime.fkdot[3],
930 usefulParams.spinRange_refTime.fkdot[3] + usefulParams.spinRange_refTime.fkdotBand[3] );
932 LogPrintf(
LOG_DETAIL,
"Frequency and spindown range at startTime (%d): [%f,%f], [%e,%e], [%e,%e], [%e,%e]\n",
933 usefulParams.spinRange_startTime.refTime.gpsSeconds,
934 usefulParams.spinRange_startTime.fkdot[0],
935 usefulParams.spinRange_startTime.fkdot[0] + usefulParams.spinRange_startTime.fkdotBand[0],
936 usefulParams.spinRange_startTime.fkdot[1],
937 usefulParams.spinRange_startTime.fkdot[1] + usefulParams.spinRange_startTime.fkdotBand[1],
938 usefulParams.spinRange_startTime.fkdot[2],
939 usefulParams.spinRange_startTime.fkdot[2] + usefulParams.spinRange_startTime.fkdotBand[2],
940 usefulParams.spinRange_startTime.fkdot[3],
941 usefulParams.spinRange_startTime.fkdot[3] + usefulParams.spinRange_startTime.fkdotBand[3] );
944 LogPrintf(
LOG_DETAIL,
"Frequency and spindown range at midTime (%d): [%f,%f], [%e,%e], [%e,%e], [%e,%e]\n",
945 usefulParams.spinRange_midTime.refTime.gpsSeconds,
946 usefulParams.spinRange_midTime.fkdot[0],
947 usefulParams.spinRange_midTime.fkdot[0] + usefulParams.spinRange_midTime.fkdotBand[0],
948 usefulParams.spinRange_midTime.fkdot[1],
949 usefulParams.spinRange_midTime.fkdot[1] + usefulParams.spinRange_midTime.fkdotBand[1],
950 usefulParams.spinRange_midTime.fkdot[2],
951 usefulParams.spinRange_midTime.fkdot[2] + usefulParams.spinRange_midTime.fkdotBand[2],
952 usefulParams.spinRange_midTime.fkdot[3],
953 usefulParams.spinRange_midTime.fkdot[3] + usefulParams.spinRange_midTime.fkdotBand[3] );
955 LogPrintf(
LOG_DETAIL,
"Frequency and spindown range at endTime (%d): [%f,%f], [%e,%e], [%e,%e], [%e,%e]\n",
956 usefulParams.spinRange_endTime.refTime.gpsSeconds,
957 usefulParams.spinRange_endTime.fkdot[0],
958 usefulParams.spinRange_endTime.fkdot[0] + usefulParams.spinRange_endTime.fkdotBand[0],
959 usefulParams.spinRange_endTime.fkdot[1],
960 usefulParams.spinRange_endTime.fkdot[1] + usefulParams.spinRange_endTime.fkdotBand[1],
961 usefulParams.spinRange_endTime.fkdot[2],
962 usefulParams.spinRange_endTime.fkdot[2] + usefulParams.spinRange_endTime.fkdotBand[2],
963 usefulParams.spinRange_endTime.fkdot[3],
964 usefulParams.spinRange_endTime.fkdot[3] + usefulParams.spinRange_endTime.fkdotBand[3] );
967 fprintf( stderr,
"%% --- Setup, N = %d, T = %.0f s, Tobs = %.0f s, gammaRefine = %.0f, gamma2Refine = %.0f, gamma3Refine = %.0f\n",
968 nStacks, tStack, tObs, gammaRefine, gamma2Refine, gamma3Refine );
976 thisPoint.
asini = 0 ;
981 semiCohPar.
tsMid = midTstack;
996 semiCohPar.
pos = posStack;
997 semiCohPar.
vel = velStack;
998 semiCohPar.
acc = accStack;
1006 if ( uvar_computeBSGL ) {
1010 REAL4 *oLGX_p = NULL;
1012 if ( uvar_oLGX != NULL ) {
1014 fprintf( stderr,
"Invalid input: length(oLGX) = %d differs from number of detectors (%d)'\n", uvar_oLGX->
length,
numDetectors );
1018 fprintf( stderr,
"Invalid input oLGX'\n" );
1025 if ( usefulParams.BSGLsetup == NULL ) {
1026 fprintf( stderr,
"XLALCreateBSGLSetup() failed\n" );
1032 CHAR column_headings_string_base[256];
1034 sprintf( column_headings_string_base,
"freq alpha delta f1dot f2dot f3dot nc <2F>" );
1036 sprintf( column_headings_string_base,
"freq alpha delta f1dot f2dot nc <2F>" );
1039 UINT4 column_headings_string_length =
sizeof( column_headings_string_base );
1040 if ( uvar_computeBSGL ) {
1041 column_headings_string_length += 10 +
numDetectors * 8;
1043 if ( uvar_getMaxFperSeg ) {
1044 column_headings_string_length += 12 + 13;
1045 column_headings_string_length += 6 + 9 +
numDetectors * ( 9 + 12 );
1047 if ( uvar_recalcToplistStats ) {
1048 column_headings_string_length += 6 + 11 +
numDetectors * 9;
1049 if ( uvar_computeBSGL ) {
1050 column_headings_string_length += 11;
1051 if ( uvar_getMaxFperSeg ) {
1052 column_headings_string_length += 13;
1056 column_headings_string_length += 1;
1058 if ( uvar_loudestSegOutput ) {
1062 char column_headings_string[column_headings_string_length];
1064 strcat( column_headings_string, column_headings_string_base );
1065 if ( uvar_computeBSGL ) {
1066 strcat( column_headings_string,
" log10BSGL" );
1069 snprintf( headingX,
sizeof( headingX ),
" <2F_%s>", detectorIDs->
data[X] );
1070 strcat( column_headings_string, headingX );
1073 if ( uvar_getMaxFperSeg ) {
1074 strcat( column_headings_string,
" log10BSGLtL log10BtSGLtL" );
1075 strcat( column_headings_string,
" max2F" );
1076 strcat( column_headings_string,
" max2Fseg" );
1079 snprintf( headingX,
sizeof( headingX ),
" max2F_%s", detectorIDs->
data[X] );
1080 strcat( column_headings_string, headingX );
1084 snprintf( headingX,
sizeof( headingX ),
" max2F_%sseg", detectorIDs->
data[X] );
1085 strcat( column_headings_string, headingX );
1088 if ( uvar_recalcToplistStats ) {
1089 strcat( column_headings_string,
" <2Fr>" );
1090 if ( uvar_computeBSGL ) {
1091 strcat( column_headings_string,
" log10BSGLr" );
1095 snprintf( headingX,
sizeof( headingX ),
" <2Fr_%s>", detectorIDs->
data[X] );
1096 strcat( column_headings_string, headingX );
1098 if ( uvar_loudestSegOutput ) {
1099 strcat( column_headings_string,
" lseg 2Fl" );
1102 snprintf( headingX,
sizeof( headingX ),
" 2Fl_%s", detectorIDs->
data[X] );
1103 strcat( column_headings_string, headingX );
1106 if ( uvar_computeBSGL && uvar_getMaxFperSeg ) {
1107 strcat( column_headings_string,
" log10BSGLtLr" );
1113 REAL4 NSegmentsInv = 1.0 / nStacks;
1119 scanInit.
gridType = uvar_gridType1;
1129 fprintf( stderr,
"error allocating memory [HierarchSearchGCT.c.c %d]\n", __LINE__ );
1136 if ( firstDetector == NULL ) {
1145 scanInit.
Freq = usefulParams.spinRange_midTime.fkdot[0] + usefulParams.spinRange_midTime.fkdotBand[0];
1154 f1dotGridCounter = 0;
1163 if ( 0 >
GET_GCT_CHECKPOINT( uvar_fnameChkPoint, semiCohToplist, semiCohToplist2, semiCohToplist3, &
count ) ) {
1169 f1dotGridCounter = (
UINT4 )(
count % usefulParams.nf1dot );
1170 skycount = (
UINT4 )( (
count - f1dotGridCounter ) / usefulParams.nf1dot );
1172 fprintf( stderr,
"%% --- Cpt:%d, total:%d, sky:%d/%d, f1dot:%d/%d\n",
1173 count, thisScan.numSkyGridPoints * usefulParams.nf1dot, skycount + 1, thisScan.numSkyGridPoints, f1dotGridCounter + 1, usefulParams.nf1dot );
1175 for ( skyGridCounter = 0; skyGridCounter < skycount; skyGridCounter++ ) {
1179 if (
count == thisScan.numSkyGridPoints * usefulParams.nf1dot ) {
1189 for ( skyGridCounter = 0; ( skyGridCounter <
count ) && ( thisScan.state !=
STATE_FINISHED ) ; skyGridCounter++ ) {
1203 cosAlpha = cos( thisPoint.
Alpha );
1204 sinAlpha = sin( thisPoint.
Alpha );
1205 cosDelta = cos( thisPoint.
Delta );
1206 sinDelta = sin( thisPoint.
Delta );
1207 nvec[0] = cosAlpha * cosDelta;
1208 nvec[1] = sinAlpha * cosDelta;
1213 binsFstat1 = usefulParams.binsFstatSearch + 2 * semiCohPar.
extraBinsFstat;
1218 while ( ifdot < usefulParams.nf1dot ) {
1221 if ( f1dotGridCounter > 0 ) {
1222 ifdot = f1dotGridCounter;
1223 f1dotGridCounter = 0;
1229 while ( if2dot < usefulParams.nf2dot ) {
1234 while ( if3dot < usefulParams.nf3dot ) {
1238 skyGridCounter + 1, thisScan.numSkyGridPoints, ifdot + 1, usefulParams.nf1dot, if2dot + 1, usefulParams.nf2dot, if3dot + 1, usefulParams.nf3dot );
1242 coarsegrid.freqlength = (
UINT4 )( binsFstat1 );
1243 coarsegrid.nStacks = nStacks;
1244 coarsegrid.length = coarsegrid.freqlength * coarsegrid.nStacks;
1248 coarsegrid.TwoF = (
REAL4 * )
LALRealloc( coarsegrid.TwoF, coarsegrid.length *
sizeof(
REAL4 ) );
1249 if ( uvar_computeBSGL ) {
1250 coarsegrid.TwoFX = (
REAL4 * )
LALRealloc( coarsegrid.TwoFX, coarsegrid.numDetectors * coarsegrid.length *
sizeof(
REAL4 ) );
1252 coarsegrid.Uindex = (
UINT4 * )
LALRealloc( coarsegrid.Uindex, coarsegrid.length *
sizeof(
UINT4 ) );
1254 if ( coarsegrid.TwoF == NULL || coarsegrid.Uindex == NULL ) {
1255 fprintf( stderr,
"ERROR: Memory allocation [HierarchSearchGCT.c %d]\n", __LINE__ );
1262 freqmin_fg = usefulParams.spinRange_midTime.fkdot[0];
1263 freqband_fg = usefulParams.spinRange_midTime.fkdotBand[0];
1266 dfreq_fg = dFreqStack;
1267 UINT4 nfreqs_fg = ceil( freqband_fg / dfreq_fg );
1268 if ( nfreqs_fg == 0 ) {
1276#define ALIGN_REAL4 4
1280 if ( usefulParams.nf1dot == 1 ) {
1283 nf1dots_fg = ceil( gammaRefine );
1284 if ( ( nf1dots_fg % 2 ) == 0 ) {
1288 df1dot_fg = df1dot / nf1dots_fg;
1291 f1dotmin_fg = ( usefulParams.spinRange_midTime.fkdot[1] + ifdot * df1dot ) - df1dot_fg * floor( nf1dots_fg / 2.0 );
1294 if ( uvar_f2dotBand == 0 ) {
1297 nf2dots_fg = ceil( gamma2Refine );
1298 if ( ( nf2dots_fg % 2 ) == 0 ) {
1302 df2dot_fg = df2dot / nf2dots_fg;
1305 f2dotmin_fg = ( usefulParams.spinRange_midTime.fkdot[2] + if2dot * df2dot ) - df2dot_fg * floor( nf2dots_fg / 2.0 );
1312 f3dotmin_fg = ( usefulParams.spinRange_midTime.fkdot[3] + if3dot * df3dot ) - df3dot_fg * floor( nf3dots_fg / 2.0 );
1318 oldcg = coarsegrid.length;
1323 LogPrintfVerbatim(
LOG_NORMAL,
"FG:%d f1dotmin_fg:%.13g df1dot_fg:%.13g f2dotmin_fg:%.13g df2dot_fg:%.13g f3dotmin_fg:%.13g df3dot_fg:%.13g\n",
1324 finegrid.
length, f1dotmin_fg, df1dot_fg, f2dotmin_fg, df2dot_fg, f3dotmin_fg, df3dot_fg );
1326 if ( ( coarsegrid.length != oldcg ) || ( finegrid.
length != oldfg ) ) {
1328 oldcg, oldfg, coarsegrid.length, finegrid.
length );
1346 if ( uvar_getMaxFperSeg ) {
1351 if ( uvar_computeBSGL ) {
1353 if ( uvar_getMaxFperSeg ) {
1359 if ( finegrid.
nc == NULL || finegrid.
sumTwoF == NULL ) {
1360 fprintf( stderr,
"ERROR: Memory allocation [HierarchSearchGCT.c %d]\n", __LINE__ );
1369 for ( if1dot_fg = 0; if1dot_fg < nf1dots_fg; if1dot_fg++ ) {
1372 f1dot_fg = f1dotmin_fg + if1dot_fg * df1dot_fg;
1375 for ( if2dot_fg = 0; if2dot_fg < nf2dots_fg; if2dot_fg++ ) {
1378 f2dot_fg = f2dotmin_fg + if2dot_fg * df2dot_fg;
1381 for ( if3dot_fg = 0; if3dot_fg < nf3dots_fg; if3dot_fg++ ) {
1384 f3dot_fg = f3dotmin_fg + if3dot_fg * df3dot_fg;
1389 if ( uvar_getMaxFperSeg ) {
1393 if ( uvar_computeBSGL ) {
1395 if ( uvar_getMaxFperSeg ) {
1402 const BOOLEAN doComputeFstats = ( ( if1dot_fg == 0 ) && ( if2dot_fg == 0 ) && ( if3dot_fg == 0 ) );
1407 for (
k = 0;
k < nStacks;
k++ ) {
1414 vel[0] = semiCohPar.
vel->
data[3 *
k];
1415 vel[1] = semiCohPar.
vel->
data[3 *
k + 1];
1416 vel[2] = semiCohPar.
vel->
data[3 *
k + 2];
1426 midTstackGPS = midTstack->
data[
k];
1436 B1 = (
pos[0] * nvec[0] \
1437 +
pos[1] * nvec[1] \
1438 +
pos[2] * nvec[2] );
1446 B2 = ( vel[0] * nvec[0] \
1447 + vel[1] * nvec[1] \
1448 + vel[2] * nvec[2] );
1453 u1win = dFreqStack * A1;
1454 u1winInv = 1.0 / u1win;
1462 thisPoint.
fkdot[0] = usefulParams.spinRange_midTime.fkdot[0] - semiCohPar.
extraBinsFstat * dFreqStack;
1465 thisPoint.
fkdot[1] = usefulParams.spinRange_midTime.fkdot[1] + ifdot * df1dot;
1468 thisPoint.
fkdot[2] = usefulParams.spinRange_midTime.fkdot[2] + if2dot * df2dot;
1471 thisPoint.
fkdot[3] = usefulParams.spinRange_midTime.fkdot[3] + if3dot * df3dot;
1474 f1dot_event = thisPoint.
fkdot[1] + thisPoint.
fkdot[2] * timeDiffSeg;
1475 myf0 = thisPoint.
fkdot[0] + thisPoint.
fkdot[1] * timeDiffSeg +
1476 + 0.5 * thisPoint.
fkdot[2] * timeDiffSeg * timeDiffSeg;
1479 u1start = myf0 * A1 + f1dot_event * B1;
1492 if ( doComputeFstats ) {
1495 const int retn =
XLALComputeFstat( &Fstat_res, usefulParams.Fstat_in_vec->data[
k], &thisPoint, binsFstat1, Fstat_what );
1502 for ( ifreq = 0; ifreq < Fstat_res->
numFreqBins; ifreq++ ) {
1505 freq_event = myf0 + ifreq * dFreqStack;
1508 U1idx =
ComputeU1idx( freq_event, f1dot_event, A1, B1, u1start, u1winInv );
1515 if ( (
INT4 )ifreq != U1idx ) {
1516 fprintf( stderr,
"ERROR: Incorrect Frequency-Index!\n ----> Seg: %03d ifreq: %d cg U1: %d \n",
1522 coarsegrid.Uindex[
CG_INDEX( coarsegrid,
k, ifreq )] = U1idx;
1526 coarsegrid.TwoF[
CG_INDEX( coarsegrid,
k, ifreq )] = Fstat_res->
twoF[ifreq];
1527 if ( uvar_computeBSGL ) {
1528 for (
UINT4 X = 0; X < coarsegrid.numDetectors; X++ ) {
1535 if ( detid == -1 ) {
1536 coarsegrid.TwoFX[
CG_FX_INDEX( coarsegrid, X,
k, ifreq )] = 0.0;
1546 if ( uvar_printFstat1 ) {
1551 if ( loudestTwoFPerSeg ) {
1553 loudestTwoFPerSeg[
k] = fmaxf( loudestTwoFPerSeg[
k], loudestFstat_k );
1558 time_Fstat += (
GETTIME() - tic_Fstat );
1568 f1dot_event_fg = f1dot_fg + f2dot_fg * timeDiffSeg;
1569 freq_fg = finegrid.
freqmin_fg + f1dot_fg * timeDiffSeg +
1570 0.5 * f2dot_fg * timeDiffSeg * timeDiffSeg;
1573 U1idx =
ComputeU1idx( freq_fg, f1dot_event_fg, A1, B1, u1start, u1winInv );
1576 fprintf( stderr,
"ERROR: Stepped outside the coarse grid (%d)! \n", U1idx );
1581 fprintf( stderr,
"ERROR: Stepped outside the coarse grid (%d:%d:%d:%d)! \n",
1587 REAL4 *cgrid2F = coarsegrid.TwoF +
CG_INDEX( coarsegrid,
k, U1idx );
1591#ifndef EXP_NO_NUM_COUNT
1596 if ( uvar_getMaxFperSeg ) {
1603#ifndef EXP_NO_NUM_COUNT
1609 if ( uvar_computeBSGL ) {
1614 if ( uvar_getMaxFperSeg ) {
1625 for (
UINT4 ifreq_fg = 0; ifreq_fg < finegrid.
freqlength; ifreq_fg++ ) {
1626 fgrid2F[0] += cgrid2F[0];
1627#ifndef EXP_NO_NUM_COUNT
1628 fgridnc[0] += ( TwoFthreshold < cgrid2F[0] );
1634 if ( uvar_computeBSGL ) {
1638 for (
UINT4 ifreq_fg = 0; ifreq_fg < finegrid.
freqlength; ifreq_fg++ ) {
1639 fgrid2FX[0] += cgrid2FX[0];
1647 if ( uvar_getMaxFperSeg ) {
1648 cgrid2F = coarsegrid.TwoF +
CG_INDEX( coarsegrid,
k, U1idx );
1652 for (
UINT4 ifreq_fg = 0; ifreq_fg < finegrid.
freqlength; ifreq_fg++ ) {
1653 isLouder = ( fgridMax2Fl[0] <= cgrid2F[0] );
1654 fgridMax2Fl[0] = fmaxf( fgridMax2Fl[0], cgrid2F[0] );
1655 fgrid2FmaxIdx[0] = isLouder *
k + ( 1 - isLouder ) * fgrid2FmaxIdx[0];
1665 for (
UINT4 ifreq_fg = 0; ifreq_fg < finegrid.
freqlength; ifreq_fg++ ) {
1666 isLouder = ( fgridMax2FXl[0] <= cgrid2FX[0] );
1667 fgridMax2FXl[0] = fmaxf( fgridMax2FXl[0], cgrid2FX[0] );
1668 fgrid2FXmaxIdx[0] = isLouder *
k + ( 1 - isLouder ) * fgrid2FXmaxIdx[0];
1676 time_SumFine += (
GETTIME() - tic_SumFine );
1684 if ( uvar_semiCohToplist ) {
1690 LAL_CALL(
UpdateSemiCohToplistsOptimTriple( &
status, uvar_SortToplist, semiCohToplist, semiCohToplist2, semiCohToplist3, &finegrid, f1dot_fg, f2dot_fg, f3dot_fg, &usefulParams, NSegmentsInv, usefulParams.NSegmentsInvX,
XLALUserVarWasSet( &uvar_f3dot ) ), &
status );
1692 LAL_CALL(
UpdateSemiCohToplists( &
status, semiCohToplist, semiCohToplist2, semiCohToplist3, &finegrid, f1dot_fg, f2dot_fg, f3dot_fg, &usefulParams, NSegmentsInv, usefulParams.NSegmentsInvX,
XLALUserVarWasSet( &uvar_f3dot ) ), &
status );
1695 time_ExtraStats += (
GETTIME() - tic_ExtraStats );
1709 if ( !uvar_outputTiming ) {
1710 SET_GCT_CHECKPOINT( uvar_fnameChkPoint, semiCohToplist, semiCohToplist2, semiCohToplist3, skyGridCounter * usefulParams.nf1dot + ifdot,
TRUE );
1734 if ( semiCohToplist2 ) {
1737 if ( semiCohToplist3 ) {
1748 if ( uvar_outputTimingDetails != NULL ) {
1750 XLAL_CHECK( (
fp = fopen( uvar_outputTimingDetails,
"ab" ) ) != NULL,
XLAL_ESYS,
"Failed to open '%s' for writing\n", uvar_outputTimingDetails );
1751 for (
size_t l = 0;
l < nStacks;
l++ ) {
1758 tic_RecalcToplist =
GETTIME();
1759 if ( uvar_recalcToplistStats ) {
1763 recalcParams.listEntryTypeName =
"GCTtop";
1764 if ( usefulParams.Fstat_in_vec_recalc != NULL ) {
1765 recalcParams.Fstat_in_vec = usefulParams.Fstat_in_vec_recalc;
1767 recalcParams.Fstat_in_vec = usefulParams.Fstat_in_vec;
1770 recalcParams.detectorIDs = usefulParams.detectorIDs;
1771 recalcParams.startTstack = usefulParams.startTstack;
1772 recalcParams.refTimeGPS = refTimeGPS;
1773 recalcParams.BSGLsetup = usefulParams.BSGLsetup;
1774 recalcParams.loudestSegOutput = uvar_loudestSegOutput;
1775 recalcParams.computeBSGLtL = uvar_getMaxFperSeg;
1780 if ( semiCohToplist2 ) {
1786 if ( semiCohToplist3 ) {
1794 time_RecalcToplist =
GETTIME() - tic_RecalcToplist;
1796 if ( uvar_outputTiming ) {
1798 timing.RecalcMethodStr = ( timing.RecalcMethodStr == NULL ) ?
"NONE" : timing.RecalcMethodStr;
1799 timing.Nseg = coarsegrid.nStacks;
1800 timing.Ndet = coarsegrid.numDetectors;
1801 timing.Tcoh = usefulParams.tStack;
1802 timing.Nsft = usefulParams.nSFTs;
1803 timing.Ncand = uvar_nCand1;
1805 timing.NFreqCo = coarsegrid.freqlength;
1806 timing.Ncoh = thisScan.numSkyGridPoints * timing.NFreqCo * usefulParams.nf1dot * usefulParams.nf2dot;
1808 REAL8 nf1dot_fine = usefulParams.nf1dot * nf1dots_fg;
1809 REAL8 nf2dot_fine = usefulParams.nf2dot * nf2dots_fg;
1810 timing.Ninc = thisScan.numSkyGridPoints * usefulParams.binsFstatSearch * nf1dot_fine * nf2dot_fine;
1812 timing.tau_Fstat = time_Fstat / ( timing.Nseg * timing.Ncoh * timing.Ndet );
1813 timing.tau_SumF = time_SumFine / ( timing.Nseg * timing.Ninc );
1814 timing.tau_Bayes = time_ExtraStats / timing.Ninc;
1815 timing.tau_Recalc = time_RecalcToplist / timing.Ncand;
1816 time_Total =
GETTIME() - tic_Start;
1817 timing.time_Other = time_Total - ( time_Fstat + time_SumFine + time_ExtraStats + time_RecalcToplist );
1819 if ( uvar_outputTiming ) {
1825 if ( loudestTwoFPerSeg ) {
1829 if ( (
fp = fopen( fname,
"wb" ) ) == NULL ) {
1833 for (
UINT4 l = 0;
l < nStacks;
l ++ ) {
1850 switch ( uvar_SortToplist ) {
1852 strcpy( t1_suffix,
"" );
1853 strcpy( t2_suffix,
"-BSGL" );
1854 strcpy( t3_suffix,
"" );
1859 strcpy( t1_suffix,
"" );
1860 strcpy( t2_suffix,
"-BSGLtL" );
1861 strcpy( t3_suffix,
"-BtSGLtL" );
1865 strcpy( t1_suffix,
"" );
1866 strcpy( t2_suffix,
"" );
1867 strcpy( t3_suffix,
"" );
1873 UINT4 newlen = strlen( uvar_fnameout ) + strlen( t1_suffix ) + 1;;
1876 sprintf( fname1,
"%s%s", uvar_fnameout, t1_suffix );
1885 if ( semiCohToplist2 ) {
1888 UINT4 newlen = strlen( uvar_fnameout ) + strlen( t2_suffix ) + 1;
1891 sprintf( fname2,
"%s%s", uvar_fnameout, t2_suffix );
1895 if ( semiCohToplist3 ) {
1897 newlen = strlen( uvar_fnameout ) + strlen( t3_suffix ) + 1;
1900 sprintf( fname3,
"%s%s", uvar_fnameout, t3_suffix );
1911 if ( uvar_printCand1 ) {
1915 if ( uvar_printFstat1 ) {
1920 if ( usefulParams.injectionSources ) {
1948 if ( finegrid.
nc ) {
1972 if ( coarsegrid.TwoF ) {
1975 if ( coarsegrid.TwoFX ) {
1978 if ( coarsegrid.Uindex ) {
1983 if ( semiCohToplist2 ) {
1986 if ( semiCohToplist3 ) {
2020 REAL8 timebase, tObs, deltaFsft;
2022 LIGOTimeGPS tStartGPS, tEndGPS, refTimeGPS, tMidGPS, midTstackGPS, startTstackGPS, endTstackGPS;
2024 REAL8 midTseg, startTseg, endTseg;
2045 timebase = 1.0 / deltaFsft;
2051 XLALPrintError(
"%s: XLALSetUpStacksFromSegmentList() failed to set up segments from given list.\n",
__func__ );
2054 catalogSeq = ( *catalogSeq_p );
2078 SFTCatalog *LastSegmentCat = &( catalogSeq.
data[numSegments - 1] );
2120 midTseg = startTseg + ( ( endTseg - startTseg + timebase ) * 0.5 );
2134 REAL8 tStart8, tEnd8, tMid8;
2138 tMid8 = 0.5 * ( tStart8 + tEnd8 );
2146 refTimeGPS = tMidGPS;
2187 REAL8 minCoverFreq, maxCoverFreq;
2188 REAL8 asiniMax = 0, PeriodMin = 0, maxEcc = 0;
2200 XLALCWSignalCoveringBand( &minCoverFreq, &maxCoverFreq, &tStartGPS, &tEndGPS, &( spinRangeEff ), asiniMax, PeriodMin, maxEcc );
2274 optionalArgsRecalc = optionalArgs;
2278 optionalArgsRecalc.prevInput = NULL;
2298 if ( multiIFO == NULL ) {
2326 UINT4 nSFTsInSeg = 0;
2328 nSFTsInSeg +=
multiTS->data[X]->length;
2330 in->
nSFTs += nSFTsInSeg;
2336 if ( ( nSFTsExpected > 0 ) && ( nSFTsInSeg != nSFTsExpected ) ) {
2337 XLALPrintError(
"%s: Segment list seems inconsistent with data read: segment %d contains %d SFTs, should hold %d SFTs\n",
__func__,
k, nSFTsInSeg, nSFTsExpected );
2396 UINT4 j, stackCounter, length;
2397 REAL8 tStart, thisTime;
2412 out->length = nStacksMax;
2414 if (
out->data == NULL ) {
2436 if ( ( thisTime - tStart +
Tsft <= tStack ) ) {
2437 out->data[stackCounter].length += 1;
2439 length =
out->data[stackCounter].length;
2443 if (
out->data[stackCounter].data == NULL ) {
2447 out->data[stackCounter].data[length - 1] = in->
data[
j];
2449 if ( stackCounter + 1 == nStacksMax ) {
2459 out->data[stackCounter].length = 1;
2461 if (
out->data[stackCounter].data == NULL ) {
2465 out->data[stackCounter].data[0] = in->
data[
j];
2471 out->length = stackCounter + 1;
2473 if (
out->data == NULL ) {
2507 fprintf(
fp,
"## Number of SFTs: %d\n", nSFT );
2509 fprintf(
fp,
"## Last SFT timestamp: %d %d\n",
end.gpsSeconds,
end.gpsNanoSeconds );
2537 nStacks = catalogSeq->
length;
2538 fprintf(
fp,
"## Number of stacks: %d\n", nStacks );
2540 for (
k = 0;
k < nStacks;
k++ ) {
2541 fprintf(
fp,
"## Stack No. %d : \n",
k + 1 );
2553#define likely(x) __builtin_expect(!!(x), 1)
2554#define unlikely(x) __builtin_expect(!!(x), 0)
2556#define likely(x) (x)
2557#define unlikely(x) (x)
2575 REAL4 *NSegmentsInvX,
2606 for ( ifreq_fg = 0; ifreq_fg < in->
freqlength; ifreq_fg++ ) {
2620 sumTwoFX[X] = in->
sumTwoFX[fg_FX_idx];
2629 if ( delay_compute_BSGL ) {
2660 line.Freq = freq_fg;
2663 line.F1dot = f1dot_fg;
2664 line.F2dot = f2dot_fg;
2665 line.F3dot = f3dot_fg;
2666 line.have_f3dot = have_f3dot;
2667 line.nc = in->
nc[ifreq_fg];
2670 line.avTwoF = sumTwoF * NSegmentsInv;
2681 if (
likely( ! isIncludedToplists ) ) {
2687 if ( delay_compute_BSGL ) {
2692 line.avTwoFrecalc = -1.0;
2695 line.loudestSeg = -1;
2696 line.twoFloudestSeg = -1.0;
2698 line.twoFXloudestSeg[X] = -1.0;
2699 line.avTwoFXrecalc[X] = 0.0;
2705 line.avTwoFX[X] = sumTwoFX[X] * NSegmentsInvX[X];
2737 REAL4 *NSegmentsInvX,
2754 for ( ifreq_fg = 0; ifreq_fg < in->
freqlength; ifreq_fg++ ) {
2758 line.Freq = freq_fg;
2761 line.F1dot = f1dot_fg;
2762 line.F2dot = f2dot_fg;
2763 line.F3dot = f3dot_fg;
2764 line.nc = in->
nc[ifreq_fg];
2766 line.maxTwoFl = -1.0;
2767 line.maxTwoFlSeg = -1;
2774 line.avTwoFX[X] = 0.0;
2775 line.maxTwoFXl[X] = 0.0;
2776 line.maxTwoFXlSeg[X] = -1;
2777 line.avTwoFXrecalc[X] = 0.0;
2779 line.avTwoFrecalc = -1.0;
2782 line.have_f3dot = have_f3dot;
2783 line.loudestSeg = -1;
2784 line.twoFloudestSeg = -1.0;
2786 line.twoFXloudestSeg[X] = -1.0;
2811 line.avTwoF = sumTwoF * NSegmentsInv;
2814 line.avTwoFX[X] = sumTwoFX[X] * NSegmentsInvX[X];
2868 maxTwoF = fmaxf( maxTwoF, in->
twoF[
k] );
2892 memcpy( fkdot, thisPoint->
fkdot,
sizeof( fkdot ) );
2898 for (
UINT4 k = 0;
k < length;
k++ ) {
2904 fprintf(
fp,
"%d %.13g %.12g %.12g %.13g %.13g %.6g\n",
2905 stackIndex, fkdot[0],
alpha,
delta, fkdot[1], fkdot[2], in->
twoF[
k] );
2955 nStacks = usefulparams->
nStacks;
2959 for (
k = 0;
k < nStacks;
k++ ) {
2961 posSeg[0]->
data[3 *
k] = 0.0;
2962 posSeg[0]->
data[3 *
k + 1] = 0.0;
2963 posSeg[0]->
data[3 *
k + 2] = 0.0;
2965 velSeg[0]->
data[3 *
k] = 0.0;
2966 velSeg[0]->
data[3 *
k + 1] = 0.0;
2967 velSeg[0]->
data[3 *
k + 2] = 0.0;
2969 accSeg[0]->
data[3 *
k] = 0.0;
2970 accSeg[0]->
data[3 *
k + 1] = 0.0;
2971 accSeg[0]->
data[3 *
k + 2] = 0.0;
2979 posSeg[0]->
data[3 *
k] = pvaUR->
data[0][0];
2980 posSeg[0]->
data[3 *
k + 1] = pvaUR->
data[0][1];
2981 posSeg[0]->
data[3 *
k + 2] = pvaUR->
data[0][2];
2983 velSeg[0]->
data[3 *
k] = pvaUR->
data[1][0];
2984 velSeg[0]->
data[3 *
k + 1] = pvaUR->
data[1][1];
2985 velSeg[0]->
data[3 *
k + 2] = pvaUR->
data[1][2];
2987 accSeg[0]->
data[3 *
k] = pvaUR->
data[2][0];
2988 accSeg[0]->
data[3 *
k + 1] = pvaUR->
data[2][1];
2989 accSeg[0]->
data[3 *
k + 2] = pvaUR->
data[2][2];
3016 return ( ( ( freq_event * A1 + f1dot_event * B1 ) - U1start ) * U1winInv ) + 0.5;
3035 *U2idx = (
INT4 )( ( ( ( f1dot_event + freq_event * A2 + 2.0 * f1dot_event * B2 ) - U2start ) * U2winInv ) + 0.5 );
3076 if ( ( stacks =
XLALCalloc( 1,
sizeof( *stacks ) ) ) == NULL ) {
3080 stacks->
length = numSegments;
3093 INT4 iSFT0 = 0, iSFT1 = 0;
3094 for ( iSeg = 0; iSeg < numSegments; iSeg ++ ) {
3122 XLALPrintError(
"%s: start of current SFT %d lies before current segment %d ==> code seems inconsistent!\n",
__func__, iSFT1, iSeg );
3136 INT4 numSFTsInSeg = iSFT1 - iSFT0 + 1;
3147 for ( iSFT = iSFT0; iSFT <= iSFT1; iSFT++ ) {
3148 stacks->
data[iSeg].
data[iSFT - iSFT0] = catalog->
data[iSFT];
3179 if ( deltaTau == 0 ) {
3186 for (
UINT4 j = 0;
j < numElements;
j++ ) {
3189 fkdot[0] =
elem->Freq;
3190 fkdot[1] =
elem->F1dot;
3191 fkdot[2] =
elem->F2dot;
3192 fkdot[3] =
elem->F3dot;
3199 elem->Freq = fkdot[0];
3200 elem->F1dot = fkdot[1];
3201 elem->F2dot = fkdot[2];
3202 elem->F3dot = fkdot[3];
3218 if ( !fname || !ti ) {
3224 if ( (
fp = fopen( fname,
"rb" ) ) == NULL ) {
3225 XLAL_CHECK( (
fp = fopen( fname,
"wb" ) ) != NULL,
XLAL_ESYS,
"Failed to open new timing-file '%s' for writing\n", fname );
3226 fprintf(
fp,
"%%%%--------------------------------------------------------------------------------\n" );
3227 fprintf(
fp,
"%%%% GCT Timing model:\n" );
3228 fprintf(
fp,
"%%%% runtime = Nseg * Ndet * Ncoh * tau_Fstat + Nseg * Ninc * tau_SumF + Ninc * tau_Bayes + Ncan * tau_Recalc + time_Other\n" );
3229 fprintf(
fp,
"%%%%--------------------------------------------------------------------------------\n" );
3231 fprintf(
fp,
"%2s%10s %10s %10s %10s %10s | %6s %6s %10s %6s %10s %10s %10s %10s %%%15s %15s\n",
3232 "%%",
"tau_Fstat",
"tau_SumF",
"tau_Bayes",
"tau_Recalc",
"time_Other",
3233 "Nseg",
"Ndet",
"Tcoh[s]",
"Nsft",
"NFreqCo",
"Ncoh",
"Ninc",
"Ncand",
"FstatMethod",
"RecalcMethod" );
3236 XLAL_CHECK( (
fp = fopen( fname,
"ab" ) ) != NULL,
XLAL_ESYS,
"Failed to open existing timing-file '%s' for appending\n", fname );
3239 fprintf(
fp,
"%12.1e %10.1e %10.1e %10.1e %10.1e %6d %6d %10d %6d %10d %10.1e %10.1e %10d %%%15s %15s\n",
#define __func__
log an I/O error, i.e.
void InitDopplerSkyScan(LALStatus *status, DopplerSkyScanState *skyScan, const DopplerSkyScanInit *init)
void FreeDopplerSkyScan(LALStatus *status, DopplerSkyScanState *skyScan)
int XLALNextDopplerSkyPos(PulsarDopplerParams *pos, DopplerSkyScanState *skyScan)
NextDopplerSkyPos(): step through sky-grid return 0 = OK, -1 = ERROR.
@ STATE_FINISHED
all templates have been read
@ GRID_METRIC
generate grid using a 2D sky-metric
int create_gctFstat_toplist(toplist_t **tl, UINT8 length, SortBy_t whatToSortBy)
creates a toplist with length elements, returns -1 on error (usually out of memory),...
void free_gctFstat_toplist(toplist_t **l)
frees the space occupied by the toplist
int clear_gct_checkpoint(const char *filename)
removes a checkpoint returns 0 on success, errno on failure
int insert_into_gctFstat_toplist(toplist_t *tl, GCTtopOutputEntry *elem)
Inserts an element in to the toplist either if there is space left or the element is larger than the ...
int write_hfs_oputput(const char *filename, toplist_t *tl)
write the final output file:
SortBy_t
enumerate all toplist-sorting options: by F (0), number-count (1), BSGL (2), "dual" toplists F + BSGL...
@ SORTBY_F_BSGLtL_BtSGLtL
void * toplist_elem(toplist_t *list, size_t ind)
#define TEST_FSTAT_TOPLIST_INCLUSION(list, element)
int XLALReadSegmentsFromFile_support_4column_format
int main(int argc, char *argv[])
int compareFineGridsumTwoF(const void *a, const void *b)
void UpdateSemiCohToplists(LALStatus *status, toplist_t *list1, toplist_t *list2, toplist_t *list3, FineGrid *in, REAL8 f1dot_fg, REAL8 f2dot_fg, REAL8 f3dot_fg, UsefulStageVariables *usefulparams, REAL4 NSegmentsInv, REAL4 *NSegmentsInvX, BOOLEAN have_f3dot)
Get SemiCoh candidates into toplist(s) This function allows for inserting candidates into up to 3 top...
#define FSTART
Default Start search frequency.
void PrintFstatVec(LALStatus *status, FstatResults *in, FILE *fp, PulsarDopplerParams *thisPoint, LIGOTimeGPS refTime, INT4 stackIndex)
Print Fstat vectors.
#define MISMATCH
Default for metric grid maximal mismatch value.
#define F3DOT
Default value of third spindown.
#define DDELTA
Default resolution for isotropic or flat grids.
void SetUpStacks(LALStatus *status, SFTCatalogSequence *out, REAL8 tStack, SFTCatalog *in, UINT4 nStacksMax)
Breaks up input sft catalog into specified number of stacks Loops over elements of the catalog,...
#define DF3DOT
Default range of third spindown parameter.
SFTCatalogSequence * XLALSetUpStacksFromSegmentList(const SFTCatalog *catalog, const LALSegList *segList)
Set up 'segmented' SFT-catalogs for given list of segments and a total SFT-catalog.
#define SET_GCT_CHECKPOINT
#define DALPHA
Default resolution for isotropic or flat grids.
#define GET_GCT_CHECKPOINT
void GetSegsPosVelAccEarthOrb(LALStatus *status, REAL8VectorSequence **posSeg, REAL8VectorSequence **velSeg, REAL8VectorSequence **accSeg, UsefulStageVariables *usefulparams)
Calculate Earth orbital position, velocity and acceleration at midpoint of each segment.
LALStatus * global_status
int compareFineGridNC(const void *a, const void *b)
static REAL4 findLoudestTwoF(const FstatResults *in)
char * global_column_headings_stringp
void UpdateSemiCohToplistsOptimTriple(LALStatus *status, SortBy_t toplist_sortby, toplist_t *list1, toplist_t *list2, toplist_t *list3, FineGrid *in, REAL8 f1dot_fg, REAL8 f2dot_fg, REAL8 f3dot_fg, UsefulStageVariables *usefulparams, REAL4 NSegmentsInv, REAL4 *NSegmentsInvX, BOOLEAN have_f3dot)
Get SemiCoh candidates into toplist(s) This function allows for inserting candidates into up to 3 top...
int compareCoarseGridUindex(const void *a, const void *b)
#define SKYREGION
default sky region to search over – just a single point
#define F2DOT
Default value of second spindown.
#define DF2DOT
Default range of second spindown parameter.
static INT4 ComputeU1idx(REAL8 freq_event, REAL8 f1dot_event, REAL8 A1, REAL8 B1, REAL8 U1start, REAL8 U1winInv)
Calculate the U1 index for a given point in parameter space.
#define FDOT
Default value of first spindown.
int XLALExtrapolateToplistPulsarSpins(toplist_t *list, const LIGOTimeGPS usefulParamsRefTime, const LIGOTimeGPS finegridRefTime)
XLAL function to extrapolate the pulsar spin parameters of all toplist candidates from reftime of the...
#define NCAND1
Default number of candidates to be followed up from first stage.
void PrintStackInfo(LALStatus *status, const SFTCatalogSequence *catalogSeq, FILE *fp)
Print some stack info from sft catalog sequence.
#define DFDOT
Default range of first spindown parameter.
#define FBAND
Default search band.
void ComputeU2idx(REAL8 freq_event, REAL8 f1dot_event, REAL8 A2, REAL8 B2, REAL8 U2start, REAL8 U2winInv, INT4 *U2idx)
Calculate the U2 index for a given point in parameter space.
static int write_TimingInfo(const CHAR *fname, const timingInfo_t *ti)
Function to append one timing-info line to output file.
#define FNAMEOUT
Default output file basename.
#define FSTATTHRESHOLD
Default threshold on Fstatistic for peak selection.
void PrintCatalogInfo(LALStatus *status, const SFTCatalog *catalog, FILE *fp)
Print some sft catalog info.
void SetUpSFTs(LALStatus *status, UsefulStageVariables *in)
Set up stacks, read SFTs, calculate SFT noise weights and calculate detector-state.
#define HIERARCHICALSEARCH_EMEM
#define FG_INDEX(fg, iFreq)
#define HIERARCHICALSEARCH_MSGEXLAL
#define HIERARCHICALSEARCH_MSGENULL
#define FG_FX_INDEX(fg, iDet, iFreq)
#define HIERARCHICALSEARCH_ESUB
#define HIERARCHICALSEARCH_MSGEFILE
#define HIERARCHICALSEARCH_ECHECKPT
#define HIERARCHICALSEARCH_ENULL
#define HIERARCHICALSEARCH_MSGESUB
#define HIERARCHICALSEARCH_MSGECHECKPT
#define HIERARCHICALSEARCH_MSGESFT
#define FINEGRID_NC_T
structure for storing fine-grid points
#define HIERARCHICALSEARCH_MSGEBAD
#define HIERARCHICALSEARCH_EFILE
#define HIERARCHICALSEARCH_EBAD
#define HIERARCHICALSEARCH_EVAL
#define HIERARCHICALSEARCH_ECG
#define HIERARCHICALSEARCH_MSGEVAL
#define HIERARCHICALSEARCH_ENORM
#define HIERARCHICALSEARCH_EXLAL
#define CG_INDEX(cg, iStack, iFreq)
#define HIERARCHICALSEARCH_MSGEMEM
#define CG_FX_INDEX(cg, iDet, iStack, iFreq)
#define HIERARCHICALSEARCH_ESFT
lal_errhandler_t lal_errhandler
int LAL_ERR_EXIT(LALStatus *stat, const char *func, const char *file, const int line, volatile const char *id)
#define LAL_CALL(function, statusptr)
void LALCheckMemoryLeaks(void)
const LALVCSInfoList lalPulsarVCSInfoList
NULL-terminated list of VCS and build information for LALPulsar and its dependencies
static double double delta
#define ABORT(statusptr, code, mesg)
#define XLAL_CHECK_LAL(sp, assertion,...)
#define TRY(func, statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
int XLALComputeExtraStatsForToplist(toplist_t *list, const RecalcStatsParams *recalcParams)
XLAL function to go through a (Hough or GCT) toplist and compute line-robust statistics for each cand...
Functions to recompute statistics for GCT/hough toplist entries.
static void gc_hotloop_2Fmax_tracking(REAL4 *fgrid2F, REAL4 *fgrid2Fmax, UINT4 *fgrid2FmaxIdx, REAL4 *cgrid2F, UINT4 k, UINT4 length) __attribute__((hot))
static void gc_hotloop(REAL4 *fgrid2F, REAL4 *cgrid2F, UCHAR *fgridnc, REAL4 TwoFthreshold, UINT4 length) __attribute__((hot))
static void gc_hotloop_no_nc(REAL4 *fgrid2F, REAL4 *cgrid2F, UINT4 length) __attribute__((hot))
REAL8VectorSequence * XLALCreateREAL8VectorSequence(UINT4 length, UINT4 veclen)
void XLALDestroyREAL8VectorSequence(REAL8VectorSequence *vecseq)
PulsarParamsVector * XLALPulsarParamsFromUserInput(const LALStringVector *UserInput, const LIGOTimeGPS *refTimeDef)
Function to determine the PulsarParamsVector input from a user-input defining CW sources.
const char *const InjectionSourcesHelpString
void XLALDestroyPulsarParamsVector(PulsarParamsVector *ppvect)
Destructor for PulsarParamsVector type.
const MultiLIGOTimeGPSVector * XLALGetFstatInputTimestamps(const FstatInput *input)
Returns the SFT timestamps stored in a FstatInput structure.
FstatMethodType
Different methods available to compute the -statistic, falling into two broad classes:
const MultiLALDetector * XLALGetFstatInputDetectors(const FstatInput *input)
Returns the detector information stored in a FstatInput structure.
const CHAR * XLALGetFstatInputMethodName(const FstatInput *input)
Returns the human-readable name of the -statistic method being used by a FstatInput structure.
const FstatOptionalArgs FstatOptionalArgsDefaults
Global initializer for setting FstatOptionalArgs to default values.
const UserChoices * XLALFstatMethodChoices(void)
Return pointer to a static array of all (available) FstatMethodType choices.
void XLALDestroyFstatInputVector(FstatInputVector *inputs)
Free all memory associated with a FstatInputVector structure.
int XLALAppendFstatTiming2File(const FstatInput *input, FILE *fp, BOOLEAN printHeader)
FstatInputVector * XLALCreateFstatInputVector(const UINT4 length)
Create a FstatInputVector of the given length, for example for setting up F-stat searches over severa...
FstatQuantities
Bit-field of -statistic quantities which can be computed by XLALComputeFstat().
FstatInput * XLALCreateFstatInput(const SFTCatalog *SFTcatalog, const REAL8 minCoverFreq, const REAL8 maxCoverFreq, const REAL8 dFreq, const EphemerisData *ephemerides, const FstatOptionalArgs *optionalArgs)
Create a fully-setup FstatInput structure for computing the -statistic using XLALComputeFstat().
int XLALComputeFstat(FstatResults **Fstats, FstatInput *input, const PulsarDopplerParams *doppler, const UINT4 numFreqBins, const FstatQuantities whatToCompute)
Compute the -statistic over a band of frequencies.
void XLALDestroyFstatResults(FstatResults *Fstats)
Free all memory associated with a FstatResults structure.
@ FSTATQ_2F
Compute multi-detector .
@ FSTATQ_2F_PER_DET
Compute for each detector.
int XLALParseMultiNoiseFloorMapped(MultiNoiseFloor *multiNoiseFloor, const LALStringVector *multiNoiseFloorDetNames, const LALStringVector *sqrtSX, const LALStringVector *sqrtSXDetNames)
Parse string-vectors (typically input by user) of N detector noise-floors for detectors ,...
EphemerisData * XLALInitBarycenter(const CHAR *earthEphemerisFile, const CHAR *sunEphemerisFile)
XLAL interface to reading ephemeris files 'earth' and 'sun', and return ephemeris-data in old backwar...
void XLALDestroyEphemerisData(EphemerisData *edat)
Destructor for EphemerisData struct, NULL robust.
#define XLAL_INIT_DECL(var,...)
void * XLALCalloc(size_t m, size_t n)
char char * XLALStringDuplicate(const char *s)
int char * XLALStringAppend(char *s, const char *append)
char * XLALVCSInfoString(const LALVCSInfoList vcs_list, const int verbose, const char *prefix)
REAL4 XLALComputeBSGLtL(const REAL4 twoF, const REAL4 twoFX[PULSAR_MAX_DETECTORS], const REAL4 maxtwoFlX[PULSAR_MAX_DETECTORS], const BSGLSetup *setup)
Single-bin wrapper of XLALVectorComputeBSGLtL(), provided for backwards compatibility.
REAL4 XLALComputeBtSGLtL(const REAL4 maxtwoFl, const REAL4 twoFX[PULSAR_MAX_DETECTORS], const REAL4 maxtwoFXl[PULSAR_MAX_DETECTORS], const BSGLSetup *setup)
Single-bin wrapper of XLALVectorComputeBtSGLtL(), provided for backwards compatibility.
void XLALDestroyBSGLSetup(BSGLSetup *setup)
BSGLSetup * XLALCreateBSGLSetup(const UINT4 numDetectors, const REAL4 Fstar0sc, const REAL4 oLGX[PULSAR_MAX_DETECTORS], const BOOLEAN useLogCorrection, const UINT4 numSegments)
REAL4 XLALComputeBSGL(const REAL4 twoF, const REAL4 twoFX[PULSAR_MAX_DETECTORS], const BSGLSetup *setup)
Single-bin wrapper of XLALVectorComputeBSGL(), provided for backwards compatibility.
int XLALParseLinePriors(REAL4 oLGX[PULSAR_MAX_DETECTORS], const LALStringVector *oLGX_string)
Parse string-vectors (typically input by user) of N per-detector line-to-Gaussian prior ratios to a ...
void void LogPrintfVerbatim(LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
void LogPrintf(LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
@ LAL_PMETRIC_COH_PTOLE_ANALYTIC
#define PULSAR_MAX_DETECTORS
maximal number of detectors we can handle (for static arrays of detector quantities)
REAL8 PulsarSpins[PULSAR_MAX_SPINS]
Typedef for fixed-size array holding GW frequency and derivatives fk = d^k Freq/dt^k|(tau_ref)
const LALDetector * XLALGetSiteInfo(const CHAR *name)
Find the site geometry-information 'LALDetector' for given a detector name (or prefix).
void XLALDestroySFTCatalog(SFTCatalog *catalog)
Free an 'SFT-catalogue'.
int XLALCheckCRCSFTCatalog(BOOLEAN *crc_check, SFTCatalog *catalog)
This function reads in the SFTs in the catalog and validates their CRC64 checksums.
LALSegList * XLALReadSegmentsFromFile(const char *fname)
Function to read a segment list from given filename, returns a sorted LALSegList.
LIGOTimeGPSVector * XLALCreateTimestampVector(UINT4 len)
Allocate a LIGOTimeGPSVector.
LALStringVector * XLALListIFOsInCatalog(const SFTCatalog *catalog)
Return a sorted string vector listing the unique IFOs in the given catalog.
SFTCatalog * XLALSFTdataFind(const CHAR *file_pattern, const SFTConstraints *constraints)
Find the list of SFTs matching the file_pattern and satisfying the given constraints,...
int XLALCWGPSinRange(const LIGOTimeGPS gps, const LIGOTimeGPS *minGPS, const LIGOTimeGPS *maxGPS)
Defines the official CW convention for whether a GPS time is 'within' a given range,...
void XLALDestroyTimestampVector(LIGOTimeGPSVector *vect)
De-allocate a LIGOTimeGPSVector.
const UserChoices SSBprecisionChoices
Static array of all SSBprecision choices, for use by the UserInput module parsing routines.
int XLALSegListClear(LALSegList *seglist)
void XLALDestroyStringVector(LALStringVector *vect)
vect3Dlist_t * XLALComputeOrbitalDerivatives(UINT4 maxorder, const LIGOTimeGPS *tGPS, const EphemerisData *edat)
Compute time-derivatives up to 'maxorder' of the Earths' orbital position vector .
void XLALDestroyVect3Dlist(vect3Dlist_t *list)
#define XLAL_ERROR_NULL(...)
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_MAIN(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
def SFTCatalog(tstart, Tdata, finputdata)
CHAR * uvar_ephemEarth
Earth ephemeris file to use.
CHAR * uvar_ephemSun
Sun ephemeris file to use.
structure for storing coarse-grid points
initialization-structure passed to InitDopplerSkyScan()
const EphemerisData * ephemeris
ephemeris-data for "exact" metric
BOOLEAN projectMetric
project the metric orthogonal to Freq?
UINT4 numSkyPartitions
number of (roughly) equal partitions to split sky-grid into
UINT4 partitionIndex
index of requested sky-grid partition: in [0, numPartitions - 1]
const CHAR * skyGridFile
file containing a sky-grid (list of points) if GRID_FILE
LIGOTimeGPS obsBegin
GPS start-time of time-series.
REAL8 dDelta
sky step-sizes for GRID_FLAT and GRID_ISOTROPIC
REAL8 Freq
Frequency for which to build the skyGrid.
DopplerGridType gridType
which type of skygrid to generate
REAL8 obsDuration
length of time-series in seconds
REAL8 metricMismatch
for GRID_METRIC
LALPulsarMetricType metricType
which metric to use if GRID_METRIC
CHAR * skyRegionString
sky-region to search: format polygon '(a1,d1), (a2,d2), ..'
const LALDetector * Detector
Current detector.
this structure reflects the current state of a DopplerSkyScan
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
REAL4 * sumTwoFX
sum of per-IFO 2F-values, 2D array over frequencies and detectors (of length 'freqlengthAL*numDetecto...
REAL8 alpha
right ascension
FINEGRID_NC_T * nc
number count (1D array over frequencies, of length 'length')
UINT4 * maxTwoFXlIdx
segment index (zero based) of corresponding entry in maxTwoFXl
REAL8 dfreq_fg
fine-grid spacing in frequency
UINT4 numDetectors
number of detectors for sumTwoFX array
REAL8 freqmin_fg
fine-grid start in frequency
UINT4 freqlength
number of fine-grid points in frequency
REAL4 * maxTwoFXl
maximum of per-IFO 2F over segments, 2D array over frequencies and detectors (of length 'freqlengthAL...
UINT4 length
length of multi-IFO stats vectors 'sumTwoF', 'nc' (currently 'length'= 'freqlength')
UINT4 freqlengthAL
"aligned" number of fine-grid points in frequency: in blocks of 16 bytes, consistent with ALAlloc() [...
LIGOTimeGPS refTime
reference time for candidates
REAL4 * maxTwoFl
maximum of multi-IFO 2F over segments, 1D array over fine-grid frequencies (of length 'length')
UINT4 * maxTwoFlIdx
segment index (zero based) of corresponding entry in maxTwoFl
REAL4 * sumTwoF
sum of 2F-values, 1D array over fine-grid frequencies (of length 'length')
Struct of optional 'advanced level' and (potentially method-specific) arguments to be passed to the ...
PulsarParamsVector * injectSources
Vector of parameters of CW signals to simulate and inject.
UINT4 runningMedianWindow
If SFT noise weights are calculated from the SFTs, the running median window length to use.
MultiNoiseFloor * assumeSqrtSX
Single-sided PSD values to be used for computing SFT noise weights instead of from a running median o...
FstatInput * prevInput
An FstatInput structure from a previous call to XLALCreateFstatInput(); may contain common workspace ...
BOOLEAN collectTiming
a flag to turn on/off the collection of F-stat-method-specific timing-data
UINT4 Dterms
Number of Dirichlet kernel terms, used by some Demod methods; see FstatMethodType.
FstatMethodType FstatMethod
Method to use for computing the -statistic.
SSBprecision SSBprec
Barycentric transformation precision.
XLALComputeFstat() computed results structure.
UINT4 numDetectors
Number of detectors over which the were computed.
REAL4 * twoFPerDet[PULSAR_MAX_DETECTORS]
If whatWasComputed & FSTATQ_2F_PER_DET is true, the values computed at numFreqBins frequencies space...
REAL8 dFreq
Spacing in frequency between each computed -statistic.
UINT4 numFreqBins
Number of frequencies at which the were computed.
REAL4 * twoF
If whatWasComputed & FSTATQ_2F is true, the multi-detector values computed at numFreqBins frequencie...
CHAR detectorNames[PULSAR_MAX_DETECTORS][3]
Names of detectors over which the were computed.
A vector of 'timestamps' of type LIGOTimeGPS.
LIGOTimeGPS * data
array of timestamps
array of detectors definitions 'LALDetector'
UINT4 length
number of detectors
LALDetector sites[PULSAR_MAX_DETECTORS]
array of site information
A collection of (multi-IFO) LIGOTimeGPSVector time-stamps vectors.
array of detector-specific 'noise floors' (ie PSD values), assumed constant over the frequency-band o...
Type containing the 'Doppler-parameters' affecting the time-evolution of the phase.
PulsarSpins fkdot
Intrinsic spins: [Freq, f1dot, f2dot, ... ] where fkdot = d^kFreq/dt^k.
REAL8 Delta
Sky position: DEC (latitude) in equatorial coords and radians.
LIGOTimeGPS refTime
Reference time of pulsar parameters (in SSB!)
REAL8 Alpha
Sky position: RA (longitude) in equatorial coords and radians.
REAL8 asini
Binary: projected, normalized orbital semi-major axis (s).
Straightforward vector type of N PulsarParams structs.
Contains a "spin-range", ie spins and corresponding bands at a given (SSB) reference GPS-time .
LIGOTimeGPS refTime
SSB reference GPS-time at which spin-range is defined.
PulsarSpins fkdotBand
Vector of spin-bands , MUST be same length as fkdot.
Type containing input arguments for XLALComputeExtraStatsForToplist()
An "SFT-catalogue": a vector of SFTdescriptors, as returned by XLALSFTdataFind()
SFTDescriptor * data
array of data-entries describing matched SFTs
UINT4 length
number of SFTs in catalog
sequence of SFT catalogs – for each segment
SFTCatalog * data
the catalogs
UINT4 length
the number of stacks
'Constraints' for SFT-matching: which detector, within which time-stretch and which timestamps exactl...
LIGOTimeGPS * maxStartTime
only include SFTs whose epoch is < maxStartTime
LIGOTimeGPS * minStartTime
only include SFTs whose epoch is >= minStartTime
A 'descriptor' of an SFT: basically containing the header-info plus an opaque description of where ex...
SFTtype header
SFT-header info.
parameters for the semicoherent stage
REAL8VectorSequence * acc
Earth orbital acceleration for each segment (new)
REAL8VectorSequence * pos
Earth orbital position for each segment.
LIGOTimeGPSVector * tsMid
timestamps of mid points of segments
CHAR * outBaseName
file for writing output – if chosen
LIGOTimeGPS refTime
reference time for f, fdot definition
REAL8VectorSequence * vel
Earth orbital velocity for each segment.
UINT4 extraBinsFstat
Extra bins required for Fstat calculation.
useful variables for each hierarchical stage
REAL8 mismatch1
'mismatch1' user-input needed here internally ...
LIGOTimeGPSVector * startTstack
timestamps vector for start time of each stack
REAL8 df2dot
coarse grid resolution in 2nd spindown
PulsarSpinRange spinRange_refTime
freq and fdot range at the reference time
LIGOTimeGPSVector * endTstack
timestamps vector for end time of each stack
REAL8 tObs
tEndGPS - tStartGPS
UINT4 nf1dot
number of 1st spindown Fstat bins
UINT4 binsFstatSearch
nominal number of Fstat frequency bins in search band
FstatMethodType Fmethod
which Fstat-method/algorithm to use
LIGOTimeGPS tStartGPS
start and end time of stack
REAL8 df1dot
coarse grid resolution in spindown
UINT4 nStacks
number of stacks
PulsarSpinRange spinRange_startTime
freq and fdot range at start-time of observation
PulsarSpinRange spinRange_midTime
freq and fdot range at mid-time of observation
REAL4 NSegmentsInvX[PULSAR_MAX_DETECTORS]
effective inverse number of segments per detector (needed for correct averaging in single-IFO F calcu...
FstatInputVector * Fstat_in_vec_recalc
Recalculate the toplist: Vector of Fstat input data structures for XLALComputeFstat(),...
REAL8 tStack
duration of stacks
UINT4 nf2dot
number of 2nd spindown Fstat bins
REAL8 dFreqStack
frequency resolution of Fstat calculation
LALStringVector * detectorIDs
vector of detector IDs
FstatInputVector * Fstat_in_vec
Original wide-parameter search: vector of Fstat input data structures for XLALComputeFstat(),...
PulsarSpinRange spinRange_endTime
freq and fdot range at end-time of observation
REAL8 refTime
reference time for pulsar params
LIGOTimeGPS maxStartTimeGPS
all sft timestamps must be before this GPS time
LALSegList * segmentList
parsed segment list read from user-specified input file –segmentList
UINT4 Dterms
size of Dirichlet kernel for Fstat calculation
BOOLEAN recalcToplistStats
do additional analysis for all toplist candidates, output F, FXvector for postprocessing */
EphemerisData * edat
ephemeris data for XLALBarycenter
LIGOTimeGPS minStartTimeGPS
all sft data must be after this time
UINT4 nf3dot
number of 3rd spindown Fstat bins
UINT4 extraBinsFstat
Extra Fstat frequency bins required to cover residual spindowns.
FstatMethodType FmethodRecalc
which Fstat-method/algorithm to use for the recalc step
CHAR * sftbasename
filename pattern for sfts
UINT4 nSFTs
total number of SFTs
LIGOTimeGPSVector * midTstack
timestamps vector for mid time of each stack
REAL8 df3dot
coarse grid resolution in 3rd spindown
int SSBprec
SSB transform precision.
UINT4 DtermsRecalc
Recalc: size of Dirichlet kernel for Fstat calculation.
BOOLEAN collectFstatTiming
flag whether to collect and output F-stat timing info
LALStringVector * assumeSqrtSX
Assume stationary Gaussian noise with detector noise-floors sqrt{SX}".
BSGLSetup * BSGLsetup
pre-computed setup for line-robust statistic BSGL
UINT4 blocksRngMed
blocksize for running median noise floor estimation
PulsarParamsVector * injectionSources
Source parameters to inject: comma-separated list of file-patterns and/or direct config-strings ('{....
Struct holding various timing measurements and relevant search parameters.
UINT4 Nsft
total number of SFTs
REAL8 Ninc
number of fine-grid templates ('incoherent')
REAL8 Ncoh
number of coarse-grid Fstat templates ('coherent')
UINT4 Tcoh
length of coherent segments in seconds
UINT4 Ncand
length of toplists
UINT4 NFreqCo
total number of frequency bins computed in coarse grid (including sidebands!)
UINT4 Ndet
number of detectors
const char * FstatMethodStr
Fstat-method used.
const char * RecalcMethodStr
Fstat-method used.
UINT4 Nseg
number of semi-coherent segments
variable-length list of 3D vectors
vect3D_t * data
array of 3D vectors