30#include <lal/UserInput.h>
31#include <lal/SFTfileIO.h>
32#include <lal/LALPulsarVCSInfo.h>
56main(
int argc,
char *argv[] )
95 CHAR buf1[32], buf2[32];;
104 if ( uvar.verbose ) {
111 norm1 = sqrt( norm1 );
113 norm2 = sqrt( norm2 );
118 REAL4 d1 = ( norm1 - norm2 ) / norm1;
119 REAL4 d2 = 1.0 - scalar / ( norm1 * norm2 );
120 REAL4 d3 = normdiff / ( norm1 * norm1 + norm2 * norm2 );
122 XLALPrintInfo(
"SFT #%d: (|x|-|y|)/|x|=%10.3e, 1-x.y/(|x||y|)=%10.3e, |x-y|^2/(|x|^2+|y|^2))=%10.3e, maxErrSFT=%10.3e\n",
i, d1, d2, d3, d4 );
141 REAL8 d1 = ( norm1 - norm2 ) / norm1;
143 REAL8 d2 = 1.0 - scalar / ( norm1 * norm2 );
145 REAL8 d3 = normdiff / ( norm1 * norm1 + norm2 * norm2 );
150 if ( uvar.verbose ) {
151 printf(
"TOTAL: (|x|-|y|)/|x|=%10.3e, 1-x.y/(|x||y|)=%10.3e, |x-y|^2/(|x|^2+|y|^2)=%10.3e, maxErrSFT=%10.3e\n", d1, d2, d3, d4 );
152 printf(
"COMPARE: maxd=%10.3e, relErrMax=%10.3e\n",
maxd, uvar.relErrorMax );
166 if (
maxd <= uvar.relErrorMax ) {
170 XLALPrintError(
"Tolerance exceeded! maxd=%10.3e, relErrMax=%10.3e\n",
maxd, uvar.relErrorMax );
189 uvar->relErrorMax = 1
e-4;
194 " - '<SFT file>;<SFT file>;...', where <SFT file> may contain wildcards\n - 'list:<file containing list of SFT files>'" ) ==
XLAL_SUCCESS,
XLAL_EFUNC );
196 " - '<SFT file>;<SFT file>;...', where <SFT file> may contain wildcards\n - 'list:<file containing list of SFT files>'" ) ==
XLAL_SUCCESS,
XLAL_EFUNC );
210 REAL8 maxDiff, maxAmpl;
216 REAL8 diff, A1, A2, Ampl;
217 REAL8 re1, re2, im1, im2;
223 diff = ( re1 - re2 ) * ( re1 - re2 ) + ( im1 - im2 ) * ( im1 - im2 );
224 A1 = re1 * re1 + im1 * im1;
225 A2 = re2 * re2 + im2 * im2;
226 Ampl =
fmax( A1, A2 );
228 maxDiff =
fmax( maxDiff, diff );
229 maxAmpl =
fmax( maxAmpl, Ampl );
233 maxErr = maxDiff / maxAmpl;
243 REAL4 maxErr, thisErr;
247 for (
i = 0;
i < sftvect1->
length;
i++ ) {
249 maxErr =
fmax( maxErr, thisErr );
276 prod += xre * yre + xim * yim;
282 return (
REAL4 ) prod;
299 prod += (
REAL8 ) xy;
302 return (
REAL4 )prod;
void LALCheckMemoryLeaks(void)
const LALVCSInfoList lalPulsarVCSInfoList
NULL-terminated list of VCS and build information for LALPulsar and its dependencies
int main(int argc, char *argv[])
int initUserVars(UserInput_t *uvar)
REAL4 scalarProductSFTVector(const SFTVector *sftvect1, const SFTVector *sftvect2)
REAL4 getMaxErrSFT(const SFTtype *sft1, const SFTtype *sft2)
REAL4 scalarProductSFT(const SFTtype *sft1, const SFTtype *sft2)
SFTVector * subtractSFTVectors(const SFTVector *sftvect1, const SFTVector *sftvect2)
REAL4 getMaxErrSFTVector(const SFTVector *sftvect1, const SFTVector *sftvect2)
char * XLALGPSToStr(char *s, const LIGOTimeGPS *t)
#define XLAL_INIT_DECL(var,...)
void XLALDestroySFTVector(SFTVector *vect)
XLAL interface to destroy an SFTVector.
void XLALDestroySFTCatalog(SFTCatalog *catalog)
Free an 'SFT-catalogue'.
SFTVector * XLALLoadSFTs(const SFTCatalog *catalog, REAL8 fMin, REAL8 fMax)
Load the given frequency-band [fMin, fMax) (half-open) from the SFT-files listed in the SFT-'catalogu...
SFTCatalog * XLALSFTdataFind(const CHAR *file_pattern, const SFTConstraints *constraints)
Find the list of SFTs matching the file_pattern and satisfying the given constraints,...
SFTVector * XLALCreateSFTVector(UINT4 numSFTs, UINT4 numBins)
XLAL function to create an SFTVector of numSFT SFTs with SFTlen frequency-bins (which will be allocat...
int int int XLALPrintInfo(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_MAIN(assertion,...)
#define XLAL_CHECK_REAL4(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_CHECK_NULL(assertion,...)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
A vector of COMPLEX8FrequencySeries.
COMPLEX8FrequencySeries * data
Pointer to the data array.
UINT4 length
Number of elements in array.
An "SFT-catalogue": a vector of SFTdescriptors, as returned by XLALSFTdataFind()