118#include <lal/LALString.h>
129#define HS_CHECKPOINTING 0
130#define GET_CHECKPOINT(toplist,total,count,outputname,cptname) *total=0;
131#define INSERT_INTO_HOUGHFSTAT_TOPLIST insert_into_houghFstat_toplist
132#define SHOW_PROGRESS(rac,dec,tpl_count,tpl_total,freq,fband)
133#define SET_CHECKPOINT
137#ifndef COMPUTEFSTATHOUGHMAP
138#define COMPUTEFSTATHOUGHMAP ComputeFstatHoughMap
140#ifndef GPUREADY_DEFAULT
141#define GPUREADY_DEFAULT 0
143#ifndef REARRANGE_SFT_DATA
144#define REARRANGE_SFT_DATA
146#ifndef INITIALIZE_COPROCESSOR_DEVICE
147#define INITIALIZE_COPROCESSOR_DEVICE
149#ifndef UNINITIALIZE_COPROCESSOR_DEVICE
150#define UNINITIALIZE_COPROCESSOR_DEVICE
153#if USE_OPENCL_KERNEL || defined(USE_CUDA)
166#define HSMAX(x,y) ( (x) > (y) ? (x) : (y) )
167#define HSMIN(x,y) ( (x) < (y) ? (x) : (y) )
169#define BLOCKSIZE_REALLOC 50
251#define SKYREGION "allsky"
256#define FSTATTHRESHOLD 2.6
258#define FNAMEOUT "./out/HS.dat"
259#define PIXELFACTOR 2.0
261#define LAL_INT4_MAX 2147483647
278int MAIN(
int argc,
char *argv[]) {
284 UINT4 skyGridCounter;
310 static LIGOTimeGPS minStartTimeGPS, maxStartTimeGPS;
318 REAL8 df1dot, df1dotRes;
319 UINT4 nf1dot, nf1dotRes;
326 UINT4 binsFstat1, binsFstatSearch;
332 REAL8 alphaPeak, sumWeightSquare, meanN=0, sigmaN=0;
352 CHAR *fnameSemiCohCand=NULL;
353 CHAR *fnameFstatVec1=NULL;
354 FILE *fpSemiCoh=NULL;
378 REAL8 uvar_dFreq = 0;
379 REAL8 uvar_df1dot = 0;
385 REAL8 uvar_df1dotRes = 0;
386 REAL8 uvar_threshold1 = 0;
387 REAL8 uvar_minStartTime1 = 0;
389 REAL8 uvar_dopplerMax = 1.05e-4;
392 REAL8 uvar_semiCohPatchX = 0;
393 REAL8 uvar_semiCohPatchY = 0;
394 REAL8 uvar_tStack = 0;
396 INT4 uvar_method = -1;
400 INT4 uvar_nStacksMax = 1;
403 INT4 uvar_nf1dotRes = 1;
406 INT4 uvar_skyPointIndex = -1;
412 CHAR *uvar_fnameout = NULL;
413 CHAR *uvar_DataFiles1 = NULL;
414 CHAR *uvar_skyGridFile=NULL;
415 INT4 uvar_numSkyPartitions = 0;
416 INT4 uvar_partitionIndex = 0;
420 INT4 uvar_gpu_device = -1;
423#ifdef EAH_LALDEBUGLEVEL
445 " - '<SFT file>;<SFT file>;...', where <SFT file> may contain wildcards\n - 'list:<file containing list of SFT files>'") ==
XLAL_SUCCESS,
XLAL_EFUNC);
446 XLAL_CHECK_MAIN(
XLALRegisterNamedUvar( &
uvar_skyRegion,
"skyRegion",
STRING, 0, OPTIONAL,
"Sky-region by polygon of form '(ra1,dec1),(ra2,dec2),(ra3,dec3),...' or 'allsky'") ==
XLAL_SUCCESS,
XLAL_EFUNC);
511 if(uvar_gpu_device >= 0)
515 if ( (uvar_method != 0) && (uvar_method != 1) && (uvar_method != -1)) {
516 fprintf(stderr,
"Invalid method....must be 0, 1 or -1\n");
520 if ( uvar_nStacksMax < 1) {
521 fprintf(stderr,
"Invalid number of stacks\n");
527 fprintf(stderr,
"Invalid Running Median block size\n");
531 if ( uvar_peakThrF < 0 ) {
532 fprintf(stderr,
"Invalid value of Fstatistic threshold\n");
537 alphaPeak = (1+uvar_peakThrF)*exp(-uvar_peakThrF);
548 strcpy(fnamelog, uvar_fnameout);
549 strcat(fnamelog,
".log");
551 if ((fpLog = fopen(fnamelog,
"wb")) == NULL) {
552 fprintf(stderr,
"Unable to open file %s for writing\n", fnamelog);
560 fprintf( fpLog,
"## Log file for HierarchicalSearch.c\n\n");
561 fprintf( fpLog,
"# User Input:\n");
562 fprintf( fpLog,
"#-------------------------------------------\n");
567 fprintf ( fpLog,
"%s", VCSInfoString );
586 if ( uvar_printCand1 )
591 strcpy(fnameSemiCohCand, uvar_fnameout);
595 if ( uvar_printFstat1 )
597 const CHAR *append =
"_fstatVec1.dat";
600 strcpy(fnameFstatVec1, uvar_fnameout);
601 strcat(fnameFstatVec1, append);
602 if ( !(fpFstat1 = fopen( fnameFstatVec1,
"wb")))
604 fprintf ( stderr,
"Unable to open Fstat file fstatvec1.out for writing.\n");
615 usefulParams.
nStacks = uvar_nStacksMax;
616 usefulParams.
tStack = uvar_tStack;
617 usefulParams.
SSBprec = uvar_SSBprecision;
635 usefulParams.
Dterms = uvar_Dterms;
661 tStack = usefulParams.
tStack;
662 tObs = usefulParams.
tObs;
663 nStacks = usefulParams.
nStacks;
677 df1dot = uvar_df1dot;
680 df1dot = 1.0/(tStack*tStack);
689 nf1dotRes = uvar_nf1dotRes;
698 df1dotRes = uvar_df1dotRes;
701 df1dotRes = df1dot/nf1dotRes;
724 LogPrintf(
LOG_DETAIL,
"Frequency and spindown range at startTime (%d): [%f-%f], [%e-%e]\n",
746 LogPrintf(
LOG_DETAIL,
"1st stage params: Nstacks = %d, Tstack = %.0fsec, dFreq = %eHz, Tobs = %.0fsec\n",
747 nStacks, tStack, usefulParams.
dFreqStack, tObs);
748 if ( weightsNoise ) {
749 for (
k = 0;
k < nStacks;
k++) {
756 REAL8 FreqBugCorrection = 0;
757 if ( uvar_correctFreqs )
759 FreqBugCorrection = uvar_Freq - uvar_dFreq * floor ( uvar_Freq / uvar_dFreq + 0.5 );
760 printf (
"Applying frequency-correction shift of %.9g Hz \n", FreqBugCorrection );
764 printf (
"WARNING: turned off frequency-shift bug correction! I hope you know what you're doing!\n");
773 thisPoint.
asini = 0 ;
779 semiCohPar.
tsMid = midTstack;
784 semiCohPar.
vel = velStack;
785 semiCohPar.
pos = posStack;
789 semiCohPar.
nfdot = nf1dotRes;
790 semiCohPar.
dfdot = df1dotRes;
793 semiCohCandList.
length = uvar_nCand1;
796 semiCohCandList.
refTime = tMidGPS;
820 fstatVector.
length = nStacks;
821 fstatVector.
data = NULL;
864 for(skyGridCounter = 0; skyGridCounter <
count; skyGridCounter++)
872 for(skyGridCounter = 0; (skyGridCounter <
count)&&(thisScan.state !=
STATE_FINISHED) ; skyGridCounter++)
877#ifdef SKYPOS_PRECISION
898#ifdef SKYPOS_PRECISION
905 skyGridCounter,thisScan.numSkyGridPoints,
906 uvar_Freq, uvar_FreqBand);
927 if (uvar_useWeights) {
933 for (
k = 0;
k < nStacks;
k++) {
957 extraBinsfdot = (
UINT4)(tObs * (nf1dotRes - 1) * df1dotRes / usefulParams.
dFreqStack + 0.5);
965 for (
k = 0;
k < nStacks;
k++) {
995 for ( ifdot = 0; ifdot < nf1dot; ifdot++)
998 LogPrintf(
LOG_DETAIL,
"Analyzing %d/%d Coarse sky grid points and %d/%d spindown values\n",
999 skyGridCounter, thisScan.numSkyGridPoints, ifdot+1, nf1dot);
1002 thisScan.numSkyGridPoints, uvar_Freq, uvar_FreqBand);
1007 for (
k = 0;
k < nStacks;
k++)
1014 const int retn =
XLALComputeFstat(&Fstat_res, Fstat_in_vec->
data[
k], &thisPoint, binsFstat1, Fstat_what);
1019 for (
UINT4 iFreq = 0; iFreq < binsFstat1; ++iFreq) {
1027 if ( uvar_printFstat1 )
1029 for (
k = 0;
k < nStacks;
k++)
1045 if (uvar_method == 0) {
1048 sumWeightSquare = 0.0;
1049 for (
k = 0;
k < nStacks;
k++)
1050 sumWeightSquare += weightsV->
data[
k] * weightsV->
data[
k];
1053 meanN = nStacks * alphaPeak;
1054 sigmaN = sqrt(sumWeightSquare * alphaPeak * (1.0 - alphaPeak));
1055 semiCohPar.
threshold = uvar_threshold1*sigmaN + meanN;
1070 for ( iCand = 0; iCand < semiCohCandList.
nCandidates; iCand ++ )
1071 semiCohCandList.
list[iCand].
freq += FreqBugCorrection;
1075 for (
k=0;
k<nStacks;
k++)
1081 }
else if ( uvar_method == 1 ) {
1096 if( uvar_semiCohToplist) {
1100 skyGridCounter,thisScan.numSkyGridPoints,
1101 uvar_Freq, uvar_FreqBand);
1125 skyGridCounter,thisScan.numSkyGridPoints,
1126 uvar_Freq, uvar_FreqBand);
1137 time_t tau =
time(NULL) - clock0;
1138 UINT4 Nrefine = nSkyRefine * nf1dotRes;
1139 FILE *timing_fp = fopen (
"HS_timing.dat",
"ab" );
1140 fprintf ( timing_fp,
"%d %d %d %d %d %d %d %d\n",
1141 thisScan.numSkyGridPoints, nf1dot, binsFstatSearch, 2 * semiCohPar.
extraBinsFstat, nSFTs, nStacks, Nrefine, tau );
1142 fclose ( timing_fp );
1154#if (!HS_CHECKPOINTING)
1157 if (!(fpSemiCoh = fopen(fnameSemiCohCand,
"wb")))
1162 if ( uvar_printCand1 && uvar_semiCohToplist ) {
1163 fprintf ( fpSemiCoh,
"%%%% Freq Alpha Delta f1dot HoughFstat AlphaBest DeltaBest MeanSig VarSig\n");
1166 fprintf( stderr,
"Error in writing toplist to file\n");
1168 if (
fprintf(fpSemiCoh,
"%%DONE\n") < 0)
1169 fprintf(stderr,
"Error writing end marker\n");
1174 write_and_close_checkpointed_file();
1183 if ( uvar_printCand1 )
1188 if ( VCSInfoString )
XLALFree ( VCSInfoString );
1190 if ( uvar_printFstat1 )
1204 for(
k = 0;
k < nStacks;
k++)
1256 REAL8 timebase, tObs, deltaFsft;
1258 LIGOTimeGPS tStartGPS, tEndGPS, refTimeGPS, tMidGPS;
1262 REAL8 startTime_freqLo, startTime_freqHi;
1263 REAL8 endTime_freqLo, endTime_freqHi;
1264 REAL8 freqLo, freqHi;
1285 timebase = 1.0/deltaFsft;
1297 SFTCatalog *LastSegmentCat = &(catalogSeq.
data[numSegments - 1]);
1332 REAL8 tStart8, tEnd8, tMid8;
1336 tMid8 = 0.5 * (tStart8 + tEnd8);
1345 refTimeGPS = tMidGPS;
1368 freqLo =
HSMIN ( startTime_freqLo, endTime_freqLo );
1369 freqHi =
HSMAX ( startTime_freqHi, endTime_freqHi );
1372 fMin = freqLo - doppWings;
1373 fMax = freqHi + doppWings;
1385 fMin -= 50 * deltaFsft;
1386 fMax += 50 * deltaFsft;
1391 if ( (*p_Fstat_in_vec) == NULL ) {
1412 if ( (*p_Fstat_in_vec)->data[
k] == NULL ) {
1419 if ( multiIFO == NULL ) {
1439 nSFTs +=
multiTS->data[X]->length;
1508 UINT2 xSide, ySide, maxNBins, maxNBorders;
1509 INT8 fBinIni, fBinFin, fBin;
1513 REAL8 patchSizeX, patchSizeY;
1515 REAL8 fdot, refTime;
1522 CHAR *fileStats = NULL;
1523 FILE *fpStats = NULL;
1531 if (
out == NULL ) {
1534 if (
out->length == 0 ) {
1537 if (
out->list == NULL ) {
1540 if ( pgV == NULL ) {
1543 if ( pgV->
length == 0 ) {
1546 if ( pgV->
pg == NULL ) {
1570 refTimeGPS =
params->refTime;
1579 patchSizeX =
params->patchSizeX;
1580 patchSizeY =
params->patchSizeY;
1585 for (
k=0;
k<nStacks;
k++) {
1588 timeDiffV->
data[
k] = tMidStack - refTime;
1597 if ( lutV.
lut == NULL ) {
1607 REAL8 maxTimeDiff, startTimeDiff, endTimeDiff;
1609 startTimeDiff = fabs(timeDiffV->
data[0]);
1610 endTimeDiff = fabs(timeDiffV->
data[timeDiffV->
length - 1]);
1611 maxTimeDiff =
HSMAX( startTimeDiff, endTimeDiff);
1616 phmdVS.
nfSize = 2 * floor((nfdot-1) * (
REAL4)(dfdot * maxTimeDiff /
deltaF) + 0.5f) + 1;
1621 if ( phmdVS.
phmd == NULL ) {
1628 freqInd.
length = nStacks;
1630 if ( freqInd.
data == NULL ) {
1683 histTotal.
length = nStacks+1;
1686 if ( hist.
data == NULL ) {
1692 if ( histTotal.
data == NULL ) {
1700 histTotal.
data[
j]=0;
1703 const CHAR *append =
"stats";
1705 if ( fileStats == NULL ) {
1710 strcpy( fileStats,
params->outBaseName);
1711 strcat( fileStats, append);
1713 if ( !(fpStats = fopen(fileStats,
"wb")))
1715 fprintf(stderr,
"Unable to open file '%s' for writing...continuing\n", fileStats);
1723 parRes.
f0Bin = fBinIni;
1725 fBinIni +=
params->extraBinsFstat;
1726 fBinFin -=
params->extraBinsFstat;
1730 fBinIni*
deltaF, fBinFin*
deltaF, fBinFin - fBinIni + 1);
1735 out->nCandidates = 0;
1738 if (
params->useToplist) {
1743 INT4 numHmaps = (fBinFin - fBinIni + 1)*phmdVS.
nfSize;
1744 if (
out->length != numHmaps) {
1745 out->length = numHmaps;
1747 if (
out->list == NULL ) {
1760 while( fBin <= fBinFin ){
1761 INT8 fBinSearch, fBinSearchMax;
1765 parRes.
f0Bin = fBin;
1767 xSide = parSize.
xSide;
1768 ySide = parSize.
ySide;
1774 patch.
xSide = xSide;
1775 patch.
ySide = ySide;
1779 if ( patch.
xCoor == NULL ) {
1785 if ( patch.
yCoor == NULL ) {
1802 if ( lutV.
lut[
j].
bin == NULL ) {
1807 for (
i=0;
i<maxNBorders; ++
i){
1841 for (
j=0;
j < (
UINT4)nStacks;
j++){
1889 if ( ht.
map == NULL ) {
1898 fBinSearchMax = fBin + parSize.
nFreqValid - 1;
1901 while ( (fBinSearch <= fBinFin) && (fBinSearch < fBinSearchMax) ) {
1908 ht.
f0Bin = fBinSearch;
1912 for(
n = -nfdotBy2;
n <= nfdotBy2 ;
n++ ){
1916 for (
j=0;
j < (
UINT4)nStacks;
j++) {
1923 if (
params->useToplist ) {
1935 &patch, &parDem),
status);
1937 fprintf(fpStats,
"%d %f %f %f %f %f %f %f %g \n", iHmap, sourceLocation.
alpha, sourceLocation.
delta,
1986 for (
i=0;
i<maxNBorders; ++
i){
2013 if (
params->useToplist ) {
2014 for (
k=0;
k<houghToplist->
elems;
k++) {
2017 out->nCandidates = houghToplist->
elems;
2055 INT4 nStacks, nSearchBins, nPeaks;
2061 if ( FstatVect == NULL ) {
2064 if ( FstatVect->
length == 0 ) {
2067 if ( FstatVect->
data == NULL ) {
2070 if ( pgV == NULL ) {
2074 nStacks = FstatVect->
length;
2081 if ( pgV->
pg == NULL ) {
2087 if ( upg == NULL ) {
2093 for (
k=0;
k<nStacks;
k++) {
2101 for(
j=0;
j<nSearchBins;
j++) {
2113 if ( pgV->
pg[
k].
peak == NULL ) {
2128 for (
j=0;
j<nSearchBins;
j++) {
2158 UINT4 j, stackCounter, length;
2159 REAL8 tStart, thisTime;
2174 out->length = nStacksMax;
2176 if (
out->data == NULL ) {
2200 if ( (thisTime - tStart +
Tsft <= tStack) )
2202 out->data[stackCounter].length += 1;
2204 length =
out->data[stackCounter].length;
2208 if (
out->data[stackCounter].data == NULL ) {
2213 out->data[stackCounter].data[length - 1] = in->
data[
j];
2217 if ( stackCounter + 1 == nStacksMax )
2226 out->data[stackCounter].length = 1;
2228 if (
out->data[stackCounter].data == NULL ) {
2233 out->data[stackCounter].data[0] = in->
data[
j];
2239 out->length = stackCounter + 1;
2241 if (
out->data == NULL ) {
2267 sprintf( filenumber,
".%06d",iHmap);
2276 for(
k=ySide-1;
k>=0; --
k){
2277 for(
i=0;
i<xSide;++
i){
2302 CHAR filename1[256], filename2[256], filenumber[16];
2309 sprintf( filenumber,
".%06d",iHmap);
2311 strcpy( filename1, fnameOut);
2312 strcat( filename1,
"_GridAlpha");
2313 strcat( filename1, filenumber);
2315 strcpy( filename2, fnameOut);
2316 strcat( filename2,
"_GridDelta");
2317 strcat( filename2, filenumber);
2319 fp1=fopen(filename1,
"wb");
2322 fp2=fopen(filename2,
"wb");
2325 xSide = patch->
xSide;
2326 ySide = patch->
ySide;
2328 for(
k=ySide-1;
k>=0; --
k){
2329 for(
i=0;
i<xSide;++
i){
2370 UINT2 xSide, ySide, maxNBins, maxNBorders;
2389 xSide = patch->
xSide;
2390 ySide = patch->
ySide;
2393 pg.
fBinIni = f0Bin - maxNBins;
2394 pg.
fBinFin = f0Bin + 5*maxNBins;
2397 if ( pg.
peak == NULL ) {
2426 if ( ht.
map == NULL ) {
2434 if ( hd.
map == NULL ) {
2455 for(
j = ySide-1;
j >= 0; --
j){
2456 for(
i = 0;
i < xSide; ++
i){
2458 if (( ht.
map[
j*xSide+
i] > 1.0) || (ht.
map[
j*xSide+
i] < 0.0 ))
2459 validateFlag =
TRUE;
2499 UINT2 xSide, ySide, maxNBins, maxNBorders;
2511 sprintf( filenumber,
".%06d",ind);
2521 xSide = patch->
xSide;
2522 ySide = patch->
ySide;
2525 pg.
fBinIni = f0Bin - maxNBins;
2526 pg.
fBinFin = f0Bin + 5*maxNBins;
2529 if ( pg.
peak == NULL ) {
2558 if ( ht.
map == NULL ) {
2566 if ( hd.
map == NULL ) {
2588 for(
j = ySide-1;
j >= 0; --
j){
2589 for(
i = 0;
i < xSide; ++
i){
2643 thisCandidate.
fdot = fdot;
2644 thisCandidate.
dFdot = dFdot;
2645 thisCandidate.
dAlpha = patchSizeX / ((
REAL8)xSide);
2646 thisCandidate.
dDelta = patchSizeY / ((
REAL8)ySide);
2648 for (
i = 0;
i < ySide;
i++)
2650 for (
j = 0;
j < xSide;
j++)
2685 INT4 i,
j, xSide, ySide, numCandidates;
2714 numCandidates =
out->nCandidates;
2718 if (criteria == 0) {
2722 thisCandidate.
fdot = fdot;
2723 thisCandidate.
dFdot = dFdot;
2724 thisCandidate.
dAlpha = 3.0 * patchSizeX / ((
REAL8)xSide);
2725 thisCandidate.
dDelta = 3.0 * patchSizeY / ((
REAL8)ySide);
2728 for (
i = 1;
i < ySide-1;
i++)
2730 for (
j = 1;
j < xSide-1;
j++)
2748 if (numCandidates >=
out->length) {
2751 if (
out->list == NULL ) {
2759 if( ((
REAL8)thisCandidate.
significance > threshold) && (numCandidates < out->length) && isLocalMax) {
2770 out->list[numCandidates] = thisCandidate;
2772 out->nCandidates = numCandidates;
2784 if ( criteria == 1) {
2788 REAL8 meanSig, varianceSig;
2794 for (
i = 0;
i < ySide;
i++)
2796 for (
j = 0;
j < xSide;
j++)
2799 if ( ht->
map[
i*xSide +
j] > currentMax ) {
2800 currentMax = ht->
map[
i*xSide +
j];
2814 thisCandidate.
fdot = fdot;
2815 thisCandidate.
dFdot = dFdot;
2816 thisCandidate.
dAlpha = 3.0 * patchSizeX / ((
REAL8)xSide);
2817 thisCandidate.
dDelta = 3.0 * patchSizeY / ((
REAL8)ySide);
2820 jMax, iMax, patch, parDem),
status);
2826 thisCandidate.
meanSig = meanSig;
2830 if (numCandidates >=
out->length) {
2833 if (
out->list == NULL ) {
2855 out->list[numCandidates] = thisCandidate;
2857 out->nCandidates = numCandidates;
2925 fkdot[1] = thisPoint->
fkdot[1];
2931 for (
k=0;
k<length;
k++)
2974 for (
k=0;
k<length;
k++)
3040 fprintf(
fp,
"## Number of SFTs: %d\n", nSFT);
3042 fprintf(
fp,
"## Last SFT timestamp: %d %d\n",
end.gpsSeconds,
end.gpsNanoSeconds);
3067 nStacks = catalogSeq->
length;
3068 fprintf(
fp,
"## Number of stacks: %d\n", nStacks);
3070 for (
k = 0;
k < nStacks;
k++) {
3090 const CHAR *fnameChkPoint)
3095 CHAR lastnewline=
'\0';
3104 if (!(
fp = fopen(fnameChkPoint,
"rb")))
3107 fprintf (stdout,
"Checkpoint-file '%s' not found.\n", fnameChkPoint);
3115 fprintf ( stdout,
"Found checkpoint-file '%s' \n", fnameChkPoint);
3121 fprintf ( stdout,
"Failed to read checkpoint index from '%s'!\n", fnameChkPoint);
3129 *loopindex = tmpIndex;
3148 INT4 counter, numifo;
3161 nStacks = Fstat_in_vec->
length;
3164 createPar.
length = nStacks;
3180 for (
k = 0;
k < nStacks;
k++)
3184 numifo = multiDetStates->
length;
3187 velStack[0]->
data[3*
k] = 0;
3188 velStack[0]->
data[3*
k+1] = 0;
3189 velStack[0]->
data[3*
k+2] = 0;
3191 posStack[0]->
data[3*
k] = 0;
3192 posStack[0]->
data[3*
k+1] = 0;
3193 posStack[0]->
data[3*
k+2] = 0;
3195 for (
j = 0; (
INT4)
j < numifo;
j++)
3198 for (
m = 0; (
INT4)
m < numsft;
m++)
3216 velStack[0]->
data[3*
k] /= counter;
3217 velStack[0]->
data[3*
k+1] /= counter;
3218 velStack[0]->
data[3*
k+2] /= counter;
3220 posStack[0]->
data[3*
k] /= counter;
3221 posStack[0]->
data[3*
k+1] /= counter;
3222 posStack[0]->
data[3*
k+2] /= counter;
3238 INT4 nStacks,
k,
j,
i, numifo, numsft;
3252 nStacks = Fstat_in_vec->
length;
3257 for (
k=0;
k<nStacks;
k++) {
3262 numifo = multNoiseWts->
length;
3266 weightsVec->
data[
k] = 0;
3268 for (
j = 0;
j < numifo;
j++) {
3272 for (
i = 0;
i < numsft;
i++) {
3303 UINT4 nStacks, iStack, iIFO, iSFT, numifo, numsft;
3314 nStacks = Fstat_in_vec->
length;
3321 for (iStack=0; iStack<nStacks; iStack++) {
3329 numifo = multNoiseWts->
length;
3334 out->data[iStack] = 0;
3340 for ( iIFO = 0; iIFO < numifo; iIFO++) {
3345 for ( iSFT = 0; iSFT < numsft; iSFT++) {
3348 b = multiAMcoef->
data[iIFO]->
b->
data[iSFT];
3349 n = multNoiseWts->
data[iIFO]->
data[iSFT];
3351 out->data[iStack] += (
a*
a + b*b)*
n;
3406 if (
line.AlphaBest < 0 ) {
3435 UINT4 i,
j, nStacks, extraBins2, tmpExtraBins2;
3456 pixelFactor =
par->pixelFactor;
3460 patchSizeX =
par->patchSizeX;
3461 patchSizeY =
par->patchSizeY;
3464 refTimeGPS =
par->refTime;
3467 nStacks = tsMid->
length;;
3471 refTime = 0.5 * (tStart +
tEnd);
3490 if ( patch.
xCoor == NULL ) {
3496 if ( patch.
yCoor == NULL ) {
3518 for (
j=0;
j<nStacks;
j++) {
3520 timeDiffV->
data[
j] = tMidStack - refTime;
3527 if ( lut.
border == NULL ) {
3533 if ( lut.
bin == NULL ) {
3549 for (
j=0;
j < (
UINT4)nStacks;
j++){
3566 if ( tmpExtraBins2 > extraBins2)
3567 extraBins2 = tmpExtraBins2;
3571 par->extraBinsFstat = extraBins2 + 2;
3659 REAL8 vFactor, xFactor;
3660 REAL8 xiX, xiY, xiZ;
3661 REAL8 modXi,invModXi;
3677 f0Bin =
size->f0Bin;
3691 spinOrder =
par->spin.length;
3695 timeDiff =
par->timeDiff;
3697 spinF =
par->spin.data;
3699 for (
i=0;
i<spinOrder; ++
i ){
3700 xFactor += spinF[
i] * timeDiffProd * (
i+1.0);
3701 timeDiffProd *= timeDiff;
3702 vFactor += spinF[
i] * timeDiffProd;
3706 xiX = vFactor * (
par->veloC.x) + xFactor * (
par->positC.x);
3707 xiY = vFactor * (
par->veloC.y) + xFactor * (
par->positC.y);
3708 xiZ = vFactor * (
par->veloC.z) + xFactor * (
par->positC.z);
3713 modXi = sqrt(xiX*xiX + xiY*xiY + xiZ*xiZ);
3715 invModXi = 1./modXi;
3717 xiInit.
delta = asin( xiZ*invModXi);
3721 xiInit.
alpha = atan2(xiY, xiX);
3736 &xiFinal ,&xiInit, &(*par).skyPatch),
status);
#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_toplist(toplist_t **list, size_t length, size_t size, int(*smaller)(const void *, const void *))
void free_toplist(toplist_t **list)
void * toplist_elem(toplist_t *list, size_t ind)
int insert_into_toplist(toplist_t *list, void *element)
#define HIERARCHICALSEARCH_EMEM
#define HIERARCHICALSEARCH_ENONULL
#define HIERARCHICALSEARCH_MSGEXLAL
#define HIERARCHICALSEARCH_MSGENULL
#define HIERARCHICALSEARCH_MSGEFILE
#define HIERARCHICALSEARCH_ENULL
#define HIERARCHICALSEARCH_MSGESFT
#define HIERARCHICALSEARCH_MSGEBAD
#define HIERARCHICALSEARCH_EFILE
#define HIERARCHICALSEARCH_EBAD
#define HIERARCHICALSEARCH_EVAL
#define HIERARCHICALSEARCH_MSGEVAL
#define HIERARCHICALSEARCH_ENORM
#define HIERARCHICALSEARCH_EXLAL
#define HIERARCHICALSEARCH_MSGEMEM
#define HIERARCHICALSEARCH_ESFT
#define HIERARCHICALSEARCH_MSGENONULL
void FstatVectToPeakGram(LALStatus *status, HOUGHPeakGramVector *pgV, REAL4FrequencySeriesVector *FstatVect, REAL4 thr)
Function for selecting frequency bins from a set of Fstatistic vectors.
void SetUpSFTs(LALStatus *status, FstatInputVector **p_Fstat_in_vec, UsefulStageVariables *in)
Set up stacks, read SFTs, calculate SFT noise weights and calculate detector-state.
void GetSemiCohToplist(LALStatus *status, toplist_t *list, SemiCohCandidateList *in, REAL8 meanN, REAL8 sigmaN)
Get SemiCoh candidates toplist.
#define FSTART
Default Start search frequency.
void GetChkPointIndex(LALStatus *status, INT4 *loopindex, const CHAR *fnameChkPoint)
Read checkpointing file This does not (yet) check any consistency of the existing results file.
void ComputeStackNoiseWeights(LALStatus *status, REAL8Vector **out, FstatInputVector *Fstat_in_vec)
Calculate noise weight for each stack.
#define MISMATCH
Default for metric grid maximal mismatch value.
#define INSERT_INTO_HOUGHFSTAT_TOPLIST
#define DDELTA
Default resolution for isotropic or flat grids.
void GetStackVelPos(LALStatus *status, REAL8VectorSequence **velStack, REAL8VectorSequence **posStack, FstatInputVector *Fstat_in_vec)
Calculate average velocity and position of detector network during each stack.
#define BLOCKSIZE_REALLOC
void PrintSemiCohCandidates(LALStatus *status, SemiCohCandidateList *in, FILE *fp, LIGOTimeGPS refTime)
Print Hough candidates.
void SetUpStacks(LALStatus *status, SFTCatalogSequence *out, REAL8 tStack, SFTCatalog *in, UINT4 nStacksMax)
Breaks up input sft catalog into specified number of stacks.
void PrintHmap2file(LALStatus *status, HOUGHMapTotal *ht, CHAR *fnameOut, INT4 iHmap)
Print single Hough map to a specified output file.
#define UNINITIALIZE_COPROCESSOR_DEVICE
BOOLEAN uvar_printGrid
global variable for printing Hough grid
void GetHoughCandidates_toplist(LALStatus *status, toplist_t *list, HOUGHMapTotal *ht, HOUGHPatchGrid *patch, HOUGHDemodPar *parDem)
Get Hough candidates as a toplist.
#define DALPHA
Default resolution for isotropic or flat grids.
void GetFstatCandidates_toplist(LALStatus *status, toplist_t *list, REAL8FrequencySeries *in, REAL8 alpha, REAL8 delta, REAL8 fdot)
void GetXiInSingleStack(LALStatus *status, HOUGHSizePar *size, HOUGHDemodPar *par)
#define COMPUTEFSTATHOUGHMAP
LALStatus * global_status
#define REARRANGE_SFT_DATA
BOOLEAN uvar_dumpLUT
global variable for printing Hough look-up-tables for debugging
#define INITIALIZE_COPROCESSOR_DEVICE
void DumpLUT2file(LALStatus *status, HOUGHptfLUT *lut, HOUGHPatchGrid *patch, CHAR *basename, INT4 ind)
Print single Hough map to a specified output file.
#define SKYREGION
default sky region to search over – just a single point
void PrintHoughGrid(LALStatus *status, HOUGHPatchGrid *patch, HOUGHDemodPar *parDem, CHAR *fnameOut, INT4 iHmap)
void ComputeFstatHoughMap(LALStatus *status, SemiCohCandidateList *out, HOUGHPeakGramVector *pgV, SemiCoherentParams *params)
Function for calculating Hough Maps and candidates.
BOOLEAN uvar_printStats
global variable for calculating Hough map stats
BOOLEAN uvar_printMaps
global variable for printing Hough maps
void ValidateHoughLUT(LALStatus *status, HOUGHptfLUT *lut, HOUGHPatchGrid *patch, CHAR *basename, INT4 ind, REAL4 alpha, REAL4 delta, REAL4 weight)
static int smallerHough(const void *a, const void *b)
#define FDOT
Default value of first spindown.
#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 ComputeStackNoiseAndAMWeights(LALStatus *status, REAL8Vector *out, FstatInputVector *Fstat_in_vec, SkyPosition skypos)
Calculate noise and AM weight for each stack for a given sky position.
#define FNAMEOUT
Default output file basename.
#define FSTATTHRESHOLD
Default threshold on Fstatistic for peak selection.
void PrintFstatVec(LALStatus *status, REAL4FrequencySeries *in, FILE *fp, PulsarDopplerParams *thisPoint, LIGOTimeGPS refTime, INT4 stackIndex)
Print Fstat vectors.
void PrintCatalogInfo(LALStatus *status, const SFTCatalog *catalog, FILE *fp)
Print some sft catalog info.
#define GET_CHECKPOINT(toplist, total, count, outputname, cptname)
void PrintHoughHistogram(LALStatus *status, UINT8Vector *hist, CHAR *fnameOut)
Print hough histogram to a file.
#define SHOW_PROGRESS(rac, dec, tpl_count, tpl_total, freq, fband)
void GetHoughCandidates_threshold(LALStatus *status, SemiCohCandidateList *out, HOUGHMapTotal *ht, HOUGHPatchGrid *patch, HOUGHDemodPar *parDem, REAL8 threshold)
Get Hough candidates as a toplist using a fixed threshold.
void ComputeNumExtraBins(LALStatus *status, SemiCoherentParams *par, REAL8 fdot, REAL8 f0, REAL8 deltaF)
Optimized calculation of Fstat overhead.
Header file for DriveHoughFstat.c.
int create_houghFstat_toplist(toplist_t **tl, UINT8 length)
creates a toplist with length elements, returns -1 on error (usually out of memory),...
void sort_houghFstat_toplist(toplist_t *l)
sorts the toplist with an internal sorting function, used before finally writing it
void free_houghFstat_toplist(toplist_t **l)
frees the space occupied by the toplist
int write_houghFstat_toplist_to_fp(toplist_t *tl, FILE *fp, UINT4 *checksum)
Writes the toplist to an (already open) filepointer Returns the number of written charactes sets the ...
int insert_into_houghFstat_toplist(toplist_t *tl, HoughFstatOutputEntry elem)
Inserts an element in to the toplist either if there is space left or the element is larger than the ...
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)
void StackSlideVecF(LALStatus *status, SemiCohCandidateList *out, REAL4FrequencySeriesVector *vecF, SemiCoherentParams *params)
Function StackSlides a vector of Fstat frequency series or any REAL8FrequencySeriesVector.
Header file for StackSlideFstat.c.
void LALDDestroyVectorSequence(LALStatus *status, REAL8VectorSequence **vectorSequence)
void LALDCreateVectorSequence(LALStatus *status, REAL8VectorSequence **vectorSequence, CreateVectorSequenceIn *vSeqParams)
const MultiLIGOTimeGPSVector * XLALGetFstatInputTimestamps(const FstatInput *input)
Returns the SFT timestamps stored in a FstatInput structure.
const MultiLALDetector * XLALGetFstatInputDetectors(const FstatInput *input)
Returns the detector information stored in a FstatInput structure.
const MultiDetectorStateSeries * XLALGetFstatInputDetectorStates(const FstatInput *input)
Returns the multi-detector state series stored in a FstatInput structure.
const FstatOptionalArgs FstatOptionalArgsDefaults
Global initializer for setting FstatOptionalArgs to default values.
void XLALDestroyFstatInputVector(FstatInputVector *inputs)
Free all memory associated with a FstatInputVector structure.
MultiNoiseWeights * XLALGetFstatInputNoiseWeights(const FstatInput *input)
Returns the multi-detector noise weights stored in a FstatInput structure.
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.
@ FMETHOD_DEMOD_BEST
Demod: best guess of the fastest available hotloop
@ FSTATQ_2F
Compute multi-detector .
void LALStereo2SkyLocation(LALStatus *status, REAL8UnitPolarCoor *sourceLocation, UINT2 xPos, UINT2 yPos, HOUGHPatchGrid *patch, HOUGHDemodPar *parDem)
Find source sky location given stereographic coordinates indexes.
void LALHOUGHInitializeHD(LALStatus *status, HOUGHMapDeriv *hd)
This function initializes the Hough map derivative space HOUGHMapDeriv *hd to zero.
REAL8 HoughTT
Total Hough Map pixel type.
void LALHOUGHAddPHMD2HD(LALStatus *status, HOUGHMapDeriv *hd, HOUGHphmd *phmd)
Given an initial Hough map derivative HOUGHMapDeriv *hd and a representation of a phmd HOUGHphmd *phm...
void LALHOUGHIntegrHD2HT(LALStatus *status, HOUGHMapTotal *ht, HOUGHMapDeriv *hd)
This function constructs a total Hough map HOUGHMapTotal *ht from its derivative HOUGHMapDeriv *hd by...
void LALHOUGHInitializeHT(LALStatus *status, HOUGHMapTotal *ht, HOUGHPatchGrid *patch)
This function initializes the total Hough map HOUGHMapTotal *ht to zero and checks consistency betwee...
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.
void XLALDestroyMultiAMCoeffs(MultiAMCoeffs *multiAMcoef)
Destroy a MultiAMCoeffs structure.
MultiAMCoeffs * XLALComputeMultiAMCoeffs(const MultiDetectorStateSeries *multiDetStates, const MultiNoiseWeights *multiWeights, SkyPosition skypos)
Multi-IFO version of XLALComputeAMCoeffs().
#define XLAL_INIT_DECL(var,...)
void LALHOUGHConstructHMT_W(LALStatus *status, HOUGHMapTotal *ht, UINT8FrequencyIndexVector *freqInd, PHMDVectorSequence *phmdVS)
Calculates the total hough map for a given trajectory in the time-frequency plane and a set of partia...
void LALHOUGHConstructSpacePHMD(LALStatus *status, PHMDVectorSequence *phmdVS, HOUGHPeakGramVector *pgV, HOUGHptfLUTVector *lutV)
constructs the space of phmd PHMDVectorSequence *phmdVS, given a HOUGHPeakGramVector *pgV and HOUGHpt...
void LALHOUGHNormalizeWeights(LALStatus *status, REAL8Vector *weightV)
Normalizes weight factors so that their sum is N.
void LALHOUGHWeighSpacePHMD(LALStatus *status, PHMDVectorSequence *phmdVS, REAL8Vector *weightV)
Adds weight factors for set of partial hough map derivatives – the weights must be calculated outside...
void LALHOUGHInitializeWeights(LALStatus *status, REAL8Vector *weightV)
Initializes weight factors to unity.
void LALHOUGHupdateSpacePHMDup(LALStatus *status, PHMDVectorSequence *phmdVS, HOUGHPeakGramVector *pgV, HOUGHptfLUTVector *lutV)
This function updates the space of phmd increasing the frequency phmdVS->fBinMin by one.
char char * XLALStringDuplicate(const char *s)
char * XLALVCSInfoString(const LALVCSInfoList vcs_list, const int verbose, const char *prefix)
void LALRotatePolarU(LALStatus *status, REAL8UnitPolarCoor *out, REAL8UnitPolarCoor *in, REAL8UnitPolarCoor *par)
#define VTOT
Total detector velocity/c TO BE CHANGED DEPENDING ON DETECTOR.
#define PIXERR
Maximum `‘error’' (as a fraction of the width of the thinnest annulus) which allows to consider two b...
#define LINERR
Maximum `‘error’' (as a fraction of the width of the thinnest annulus) which allows to represent a ci...
void LALHOUGHFillPatchGrid(LALStatus *status, HOUGHPatchGrid *out, HOUGHSizePar *par)
#define VEPI
Earth v_epicycle/c TO BE CHANGED DEPENDING ON DETECTOR.
void LALHOUGHConstructPLUT(LALStatus *status, HOUGHptfLUT *lut, HOUGHPatchGrid *patch, HOUGHParamPLUT *par)
void LALHOUGHCalcParamPLUT(LALStatus *status, HOUGHParamPLUT *out, HOUGHSizePar *sizePar, HOUGHDemodPar *par)
void LALHOUGHComputeSizePar(LALStatus *status, HOUGHSizePar *out, HOUGHResolutionPar *in)
INT2 COORType
To be changed to {INT2 COORType} if the number of pixels in the x-direction exceeds 255.
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
REAL8 HoughDT
Hough Map derivative pixel type.
void LALHOUGHPeak2PHMD(LALStatus *status, HOUGHphmd *phmd, HOUGHptfLUT *lut, HOUGHPeakGram *pg)
Construction of Partial-Hough-Map-Derivatives (phmd) given a peak-gram and the look-up-table.
void XLALDestroyMultiNoiseWeights(MultiNoiseWeights *weights)
Destroy a MultiNoiseWeights object.
@ LAL_PMETRIC_COH_PTOLE_ANALYTIC
REAL8 PulsarSpins[PULSAR_MAX_SPINS]
Typedef for fixed-size array holding GW frequency and derivatives fk = d^k Freq/dt^k|(tau_ref)
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.
LIGOTimeGPSVector * XLALCreateTimestampVector(UINT4 len)
Allocate a LIGOTimeGPSVector.
SFTCatalog * XLALSFTdataFind(const CHAR *file_pattern, const SFTConstraints *constraints)
Find the list of SFTs matching the file_pattern and satisfying the given constraints,...
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.
COORDINATESYSTEM_EQUATORIAL
void LALHoughStatistics(LALStatus *status, HoughStats *out, HOUGHMapTotal *in)
This function calculates the maximum number count, minimum number count, average and standard deviati...
void LALHoughHistogram(LALStatus *status, UINT8Vector *out, HOUGHMapTotal *in)
Produces a histogram of the number counts in a total Hough map.
void LALHoughmapMeanVariance(LALStatus *status, REAL8 *mean, REAL8 *variance, HOUGHMapTotal *in)
void LALDCreateVector(LALStatus *, REAL8Vector **, UINT4)
void LALDDestroyVector(LALStatus *, REAL8Vector **)
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_MAIN(assertion,...)
int XLALPrintError(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)
CHAR * uvar_ephemEarth
Earth ephemeris file to use.
CHAR * uvar_ephemSun
Sun ephemeris file to use.
REAL4Vector * b
(weighted) per-SFT antenna-pattern function
REAL4Vector * a
(weighted) per-SFT antenna-pattern function
REAL8 rDetector[3]
Cartesian coords of detector position in ICRS J2000.
DetectorState * data
array of DetectorState entries
UINT4 length
total number of entries
LALDetector detector
detector-info corresponding to this timeseries
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,...
Struct of optional 'advanced level' and (potentially method-specific) arguments to be passed to the ...
UINT4 runningMedianWindow
If SFT noise weights are calculated from the SFTs, the running median window length to use.
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.
REAL4 * twoF
If whatWasComputed & FSTATQ_2F is true, the multi-detector values computed at numFreqBins frequencie...
This structure stores the border indexes corresponding to one frequency bin plus the corrections to b...
This structure stores the border of a circle clipped on the projected plane.
COORType * xPixel
x pixel index to be marked
UINT2 ySide
length of xPixel
Demodulation parameters needed for the Hough transform; all coordinates are assumed to be with respec...
REAL8Cart3Coor positC
(x,y,z): Position of the detector
REAL8 deltaF
Frequency resolution: df=1/TCOH
REAL8 timeDiff
: time difference
REAL8Cart3Coor veloC
(x,y,z): Relative detector velocity
REAL8Vector spin
Spin down information.
REAL8UnitPolarCoor skyPatch
(alpha, delta): position of the center of the patch
This structure stores the Hough map derivative.
UINT2 ySide
number of physical pixels in the y direction
UINT2 xSide
number of physical pixels in the x direction
HoughDT * map
the pixel count derivatives; the number of elements to allocate is ySide*(xSide+1)*
This structure stores the Hough map.
UINT2 ySide
number of physical pixels in the y direction
UINT2 xSide
number of physical pixels in the x direction
HoughTT * map
the pixel counts; the number of elements to allocate is ySide*xSide
REAL8Vector dFdot
resolution in spindown parameters
REAL8Vector spinRes
Refined spin parameters used in the Hough transform.
REAL8UnitPolarCoor skyPatch
Coordinates of the versor (alpha, delta) pointing to the center of the sky patch.
INT8 f0Bin
frequency bin for which it has been constructed
UINT4 mObsCoh
ratio of observation time and coherent timescale
REAL8 patchSizeX
x size of patch
REAL8 deltaF
frequency resolution
REAL8 patchSizeY
y size of patch
REAL8Vector spinDem
Spin parameters used in the demodulation stage.
Parameters needed to construct the partial look up table.
This structure stores patch-frequency grid information.
UINT2 ySide
Real number of pixels in the y-direction (in the projected plane).
REAL8 * xCoor
Coordinates of the pixel centers.
UINT2 xSide
Real number of pixels in the x direction (in the projected plane); it should be less than or equal to...
REAL8 * yCoor
Coordinates of the pixel centers.
This structure stores the `‘peak-gram’'.
REAL8 deltaF
Frequency resolution: df=1/TCOH
UINT4 length
Number of peaks present in the peak-gram.
UINT8 fBinFin
Frequency index of the last element of the spectrum covered by this peak-gram.
UINT8 fBinIni
Frequency index of the first element of the spectrum covered by this peak-gram; it can be seen as an ...
INT4 * peak
The peak indices relative to fBinIni, i.e., the zero peak corresponds to fBinIni.
This structure contains a vector of peak-grams (for the different time stamps)
UINT4 length
number of elements
HOUGHPeakGram * pg
the Peakgrams
parameters needed for gridding the patch
REAL8 deltaF
Frequency resolution: df=1/TCOH
REAL8 pixErr
for validity of LUT as PIXERR
INT8 f0Bin
Frequency bin at which construct the grid.
REAL8 patchSkySizeY
Patch size in radians along y-axis.
REAL8 patchSkySizeX
Patch size in radians along x-axis.
REAL8 pixelFactor
number of pixel that fit in the thinnest annulus
REAL8 vTotC
estimate value of v-total/C as VTOT
REAL8 linErr
as LINERR circle ->line
required for constructing patch
UINT2 maxNBorders
maximum number of borders affecting the patch; for memory allocation
UINT2 maxNBins
maximum number of bins affecting the patch; for memory allocation
UINT2 ySide
number of pixels in the y direction
INT8 nFreqValid
number of frequencies where the LUT is valid
UINT2 xSide
number of pixels in the x direction (projected plane)
This structure stores a partial Hough map derivative.
UINT8 fBin
Frequency bin of this partial map derivative.
UCHAR * firstColumn
Number of elements of firstColumn.
UINT2 ySide
number of elements of firstColumn
HOUGHBorder ** rightBorderP
Pointers to borders.
UINT2 maxNBorders
Maximun number of borders of each type (for memory allocation purposes), i.e. length of *leftBorderP ...
HOUGHBorder ** leftBorderP
Pointers to borders.
This structure stores the patch-time-frequency look up table.
REAL8 deltaF
Frequency resolution df=1/TCOH, where 1/TCOH is the coherent integration time used in teh demodulatio...
UINT2 maxNBins
Maximum number of bins affecting the patch (for memory allocation purposes)
INT4 nBin
Exact number of bins affecting the patch.
HOUGHBorder * border
The annulus borders.
INT4 iniBin
First bin affecting the patch with respect to f0.
HOUGHBin2Border * bin
Bin to border correspondence.
UINT2 maxNBorders
Maximum number of borders affecting the patch (for memory allocation purposes)
INT8 f0Bin
Frequency bin for which it has been constructed.
This structure contains a vector of partial look up tables (for the different time stamps)
HOUGHptfLUT * lut
the partial Look Up Tables
UINT4 length
number of elements
Type to hold the fields that will be kept in a "toplist"
Structure for storing statistical information about a Hough map.
A vector of 'timestamps' of type LIGOTimeGPS.
LIGOTimeGPS * data
array of timestamps
UINT4 length
number of timestamps
Multi-IFO container for antenna-pattern coefficients and atenna-pattern matrix .
AMCoeffs ** data
noise-weighted AM-coeffs , and
Multi-IFO time-series of DetectorStates.
UINT4 length
number of detectors
DetectorStateSeries ** data
vector of pointers to DetectorStateSeries
array of detectors definitions 'LALDetector'
LALDetector sites[PULSAR_MAX_DETECTORS]
array of site information
A collection of (multi-IFO) LIGOTimeGPSVector time-stamps vectors.
One noise-weight (number) per SFT (therefore indexed over IFOs and SFTs.
UINT4 length
number of detectors
REAL8Vector ** data
weights-vector for each detector
This structure contains a vector sequence of partial-Hough maps derivatives (for different time stamp...
UINT8 fBinMin
frequency index of smallest intrinsic frequency in circular buffer
UINT4 nfSize
number of different frequencies
REAL8 deltaF
frequency resolution
HOUGHphmd * phmd
the partial Hough map derivatives
UINT4 length
number of elements for each frequency
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).
Contains a "spin-range", ie spins and corresponding bands at a given (SSB) reference GPS-time .
PulsarSpins fkdot
Vector of spin-values .
LIGOTimeGPS refTime
SSB reference GPS-time at which spin-range is defined.
PulsarSpins fkdotBand
Vector of spin-bands , MUST be same length as fkdot.
A vector of REAL4FrequencySeries.
REAL4FrequencySeries * data
Pointer to the data array.
UINT4 length
Number of elements in array.
Polar coordinates of a unitary vector on the sphere.
REAL8 delta
In the interval [ ].
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.
one hough or stackslide candidate
REAL8 varianceSig
variance of significance values in Hough map
REAL8 deltaBest
delta for best candidate in hough map
REAL8 meanSig
mean of significance values in hough map
REAL8 alpha
right ascension
REAL8 dFreq
frequency error
REAL8 alphaBest
alpha for best candidate in hough map
REAL8 significance
significance
structure for storing candidates produced by Hough search
LIGOTimeGPS refTime
reference time for candidates
INT4 length
maximum allowed length of vectors
INT4 nCandidates
number of candidates – must be less than length
parameters for the semicoherent stage
REAL8 patchSizeX
Size of semicoherent sky-patch.
REAL8 patchSizeY
Size of semicoherent sky-patch.
REAL8 alpha
right ascension of demodulation point
REAL8 dfdot
resolution in residual spindowns
REAL8VectorSequence * pos
Earth orbital position for each segment.
LIGOTimeGPSVector * tsMid
timestamps of mid points of segments
REAL8 fdot
spindown value of demodulation point
BOOLEAN useToplist
Use a toplist for producing candidates?
REAL8 pixelFactor
Resolution of semicoherent sky-grid.
CHAR * outBaseName
file for writing output – if chosen
REAL8 delta
declination of demodulation point
LIGOTimeGPS refTime
reference time for f, fdot definition
REAL8VectorSequence * vel
Earth orbital velocity for each segment.
REAL8Vector * weightsV
Vector of weights for each stack.
REAL8 threshold
Threshold for candidate selection.
UINT4 nfdot
number of fdot values to search over
UINT4 extraBinsFstat
Extra bins required for Fstat calculation.
This structure stores the frequency indexes of the partial-Hough map derivatives at different time st...
UINT8 * data
the frequency indexes
REAL8 deltaF
frequency resolution
UINT4 length
number of elements
useful variables for each hierarchical stage
LIGOTimeGPSVector * startTstack
timestamps vector for start time of each stack
PulsarSpinRange spinRange_refTime
freq and fdot range at the reference time
REAL8 tObs
tEndGPS - tStartGPS
LIGOTimeGPS tStartGPS
start and end time of stack
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
REAL8 tStack
duration of stacks
REAL8 dFreqStack
frequency resolution of Fstat calculation
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
UINT4 Dterms
size of Dirichlet kernel for Fstat calculation
EphemerisData * edat
ephemeris data for XLALBarycenter
LIGOTimeGPS minStartTimeGPS
all sft data must be after this time
REAL8 dopplerMax
extra sft wings for doppler motion
CHAR * sftbasename
filename pattern for sfts
LIGOTimeGPSVector * midTstack
timestamps vector for mid time of each stack
int SSBprec
SSB transform precision.
UINT4 blocksRngMed
blocksize for running median noise floor estimation