53#define EARTHEPHEMERIS "/home/llucia/chi2/earth05-09.dat"
54#define SUNEPHEMERIS "/home/llucia/chi2/sun05-09.dat"
56#define MAXFILENAMELENGTH 512
58#define ACCURACY 0.00000001
66#define DELTA (-LAL_PI_2)
67#define PATCHSIZEX (LAL_PI*0.99)
68#define PATCHSIZEY (LAL_PI*0.99)
71#define BLOCKSRNGMED 101
79#define SFTDIRECTORY "/local_data/sintes/SFT-S5-120-130/*SFT*.*"
82#define FILEOUT "/HoughMCIChi2"
93typedef struct tagHoughParamsTest {
97 REAL8 *sumWeightSquare;
126int main(
int argc,
char *argv[] )
163 REAL8 alphaPeak, meanN, sigmaN;
198 REAL8 numberCountTotal;
204 BOOLEAN uvar_weighAM, uvar_weighNoise, uvar_printLog, uvar_fast, uvar_mismatch;
206 INT4 uvar_nfSizeCylinder, uvar_maxBinsClean, uvar_Dterms;
207 REAL8 uvar_f0, uvar_fSearchBand, uvar_peakThreshold, uvar_h0Min, uvar_h0Max, uvar_maxSpin, uvar_minSpin;
208 REAL8 uvar_alpha, uvar_delta, uvar_patchSizeAlpha, uvar_patchSizeDelta, uvar_pixelFactor;
209 CHAR *uvar_earthEphemeris = NULL;
210 CHAR *uvar_sunEphemeris = NULL;
213 CHAR *uvar_fnameOut = NULL;
226 uvar_weighNoise =
TRUE;
227 uvar_printLog =
FALSE;
229 uvar_mismatch =
TRUE;
240 uvar_fSearchBand =
FBAND;
242 uvar_nfSizeCylinder =
NFSIZE;
244 uvar_maxBinsClean = 100;
252 uvar_minSpin = -1
e-8;
255 chi2Params.
length = uvar_p;
273 strcpy( uvar_fnameOut,
FILEOUT );
286 " - '<SFT file>;<SFT file>;...', where <SFT file> may contain wildcards\n - 'list:<file containing list of SFT files>'" ) ==
XLAL_SUCCESS,
XLAL_EFUNC );
325 fprintf( stderr,
"start frequency must be positive\n" );
329 if ( uvar_fSearchBand < 0 ) {
330 fprintf( stderr,
"search frequency band must be positive\n" );
334 if ( uvar_peakThreshold < 0 ) {
335 fprintf( stderr,
"peak selection threshold must be positive\n" );
339 if ( uvar_maxSpin < uvar_minSpin ) {
340 fprintf( stderr,
"Maximum frequency derivative must be greater than minimum frequency derivative\n" );
349 if ( uvar_printLog ) {
354 chi2Params.
length = uvar_p;
360 numberCountVec.
length = uvar_p;
361 numberCountVec.
data = NULL;
369 if ( uvar_AllSkyFlag == 0 ) {
379 h0V.
data[0] = uvar_h0Min;
381 if ( uvar_nh0 > 1 ) {
384 steph0 = ( uvar_h0Max - uvar_h0Min ) / ( uvar_nh0 - 1. );
385 for (
k = 1;
k < uvar_nh0; ++
k ) {
404 setvbuf( fpPar, (
char * )NULL, _IOLBF, 0 );
412 setvbuf( fpH0, (
char * )NULL, _IOLBF, 0 );
420 setvbuf( fpNc, (
char * )NULL, _IOLBF, 0 );
426 setvbuf(
fp, (
char * )NULL, _IOLBF, 0 );
428 for (
k = 0;
k < uvar_nh0; ++
k ) {
451 if ( ( catalog == NULL ) || ( catalog->
length == 0 ) ) {
457 mObsCoh = catalog->
length;
464 tObs =
XLALGPSDiff( &lastTimeStamp, &firstTimeStamp ) + timeBase;
475 numifo = inputSFTs->
length;
480 sftFminBin = (
INT4 ) floor( fHeterodyne * timeBase + 0.5 );
481 tSamplingRate = 2.0 *
deltaF * ( binsSFT - 1. );
500 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
524 timeDiffV.
length = mObsCoh;
525 timeDiffV.
data = NULL;
530 multiIniTimeV->
length = numifo;
538 UINT4 iIFO, iSFT, numsft,
j;
550 for (
j = 0, iIFO = 0; iIFO < numifo; iIFO++ ) {
552 for ( iSFT = 0; iSFT < numsft; iSFT++,
j++ ) {
560 multiIniTimeV->
data[iIFO] = NULL;
567 for (
j = 0;
j < mObsCoh;
j++ ) {
580 alphaPeak = exp( - uvar_peakThreshold );
581 meanN = mObsCoh * alphaPeak;
593 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
597 pSkyConstAndZeroPsiAMResponse[iIFO].
skyConst = (
REAL8 * )
LALMalloc( ( 2 * msp * ( numsft + 1 ) + 2 * numsft + 3 ) *
sizeof(
REAL8 ) );
609 pSFTandSignalParams->
resTrig = 0;
614 for (
k = 0;
k <= pSFTandSignalParams->
resTrig;
k++ ) {
616 pSFTandSignalParams->
sinVal[
k] = sin( pSFTandSignalParams->
trigArg[
k] );
617 pSFTandSignalParams->
cosVal[
k] = cos( pSFTandSignalParams->
trigArg[
k] );
622 pSFTandSignalParams->
nSamples = (
INT4 )( 0.5 * timeBase );
623 pSFTandSignalParams->
Dterms = uvar_Dterms;
630 injectPar.
h0 = uvar_h0Min;
634 injectPar.
alpha = uvar_alpha;
635 injectPar.
delta = uvar_delta;
657 sftParams.
Tsft = timeBase;
666 params.samplingRate = tSamplingRate;
667 params.fHeterodyne = fHeterodyne;
700 for (
j = 0;
j < nTemplates; ++
j ) {
702 foftV[
j].
data = NULL;
710 for ( MCloopId = 0; MCloopId < uvar_nMCloop; ++MCloopId ) {
713 &closeTemplates, &injectPar ), &
status );
719 fprintf( fpPar,
"%d %f %f %g %g %f %f %f %f %f %f %f\n",
720 MCloopId, pulsarInject.
f0, pulsarTemplate.
f0,
724 pulsarInject.
phi0, pulsarInject.
psi, ( pulsarInject.
aCross ) / injectPar.
h0
732 if ( !uvar_mismatch ) {
733 pulsarTemplate.
f0 = pulsarInject.
f0;
757 UINT4 iIFO, numsft, iSFT,
j;
761 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
767 for ( iSFT = 0; iSFT < numsft; iSFT++ ) {
768 for (
j = 0;
j < binsSFT;
j++ ) {
774 &pSkyConstAndZeroPsiAMResponse[iIFO], pSFTandSignalParams ), &
status );
776 &pSkyConstAndZeroPsiAMResponse[iIFO], pSFTandSignalParams ), &
status );
780 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
785 signalSFTs->
data[iIFO] = NULL;
793 signalTseries = NULL;
804 weightsV.
length = mObsCoh;
807 weightsNoise.
length = mObsCoh;
818 if ( uvar_weighAM ) {
824 weightsAM.
length = mObsCoh;
833 for (
k = 0, iIFO = 0; iIFO < numifo; iIFO++ ) {
835 for ( iSFT = 0; iSFT < numsft; iSFT++,
k++ ) {
839 b = multiAMcoef->
data[iIFO]->
b->
data[iSFT];
840 weightsAM.data[
k] = (
a *
a + b * b );
851 fprintf( fpNc,
" %d ", MCloopId );
853 for ( h0loop = 0; h0loop < uvar_nh0; ++h0loop ) {
865 h0scale = h0V.
data[h0loop] / h0V.
data[0];
870 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
872 for ( iSFT = 0; iSFT < numsft; iSFT++ ) {
878 for (
j = 0;
j < binsSFT;
j++ ) {
879 *( sumSFT ) =
crectf( crealf( *noiseSFT ) + h0scale * crealf( *signalSFT ), cimagf( *noiseSFT ) + h0scale * cimagf( *signalSFT ) );
894 if ( ( fpRand = fopen(
"/dev/urandom",
"r" ) ) == NULL ) {
895 fprintf( stderr,
"Error in opening /dev/urandom" );
899 if ( ( ranCount = fread( &
seed,
sizeof(
seed ), 1, fpRand ) ) != 1 ) {
900 fprintf( stderr,
"Error in getting random seed" );
918 REAL8 sumWeightSquare;
930 if ( uvar_weighNoise ) {
938 if ( uvar_weighNoise ) {
939 for (
j = 0, iIFO = 0; iIFO < numifo; iIFO++ ) {
941 for ( iSFT = 0; iSFT < numsft; iSFT++,
j++ ) {
947 memcpy( weightsV.
data, weightsNoise.
data, mObsCoh *
sizeof(
REAL8 ) );
950 if ( uvar_weighAM && weightsAM.data ) {
951 for (
j = 0;
j < mObsCoh;
j++ ) {
952 weightsV.
data[
j] = weightsV.
data[
j] * weightsAM.data[
j];
959 sumWeightSquare = 0.0;
960 for (
j = 0;
j < mObsCoh;
j++ ) {
961 sumWeightSquare += weightsV.
data[
j] * weightsV.
data[
j];
965 sigmaN = sqrt( sumWeightSquare * alphaPeak * ( 1.0 - alphaPeak ) );
970 UINT4 ii, numberSFTp;
987 for (
k = 0 ;
k < uvar_p ;
k++ ) {
992 for ( ii = 0 ; ( ii < numberSFTp ) && ( iIFO < numifo ) ; ii++ ) {
994 sft = sumSFTs->
data[iIFO]->
data + iSFT;
998 ind = floor( foft.
data[
j] * timeBase - sftFminBin + 0.5 );
1000 numberCount += pg1.
data[ind] * weightsV.
data[
j];
1006 if ( iSFT >= numsft ) {
1010 if ( iIFO < numifo ) {
1017 numberCountVec.
data[
k] = numberCount;
1032 REAL8 nj, sumWeightj, sumWeightSquarej;
1035 numberCountTotal = 0;
1038 for (
k = 0;
k < uvar_p ;
k++ ) {
1039 numberCountTotal += numberCountVec.
data[
k];
1042 eta = numberCountTotal / mObsCoh;
1044 for (
j = 0 ;
j < (
UINT4 )( uvar_p ) ;
j++ ) {
1046 nj = numberCountVec.
data[
j];
1050 chi2 += ( nj - sumWeightj *
eta ) * ( nj - sumWeightj *
eta ) / ( sumWeightSquarej *
eta * ( 1 -
eta ) );
1058 fprintf(
fp,
"%g %g %g %g \n", ( numberCountTotal - meanN ) / sigmaN, meanN, sigmaN,
chi2 );
1059 fprintf( stdout,
"%g %g %g %g \n", ( numberCountTotal - meanN ) / sigmaN, meanN, sigmaN,
chi2 );
1075 if ( uvar_weighAM && weightsAM.data ) {
1103 LALFree( pSFTandSignalParams );
1109 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
1111 LALFree( pSkyConstAndZeroPsiAMResponse[iIFO].skyConst );
1112 LALFree( pSkyConstAndZeroPsiAMResponse[iIFO].fPlusZeroPsi );
1113 LALFree( pSkyConstAndZeroPsiAMResponse[iIFO].fCrossZeroPsi );
1119 LALFree( pSkyConstAndZeroPsiAMResponse );
1128 for (
j = 0;
j < nTemplates; ++
j ) {
1158 return status.statusCode;
1181 REAL8 latitude, longitude;
1203 fpRandom = fopen(
"/dev/urandom",
"r" );
1227 cosiota = 2.0 * randval - 1.0;
1230 injectPulsar->
aCross =
h0 * cosiota;
1231 injectPulsar->
aPlus = 0.5 *
h0 * ( 1.0 + cosiota * cosiota );
1244 while ( veto > 0 ) {
1254 injectPulsar->
f0 =
f0;
1256 f0bin = floor(
f0 /
deltaF + 0.5 );
1257 templatePulsar->
f0 = f0bin *
deltaF;
1275 kkcos = 2.0 * randval - 1.0;
1276 latitude = acos( kkcos ) -
LAL_PI_2;
1279 longitude =
params->alpha + (
params->patchSizeAlpha ) * ( randval - 0.5 );
1281 latitude =
params->delta + (
params->patchSizeDelta ) * ( randval - 0.5 );
1291 REAL8 dX1[2], dX2[2];
1299 templProjected.
x = dX1[0] = deltaX * ( randval - 0.5 );
1301 templProjected.
y = dX2[0] = deltaX * ( randval - 0.5 );
1303 if ( dX1[0] < 0.0 ) {
1304 dX1[1] = dX1[0] + deltaX;
1306 dX1[1] = dX1[0] - deltaX;
1309 if ( dX2[0] < 0.0 ) {
1310 dX2[1] = dX2[0] + deltaX;
1312 dX2[1] = dX2[0] - deltaX;
1317 &templRotated, &templProjected ),
status );
1320 templatePulsar->
longitude =
template.alpha;
1321 templatePulsar->
latitude =
template.delta;
1324 for ( ii = 0; ii < 2; ii++ ) {
1325 for ( jj = 0; jj < 2; jj++ ) {
1326 templProjected.
x = dX1[ii];
1327 templProjected.
y = dX2[jj];
1329 &templRotated, &templProjected ),
status );
1339 msp =
params->spnFmax.length ;
1340 closeTemplates->
f1[0] = 0.0;
1341 closeTemplates->
f1[1] = 0.0;
1349 REAL8 deltaFk, spink;
1360 timeObsInv = 1.0 /
params->timeObs;
1361 deltaFk =
deltaF * timeObsInv;
1365 spink = randval * (
params->spnFmax.data[0] -
params->spnFmin.data[0] ) +
params->spnFmin.data[0];
1368 templatePulsar->
spindown.
data[0] = floor( spink / deltaFk + 0.5 ) * deltaFk;
1370 closeTemplates->
f1[0] = floor( spink / deltaFk ) * deltaFk;
1371 closeTemplates->
f1[1] = ceil( spink / deltaFk ) * deltaFk;
1374 for (
i = 1;
i < msp; ++
i ) {
1376 spink =
params->spnFmax.data[
i] * ( 2.0 * randval - 1.0 );
1378 deltaFk = deltaFk * timeObsInv * (
i + 1.0 );
1379 templatePulsar->
spindown.
data[
i] = floor( spink / deltaFk + 0.5 ) * deltaFk;
1407 REAL8 latitude, longitude;
1428 fpRandom = fopen(
"/dev/urandom",
"r" );
1452 cosiota = 2.0 * randval - 1.0;
1455 injectPulsar->
aCross =
h0 * cosiota;
1456 injectPulsar->
aPlus = 0.5 *
h0 * ( 1.0 + cosiota * cosiota );
1466 injectPulsar->
f0 =
f0;
1468 f0bin = floor(
f0 /
deltaF + 0.5 );
1469 templatePulsar->
f0 = f0bin *
deltaF;
1484 kkcos = 2.0 * randval - 1.0;
1485 latitude = acos( kkcos ) -
LAL_PI_2;
1488 longitude =
params->alpha + (
params->patchSizeAlpha ) * ( randval - 0.5 );
1490 latitude =
params->delta + (
params->patchSizeDelta ) * ( randval - 0.5 );
1500 REAL8 dX1[2], dX2[2];
1508 templProjected.
x = dX1[0] = deltaX * ( randval - 0.5 );
1510 templProjected.
y = dX2[0] = deltaX * ( randval - 0.5 );
1512 if ( dX1[0] < 0.0 ) {
1513 dX1[1] = dX1[0] + deltaX;
1515 dX1[1] = dX1[0] - deltaX;
1518 if ( dX2[0] < 0.0 ) {
1519 dX2[1] = dX2[0] + deltaX;
1521 dX2[1] = dX2[0] - deltaX;
1526 &templRotated, &templProjected ),
status );
1529 templatePulsar->
longitude =
template.alpha;
1530 templatePulsar->
latitude =
template.delta;
1533 for ( ii = 0; ii < 2; ii++ ) {
1534 for ( jj = 0; jj < 2; jj++ ) {
1535 templProjected.
x = dX1[ii];
1536 templProjected.
y = dX2[jj];
1538 &templRotated, &templProjected ),
status );
1548 msp =
params->spnFmax.length ;
1549 closeTemplates->
f1[0] = 0.0;
1550 closeTemplates->
f1[1] = 0.0;
1558 REAL8 deltaFk, spink;
1569 timeObsInv = 1.0 /
params->timeObs;
1570 deltaFk =
deltaF * timeObsInv;
1574 spink = randval * (
params->spnFmax.data[0] -
params->spnFmin.data[0] ) +
params->spnFmin.data[0];
1577 templatePulsar->
spindown.
data[0] = floor( spink / deltaFk + 0.5 ) * deltaFk;
1579 closeTemplates->
f1[0] = floor( spink / deltaFk ) * deltaFk;
1580 closeTemplates->
f1[1] = ceil( spink / deltaFk ) * deltaFk;
1583 for (
i = 1;
i < msp; ++
i ) {
1585 spink =
params->spnFmax.data[
i] * ( 2.0 * randval - 1.0 );
1587 deltaFk = deltaFk * timeObsInv * (
i + 1.0 );
1588 templatePulsar->
spindown.
data[
i] = floor( spink / deltaFk + 0.5 ) * deltaFk;
1613 REAL8 f0new, vcProdn, timeDiffN;
1614 REAL8 sourceDelta, sourceAlpha, cosDelta;
1615 INT4 j,
i, nspin, factorialN;
1632 sourceDelta = pulsarTemplate->
latitude;
1633 sourceAlpha = pulsarTemplate->
longitude;
1634 cosDelta = cos( sourceDelta );
1636 sourceLocation.
x = cosDelta * cos( sourceAlpha );
1637 sourceLocation.
y = cosDelta * sin( sourceAlpha );
1638 sourceLocation.
z = sin( sourceDelta );
1643 for (
j = 0;
j < mObsCoh; ++
j ) {
1644 vcProdn = velV->
data[
j].
x * sourceLocation.
x
1645 + velV->
data[
j].
y * sourceLocation.
y
1646 + velV->
data[
j].
z * sourceLocation.
z;
1647 f0new = pulsarTemplate->
f0;
1649 timeDiffN = timeDiffV->
data[
j];
1651 for (
i = 0;
i < nspin; ++
i ) {
1652 factorialN *= (
i + 1 );
1653 f0new += pulsarTemplate->
spindown.
data[
i] * timeDiffN / factorialN;
1654 timeDiffN *= timeDiffN;
1656 foft->
data[
j] = f0new * ( 1.0 + vcProdn );
1684 CHAR *fnameLog = NULL;
1686 CHAR *logstr = NULL;
1694 strcpy( fnameLog, dir );
1695 strcat( fnameLog,
"/logfiles/" );
1702 mkdir_result = mkdir( fnameLog, S_IRWXU | S_IRWXG | S_IRWXO );
1703 if ( ( mkdir_result == -1 ) && ( errno != EEXIST ) ) {
1704 fprintf( stderr,
"unable to create logfiles directory %s\n", fnameLog );
1711 strcat( fnameLog, basename );
1712 strcat( fnameLog,
".log" );
1714 if ( ( fpLog = fopen( fnameLog,
"w" ) ) == NULL ) {
1715 fprintf( stderr,
"Unable to open file %s for writing\n", fnameLog );
1723 fprintf( fpLog,
"## LOG FILE FOR MC Inject Hough\n\n" );
1724 fprintf( fpLog,
"# User Input:\n" );
1725 fprintf( fpLog,
"#-------------------------------------------\n" );
1726 fprintf( fpLog,
"%s", logstr );
1732 for (
k = 0;
k < linefiles->
length;
k++ ) {
1734 if ( ( fpLog = fopen( fnameLog,
"a" ) ) != NULL ) {
1735 CHAR command[1024] =
"";
1736 fprintf( fpLog,
"\n\n# Contents of linefile %s :\n", linefiles->
data[
k] );
1737 fprintf( fpLog,
"# -----------------------------------------\n" );
1739 sprintf( command,
"cat %s >> %s", linefiles->
data[
k], fnameLog );
1740 if ( system( command ) ) {
1741 fprintf( stderr,
"\nsystem('%s') returned non-zero status!\n\n", command );
1748 if ( ( fpLog = fopen( fnameLog,
"a" ) ) != NULL ) {
1749 CHAR command[1024] =
"";
1750 fprintf( fpLog,
"\n\n# CVS-versions of executable:\n" );
1751 fprintf( fpLog,
"# -----------------------------------------\n" );
1754 sprintf( command,
"ident %s | sort -u >> %s", executable, fnameLog );
1758 if ( system( command ) ) {
1759 fprintf( stderr,
"\nsystem('%s') returned non-zero status!\n\n", command );
1779 REAL8 sumWeightpMax;
1782 REAL8 partialsumWeightp, partialsumWeightSquarep;
1799 mObsCoh = weightsV->
length;
1802 sumWeightpMax = (
REAL8 )( mObsCoh ) /
p;
1803 weights_ptr = weightsV->
data;
1807 for (
j = 0;
j <
p;
j++ ) {
1809 partialsumWeightSquarep = 0;
1810 partialsumWeightp = 0;
1812 for ( numberSFT = 0; ( partialsumWeightp < sumWeightpMax ) && ( iSFT < mObsCoh ); numberSFT++, iSFT++ ) {
1814 partialsumWeightp += *weights_ptr;
1815 partialsumWeightSquarep += ( *weights_ptr ) * ( *weights_ptr );
1823 chi2Params->
sumWeight[
j] = partialsumWeightp;
#define DRIVEHOUGHCOLOR_MSGEBAD
#define DRIVEHOUGHCOLOR_MSGENULL
#define DRIVEHOUGHCOLOR_MSGEARG
#define DRIVEHOUGHCOLOR_EFILE
#define DRIVEHOUGHCOLOR_ENULL
#define DRIVEHOUGHCOLOR_EBAD
#define DRIVEHOUGHCOLOR_MSGEFILE
#define DRIVEHOUGHCOLOR_EARG
void REPORTSTATUS(LALStatus *status)
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
#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 main(int argc, char *argv[])
void SplitSFTs(LALStatus *status, REAL8Vector *weightsV, HoughParamsTest *chi2Params)
void GenerateInjectParams(LALStatus *status, PulsarData *injectPulsar, HoughTemplate *templatePulsar, HoughNearTemplates *closeTemplates, HoughInjectParams *params, LineNoiseInfo *lines)
void PrintLogFile2(LALStatus *status, CHAR *dir, CHAR *basename, LALStringVector *linefiles, CHAR *executable)
void GenerateInjectParamsNoVeto(LALStatus *status, PulsarData *injectPulsar, HoughTemplate *templatePulsar, HoughNearTemplates *closeTemplates, HoughInjectParams *params)
void ComputeFoft_NM(LALStatus *status, REAL8Vector *foft, HoughTemplate *pulsarTemplate, REAL8Vector *timeDiffV, REAL8Cart3CoorVector *velV)
#define MAXFILENAMELENGTH
void SFTtoUCHARPeakGram(LALStatus *status, UCHARPeakGram *pg, const SFTtype *sft, REAL8 thr)
Convert a normalized sft into a peakgram by selecting bins in which power exceeds a threshold.
void XLALDestroyMultiDetectorStateSeries(MultiDetectorStateSeries *mdetStates)
Helper function to get rid of a multi-IFO DetectorStateSeries Note, this is "NULL-robust" in the sens...
MultiDetectorStateSeries * XLALGetMultiDetectorStatesFromMultiSFTs(const MultiSFTVector *multiSFTs, const EphemerisData *edat, REAL8 tOffset)
Get the 'detector state' (ie detector-tensor, position, velocity, etc) for the given multi-vector of ...
void LALGeneratePulsarSignal(LALStatus *status, REAL4TimeSeries **signalvec, const PulsarSignalParams *params)
void LALFastGeneratePulsarSFTs(LALStatus *status, SFTVector **outputSFTs, const SkyConstAndZeroPsiAMResponse *input, const SFTandSignalParams *params)
Fast generation of Fake SFTs for a pure pulsar signal.
void LALSignalToSFTs(LALStatus *status, SFTVector **outputSFTs, const REAL4TimeSeries *signalvec, const SFTParams *params)
void LALComputeSkyAndZeroPsiAMResponse(LALStatus *status, SkyConstAndZeroPsiAMResponse *output, const SFTandSignalParams *params)
/deprecated Move to attic? Wrapper for LALComputeSky() and LALComputeDetAMResponse() that finds the s...
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 LALHOUGHNormalizeWeights(LALStatus *status, REAL8Vector *weightV)
Normalizes weight factors so that their sum is N.
void LALHOUGHInitializeWeights(LALStatus *status, REAL8Vector *weightV)
Initializes weight factors to unity.
#define VTOT
Total detector velocity/c TO BE CHANGED DEPENDING ON DETECTOR.
void LALInvRotatePolarU(LALStatus *status, REAL8UnitPolarCoor *out, REAL8UnitPolarCoor *in, REAL8UnitPolarCoor *par)
void LALStereoInvProjectCart(LALStatus *status, REAL8UnitPolarCoor *out, REAL8Cart2Coor *in)
MultiPSDVector * XLALNormalizeMultiSFTVect(MultiSFTVector *multsft, UINT4 blockSize, const MultiNoiseFloor *assumeSqrtSX)
Function for normalizing a multi vector of SFTs in a multi IFO search and returns the running-median ...
void XLALDestroyMultiPSDVector(MultiPSDVector *multvect)
Destroy a multi PSD-vector.
MultiNoiseWeights * XLALComputeMultiNoiseWeights(const MultiPSDVector *rngmed, UINT4 blocksRngMed, UINT4 excludePercentile)
Computes weight factors arising from MultiSFTs with different noise floors.
void XLALDestroyMultiNoiseWeights(MultiNoiseWeights *weights)
Destroy a MultiNoiseWeights object.
void LALCreateRandomParams(LALStatus *status, RandomParams **params, INT4 seed)
void LALUniformDeviate(LALStatus *status, REAL4 *deviate, RandomParams *params)
void LALDestroyRandomParams(LALStatus *status, RandomParams **params)
void LALRngMedBias(LALStatus *status, REAL8 *biasFactor, INT4 blkSize)
void LALRemoveKnownLinesInMultiSFTVector(LALStatus *status, MultiSFTVector *MultiSFTVect, INT4 width, INT4 window, LALStringVector *linefiles, RandomParams *randPar)
top level function to remove lines from a multi sft vector given a list of files containing list of k...
void LALCheckLines(LALStatus *status, INT4 *countL, LineNoiseInfo *lines, REAL8 freq)
Function to count how many lines affect a given frequency.
void XLALDestroySFTVector(SFTVector *vect)
XLAL interface to destroy an SFTVector.
void XLALDestroySFTCatalog(SFTCatalog *catalog)
Free an 'SFT-catalogue'.
MultiSFTVector * XLALLoadMultiSFTs(const SFTCatalog *inputCatalog, REAL8 fMin, REAL8 fMax)
Function to load a catalog of SFTs from possibly different detectors.
void XLALDestroyMultiSFTVector(MultiSFTVector *multvect)
Destroy a multi SFT-vector.
LIGOTimeGPSVector * XLALExtractTimestampsFromSFTs(const SFTVector *sfts)
Extract timstamps-vector from the given SFTVector.
MultiSFTVector * XLALCreateMultiSFTVector(UINT4 length, UINT4Vector *numsft)
Create a multi-IFO SFT vector with a given number of bins per SFT and number of SFTs per IFO (which w...
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.
COORDINATESYSTEM_EQUATORIAL
#define XLAL_CHECK_MAIN(assertion,...)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
p
RUN ANALYSIS SCRIPT ###.
REAL4Vector * b
(weighted) per-SFT antenna-pattern function
REAL4Vector * a
(weighted) per-SFT antenna-pattern function
COMPLEX8FrequencySeries * data
Pointer to the data array.
UINT4 length
Number of elements in array.
LIGOTimeGPS tGPS
GPS timestamps corresponding to this entry.
DetectorState * data
array of DetectorState entries
UINT4 length
total number of entries
LALDetector detector
detector-info corresponding to this timeseries
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
REAL8UnitPolarCoor skytemp[4]
A vector of 'timestamps' of type LIGOTimeGPS.
LIGOTimeGPS * data
array of timestamps
UINT4 length
number of timestamps
structure for storing list of spectral lines – constructed by expanding list of harmonics
Multi-IFO container for antenna-pattern coefficients and atenna-pattern matrix .
UINT4 length
number of IFOs
AMCoeffs ** data
noise-weighted AM-coeffs , and
Multi-IFO time-series of DetectorStates.
DetectorStateSeries ** data
vector of pointers to DetectorStateSeries
A collection of (multi-IFO) LIGOTimeGPSVector time-stamps vectors.
UINT4 length
number of timestamps vectors or ifos
LIGOTimeGPSVector ** data
timestamps vector for each ifo
One noise-weight (number) per SFT (therefore indexed over IFOs and SFTs.
REAL8Vector ** data
weights-vector for each detector
A collection of PSD vectors – one for each IFO in a multi-IFO search.
A collection of SFT vectors – one for each IFO in a multi-IFO search.
UINT4 length
number of ifos
SFTVector ** data
sftvector for each ifo
Input parameters to GeneratePulsarSignal(), defining the source and the time-series.
Two dimensional Cartessian coordinates.
Three dimensional Cartessian coordinates.
REAL8Cart3Coor * data
x.y.z
UINT4 length
number of elements
Polar coordinates of a unitary vector on the sphere.
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
'Constraints' for SFT-matching: which detector, within which time-stretch and which timestamps exactl...
CHAR * detector
2-char channel-prefix describing the detector (eg 'H1', 'H2', 'L1', 'G1' etc)
SFTtype header
SFT-header info.
Parameters defining the SFTs to be returned from LALSignalToSFTs().
REAL8 Tsft
length of each SFT in seconds
const LIGOTimeGPSVector * timestamps
timestamps to produce SFTs for (can be NULL)
const SFTVector * noiseSFTs
noise SFTs to be added (can be NULL)
Parameters defining the pulsar signal and SFTs used by LALFastGeneratePulsarSFTs().
REAL8 * sinVal
sinVal holds lookup table (LUT) values for doing trig sin calls
INT4 nSamples
nsample from noise SFT header; 2x this equals effective number of time samples
PulsarSignalParams * pSigParams
REAL8 * cosVal
cosVal holds lookup table (LUT) values for doing trig cos calls
REAL8 * trigArg
array of arguments to hold lookup table (LUT) values for doing trig calls
INT4 Dterms
use this to fill in SFT bins with fake data as per LALDemod else fill in bin with zero
INT4 resTrig
length sinVal, cosVal; domain: -2pi to 2pi; resolution = 4pi/resTrig
Sky Constants and beam pattern response functions used by LALFastGeneratePulsarSFTs().
REAL8 * skyConst
vector of A and B sky constants
REAL4 * fPlusZeroPsi
vector of Fplus values for psi = 0 at midpoint of each SFT
REAL4 * fCrossZeroPsi
vector of Fcross values for psi = 0 at midpoint of each SFT
Explicit peakgram structure – 1 if power in bin is above threshold and 0 if below.
UCHAR * data
pointer to the data {0,1}
INT4 length
number of elements in data