53#define EARTHEPHEMERIS "./earth05-09.dat"
54#define SUNEPHEMERIS "./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 "/HoughMC"
105int main(
int argc,
char *argv[] )
143 REAL8 alphaPeak, meanN, sigmaN, significance;
151 REAL8 numberCount, maxNumberCount;
178 BOOLEAN uvar_weighAM, uvar_weighNoise, uvar_printLog, uvar_fast;
180 INT4 uvar_nfSizeCylinder, uvar_maxBinsClean, uvar_Dterms;
181 REAL8 uvar_f0, uvar_fSearchBand, uvar_peakThreshold, uvar_h0Min, uvar_h0Max, uvar_maxSpin, uvar_minSpin;
182 REAL8 uvar_alpha, uvar_delta, uvar_patchSizeAlpha, uvar_patchSizeDelta, uvar_pixelFactor;
183 CHAR *uvar_earthEphemeris = NULL;
184 CHAR *uvar_sunEphemeris = NULL;
187 CHAR *uvar_fnameOut = NULL;
190 CHAR *uvar_timeStampsFile = NULL;
200 uvar_weighNoise =
TRUE;
201 uvar_printLog =
FALSE;
213 uvar_fSearchBand =
FBAND;
215 uvar_nfSizeCylinder =
NFSIZE;
217 uvar_maxBinsClean = 100;
222 uvar_minSpin = -1
e-8;
240 strcpy( uvar_fnameOut,
FILEOUT );
253 " - '<SFT file>;<SFT file>;...', where <SFT file> may contain wildcards\n - 'list:<file containing list of SFT files>'" ) ==
XLAL_SUCCESS,
XLAL_EFUNC );
292 fprintf( stderr,
"start frequency must be positive\n" );
296 if ( uvar_fSearchBand < 0 ) {
297 fprintf( stderr,
"search frequency band must be positive\n" );
301 if ( uvar_peakThreshold < 0 ) {
302 fprintf( stderr,
"peak selection threshold must be positive\n" );
306 if ( uvar_maxSpin < uvar_minSpin ) {
307 fprintf( stderr,
"Maximum frequency derivative must be greater than minimum frequency derivative\n" );
316 if ( uvar_printLog ) {
325 if ( uvar_AllSkyFlag == 0 ) {
335 h0V.
data[0] = uvar_h0Min;
337 if ( uvar_nh0 > 1 ) {
340 steph0 = ( uvar_h0Max - uvar_h0Min ) / ( uvar_nh0 - 1. );
341 for (
k = 1;
k < uvar_nh0; ++
k ) {
360 setvbuf( fpPar, (
char * )NULL, _IOLBF, 0 );
368 setvbuf( fpH0, (
char * )NULL, _IOLBF, 0 );
376 setvbuf( fpNc, (
char * )NULL, _IOLBF, 0 );
378 for (
k = 0;
k < uvar_nh0; ++
k ) {
411 constraints.
timestamps = inputTimeStampsVector;
416 if ( ( catalog == NULL ) || ( catalog->
length == 0 ) ) {
428 mObsCoh = catalog->
length;
435 tObs =
XLALGPSDiff( &lastTimeStamp, &firstTimeStamp ) + timeBase;
446 numifo = inputSFTs->
length;
451 sftFminBin = (
INT4 ) floor( fHeterodyne * timeBase + 0.5 );
452 tSamplingRate = 2.0 *
deltaF * ( binsSFT - 1. );
471 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
495 timeDiffV.
length = mObsCoh;
496 timeDiffV.
data = NULL;
501 multiIniTimeV->
length = numifo;
509 UINT4 iIFO, iSFT, numsft,
j;
522 for (
j = 0, iIFO = 0; iIFO < numifo; iIFO++ ) {
524 for ( iSFT = 0; iSFT < numsft; iSFT++,
j++ ) {
532 multiIniTimeV->
data[iIFO] = NULL;
539 for (
j = 0;
j < mObsCoh;
j++ ) {
552 alphaPeak = exp( - uvar_peakThreshold );
553 meanN = mObsCoh * alphaPeak;
565 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
569 pSkyConstAndZeroPsiAMResponse[iIFO].
skyConst = (
REAL8 * )
LALMalloc( ( 2 * msp * ( numsft + 1 ) + 2 * numsft + 3 ) *
sizeof(
REAL8 ) );
581 pSFTandSignalParams->
resTrig = 0;
586 for (
k = 0;
k <= pSFTandSignalParams->
resTrig;
k++ ) {
588 pSFTandSignalParams->
sinVal[
k] = sin( pSFTandSignalParams->
trigArg[
k] );
589 pSFTandSignalParams->
cosVal[
k] = cos( pSFTandSignalParams->
trigArg[
k] );
594 pSFTandSignalParams->
nSamples = (
INT4 )( 0.5 * timeBase );
595 pSFTandSignalParams->
Dterms = uvar_Dterms;
602 injectPar.
h0 = uvar_h0Min;
606 injectPar.
alpha = uvar_alpha;
607 injectPar.
delta = uvar_delta;
629 sftParams.
Tsft = timeBase;
638 params.samplingRate = tSamplingRate;
639 params.fHeterodyne = fHeterodyne;
672 for (
j = 0;
j < nTemplates; ++
j ) {
674 foftV[
j].
data = NULL;
682 for ( MCloopId = 0; MCloopId < uvar_nMCloop; ++MCloopId ) {
685 &closeTemplates, &injectPar ), &
status );
691 fprintf( fpPar,
"%d %f %f %g %g %f %f %f %f %f %f %f\n",
692 MCloopId, pulsarInject.
f0, pulsarTemplate.
f0,
696 pulsarInject.
phi0, pulsarInject.
psi, ( pulsarInject.
aCross ) / injectPar.
h0
711 for (
j = 0;
j < 2; ++
j ) {
712 pulsarTemplate.
f0 = closeTemplates.
f0[
j];
713 for (
i = 0;
i < 2; ++
i ) {
715 for (
k = 0;
k < 4; ++
k ) {
719 &pulsarTemplate, &timeDiffV, &velV ), &
status );
740 UINT4 iIFO, numsft, iSFT,
j;
744 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
750 for ( iSFT = 0; iSFT < numsft; iSFT++ ) {
751 for (
j = 0;
j < binsSFT;
j++ ) {
757 &pSkyConstAndZeroPsiAMResponse[iIFO], pSFTandSignalParams ), &
status );
759 &pSkyConstAndZeroPsiAMResponse[iIFO], pSFTandSignalParams ), &
status );
763 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
768 signalSFTs->
data[iIFO] = NULL;
776 signalTseries = NULL;
787 weightsV.
length = mObsCoh;
790 weightsNoise.
length = mObsCoh;
801 if ( uvar_weighAM ) {
807 weightsAM.
length = mObsCoh;
816 for (
k = 0, iIFO = 0; iIFO < numifo; iIFO++ ) {
818 for ( iSFT = 0; iSFT < numsft; iSFT++,
k++ ) {
822 b = multiAMcoef->
data[iIFO]->
b->
data[iSFT];
823 weightsAM.data[
k] = (
a *
a + b * b );
835 fprintf( fpNc,
" %d ", MCloopId );
837 for ( h0loop = 0; h0loop < uvar_nh0; ++h0loop ) {
840 UINT4 iIFO, numsft, iSFT;
846 for ( itemplate = 0; itemplate < nTemplates; ++itemplate ) {
847 numberCountV[itemplate] = 0.0;
850 h0scale = h0V.
data[h0loop] / h0V.
data[0];
855 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
857 for ( iSFT = 0; iSFT < numsft; iSFT++ ) {
863 for (
j = 0;
j < binsSFT;
j++ ) {
864 *( sumSFT ) =
crectf( crealf( *noiseSFT ) + h0scale * crealf( *signalSFT ), cimagf( *noiseSFT ) + h0scale * cimagf( *signalSFT ) );
879 if ( ( fpRand = fopen(
"/dev/urandom",
"r" ) ) == NULL ) {
880 fprintf( stderr,
"Error in opening /dev/urandom" );
884 if ( ( ranCount = fread( &
seed,
sizeof(
seed ), 1, fpRand ) ) != 1 ) {
885 fprintf( stderr,
"Error in getting random seed" );
903 REAL8 sumWeightSquare;
915 if ( uvar_weighNoise ) {
923 if ( uvar_weighNoise ) {
924 for (
j = 0, iIFO = 0; iIFO < numifo; iIFO++ ) {
926 for ( iSFT = 0; iSFT < numsft; iSFT++,
j++ ) {
932 memcpy( weightsV.
data, weightsNoise.
data, mObsCoh *
sizeof(
REAL8 ) );
935 if ( uvar_weighAM && weightsAM.data ) {
936 for (
j = 0;
j < mObsCoh;
j++ ) {
937 weightsV.
data[
j] = weightsV.
data[
j] * weightsAM.data[
j];
944 sumWeightSquare = 0.0;
945 for (
j = 0;
j < mObsCoh;
j++ ) {
946 sumWeightSquare += weightsV.
data[
j] * weightsV.
data[
j];
950 sigmaN = sqrt( sumWeightSquare * alphaPeak * ( 1.0 - alphaPeak ) );
958 for (
j = 0, iIFO = 0; iIFO < numifo; iIFO++ ) {
961 for ( iSFT = 0; iSFT < numsft; iSFT++,
j++ ) {
963 sft = sumSFTs->
data[iIFO]->
data + iSFT;
965 ind = floor( foft.
data[
j] * timeBase - sftFminBin + 0.5 );
966 numberCount += pg1.
data[ind] * weightsV.
data[
j];
968 for ( itemplate = 0; itemplate < nTemplates; ++itemplate ) {
969 ind = floor( foftV[itemplate].
data[
j] * timeBase - sftFminBin + 0.5 );
970 numberCountV[itemplate] += pg1.
data[ind] * weightsV.
data[
j];
979 maxNumberCount = numberCount;
980 for ( itemplate = 0; itemplate < nTemplates; ++itemplate ) {
981 if ( numberCountV[itemplate] > maxNumberCount ) {
982 maxNumberCount = numberCountV[itemplate];
989 significance = ( maxNumberCount - meanN ) / sigmaN;
990 fprintf( fpNc,
" %f ", significance );
998 if ( uvar_weighAM && weightsAM.data ) {
1025 LALFree( pSFTandSignalParams );
1031 for ( iIFO = 0; iIFO < numifo; iIFO++ ) {
1033 LALFree( pSkyConstAndZeroPsiAMResponse[iIFO].skyConst );
1034 LALFree( pSkyConstAndZeroPsiAMResponse[iIFO].fPlusZeroPsi );
1035 LALFree( pSkyConstAndZeroPsiAMResponse[iIFO].fCrossZeroPsi );
1041 LALFree( pSkyConstAndZeroPsiAMResponse );
1050 for (
j = 0;
j < nTemplates; ++
j ) {
1074 return status.statusCode;
1097 REAL8 latitude, longitude;
1119 fpRandom = fopen(
"/dev/urandom",
"r" );
1143 cosiota = 2.0 * randval - 1.0;
1146 injectPulsar->
aCross =
h0 * cosiota;
1147 injectPulsar->
aPlus = 0.5 *
h0 * ( 1.0 + cosiota * cosiota );
1160 while ( veto > 0 ) {
1170 injectPulsar->
f0 =
f0;
1172 f0bin = floor(
f0 /
deltaF + 0.5 );
1173 templatePulsar->
f0 = f0bin *
deltaF;
1191 kkcos = 2.0 * randval - 1.0;
1192 latitude = acos( kkcos ) -
LAL_PI_2;
1195 longitude =
params->alpha + (
params->patchSizeAlpha ) * ( randval - 0.5 );
1197 latitude =
params->delta + (
params->patchSizeDelta ) * ( randval - 0.5 );
1207 REAL8 dX1[2], dX2[2];
1215 templProjected.
x = dX1[0] = deltaX * ( randval - 0.5 );
1217 templProjected.
y = dX2[0] = deltaX * ( randval - 0.5 );
1219 if ( dX1[0] < 0.0 ) {
1220 dX1[1] = dX1[0] + deltaX;
1222 dX1[1] = dX1[0] - deltaX;
1225 if ( dX2[0] < 0.0 ) {
1226 dX2[1] = dX2[0] + deltaX;
1228 dX2[1] = dX2[0] - deltaX;
1233 &templRotated, &templProjected ),
status );
1236 templatePulsar->
longitude =
template.alpha;
1237 templatePulsar->
latitude =
template.delta;
1240 for ( ii = 0; ii < 2; ii++ ) {
1241 for ( jj = 0; jj < 2; jj++ ) {
1242 templProjected.
x = dX1[ii];
1243 templProjected.
y = dX2[jj];
1245 &templRotated, &templProjected ),
status );
1255 msp =
params->spnFmax.length ;
1256 closeTemplates->
f1[0] = 0.0;
1257 closeTemplates->
f1[1] = 0.0;
1265 REAL8 deltaFk, spink;
1276 timeObsInv = 1.0 /
params->timeObs;
1277 deltaFk =
deltaF * timeObsInv;
1281 spink = randval * (
params->spnFmax.data[0] -
params->spnFmin.data[0] ) +
params->spnFmin.data[0];
1284 templatePulsar->
spindown.
data[0] = floor( spink / deltaFk + 0.5 ) * deltaFk;
1286 closeTemplates->
f1[0] = floor( spink / deltaFk ) * deltaFk;
1287 closeTemplates->
f1[1] = ceil( spink / deltaFk ) * deltaFk;
1290 for (
i = 1;
i < msp; ++
i ) {
1292 spink =
params->spnFmax.data[
i] * ( 2.0 * randval - 1.0 );
1294 deltaFk = deltaFk * timeObsInv * (
i + 1.0 );
1295 templatePulsar->
spindown.
data[
i] = floor( spink / deltaFk + 0.5 ) * deltaFk;
1323 REAL8 latitude, longitude;
1344 fpRandom = fopen(
"/dev/urandom",
"r" );
1368 cosiota = 2.0 * randval - 1.0;
1371 injectPulsar->
aCross =
h0 * cosiota;
1372 injectPulsar->
aPlus = 0.5 *
h0 * ( 1.0 + cosiota * cosiota );
1382 injectPulsar->
f0 =
f0;
1384 f0bin = floor(
f0 /
deltaF + 0.5 );
1385 templatePulsar->
f0 = f0bin *
deltaF;
1400 kkcos = 2.0 * randval - 1.0;
1401 latitude = acos( kkcos ) -
LAL_PI_2;
1404 longitude =
params->alpha + (
params->patchSizeAlpha ) * ( randval - 0.5 );
1406 latitude =
params->delta + (
params->patchSizeDelta ) * ( randval - 0.5 );
1416 REAL8 dX1[2], dX2[2];
1424 templProjected.
x = dX1[0] = deltaX * ( randval - 0.5 );
1426 templProjected.
y = dX2[0] = deltaX * ( randval - 0.5 );
1428 if ( dX1[0] < 0.0 ) {
1429 dX1[1] = dX1[0] + deltaX;
1431 dX1[1] = dX1[0] - deltaX;
1434 if ( dX2[0] < 0.0 ) {
1435 dX2[1] = dX2[0] + deltaX;
1437 dX2[1] = dX2[0] - deltaX;
1442 &templRotated, &templProjected ),
status );
1445 templatePulsar->
longitude =
template.alpha;
1446 templatePulsar->
latitude =
template.delta;
1449 for ( ii = 0; ii < 2; ii++ ) {
1450 for ( jj = 0; jj < 2; jj++ ) {
1451 templProjected.
x = dX1[ii];
1452 templProjected.
y = dX2[jj];
1454 &templRotated, &templProjected ),
status );
1464 msp =
params->spnFmax.length ;
1465 closeTemplates->
f1[0] = 0.0;
1466 closeTemplates->
f1[1] = 0.0;
1474 REAL8 deltaFk, spink;
1485 timeObsInv = 1.0 /
params->timeObs;
1486 deltaFk =
deltaF * timeObsInv;
1490 spink = randval * (
params->spnFmax.data[0] -
params->spnFmin.data[0] ) +
params->spnFmin.data[0];
1493 templatePulsar->
spindown.
data[0] = floor( spink / deltaFk + 0.5 ) * deltaFk;
1495 closeTemplates->
f1[0] = floor( spink / deltaFk ) * deltaFk;
1496 closeTemplates->
f1[1] = ceil( spink / deltaFk ) * deltaFk;
1499 for (
i = 1;
i < msp; ++
i ) {
1501 spink =
params->spnFmax.data[
i] * ( 2.0 * randval - 1.0 );
1503 deltaFk = deltaFk * timeObsInv * (
i + 1.0 );
1504 templatePulsar->
spindown.
data[
i] = floor( spink / deltaFk + 0.5 ) * deltaFk;
1529 REAL8 f0new, vcProdn, timeDiffN;
1530 REAL8 sourceDelta, sourceAlpha, cosDelta;
1531 INT4 j,
i, nspin, factorialN;
1548 sourceDelta = pulsarTemplate->
latitude;
1549 sourceAlpha = pulsarTemplate->
longitude;
1550 cosDelta = cos( sourceDelta );
1552 sourceLocation.
x = cosDelta * cos( sourceAlpha );
1553 sourceLocation.
y = cosDelta * sin( sourceAlpha );
1554 sourceLocation.
z = sin( sourceDelta );
1559 for (
j = 0;
j < mObsCoh; ++
j ) {
1560 vcProdn = velV->
data[
j].
x * sourceLocation.
x
1561 + velV->
data[
j].
y * sourceLocation.
y
1562 + velV->
data[
j].
z * sourceLocation.
z;
1563 f0new = pulsarTemplate->
f0;
1565 timeDiffN = timeDiffV->
data[
j];
1567 for (
i = 0;
i < nspin; ++
i ) {
1568 factorialN *= (
i + 1 );
1569 f0new += pulsarTemplate->
spindown.
data[
i] * timeDiffN / factorialN;
1570 timeDiffN *= timeDiffN;
1572 foft->
data[
j] = f0new * ( 1.0 + vcProdn );
1596 CHAR *fnameLog = NULL;
1598 CHAR *logstr = NULL;
1606 strcpy( fnameLog, dir );
1607 strcat( fnameLog,
"/logfiles/" );
1614 mkdir_result = mkdir( fnameLog, S_IRWXU | S_IRWXG | S_IRWXO );
1615 if ( ( mkdir_result == -1 ) && ( errno != EEXIST ) ) {
1616 fprintf( stderr,
"unable to create logfiles directory %s\n", fnameLog );
1623 strcat( fnameLog, basename );
1624 strcat( fnameLog,
".log" );
1626 if ( ( fpLog = fopen( fnameLog,
"w" ) ) == NULL ) {
1627 fprintf( stderr,
"Unable to open file %s for writing\n", fnameLog );
1635 fprintf( fpLog,
"## LOG FILE FOR MC Inject Hough\n\n" );
1636 fprintf( fpLog,
"# User Input:\n" );
1637 fprintf( fpLog,
"#-------------------------------------------\n" );
1638 fprintf( fpLog,
"%s", logstr );
1644 for (
k = 0;
k < linefiles->
length;
k++ ) {
1646 if ( ( fpLog = fopen( fnameLog,
"a" ) ) != NULL ) {
1647 CHAR command[1024] =
"";
1648 fprintf( fpLog,
"\n\n# Contents of linefile %s :\n", linefiles->
data[
k] );
1649 fprintf( fpLog,
"# -----------------------------------------\n" );
1651 sprintf( command,
"cat %s >> %s", linefiles->
data[
k], fnameLog );
1652 if ( system( command ) ) {
1653 fprintf( stderr,
"\nsystem('%s') returned non-zero status!\n\n", command );
1660 if ( ( fpLog = fopen( fnameLog,
"a" ) ) != NULL ) {
1661 CHAR command[1024] =
"";
1662 fprintf( fpLog,
"\n\n# CVS-versions of executable:\n" );
1663 fprintf( fpLog,
"# -----------------------------------------\n" );
1666 sprintf( command,
"ident %s | sort -u >> %s", executable, fnameLog );
1670 if ( system( command ) ) {
1671 fprintf( stderr,
"\nsystem('%s') returned non-zero status!\n\n", command );
#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 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,...
LIGOTimeGPSVector * XLALReadTimestampsFile(const CHAR *fname)
backwards compatible wrapper to XLALReadTimestampsFileConstrained() without GPS-time constraints
void XLALDestroyTimestampVector(LIGOTimeGPSVector *vect)
De-allocate a LIGOTimeGPSVector.
COORDINATESYSTEM_EQUATORIAL
#define XLAL_CHECK_MAIN(assertion,...)
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
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.
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
'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)
LIGOTimeGPSVector * timestamps
list of timestamps
LIGOTimeGPS * maxStartTime
only include SFTs whose epoch is < maxStartTime
LIGOTimeGPS * minStartTime
only include SFTs whose epoch is >= minStartTime
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