30 #include <lal/ConfigFile.h>
57 if (
out->data == NULL ) {
114 if ( ( ret =
XLALMalloc(
sizeof( *ret ) ) ) == NULL ) {
144 for ( X = 0; X < numIFOs; X ++ ) {
195 if ( ( *iStart ) > ( *iEnd ) ) {
329 UINT4 numTSinRange = 0;
336 for (
UINT4 iTS = 0; iTS < numTS; iTS ++ ) {
347 if ( junk[0] != 0 ) {
460 if ( ( ret =
XLALCalloc( 1,
sizeof( *ret ) ) ) == NULL ) {
474 for ( X = 0; X < numIFOs; X ++ ) {
513 if ( fabs( ( Tsft0 - round( Tsft0 ) ) ) / Tsft0 < 10 *
LAL_REAL8_EPS ) {
514 ret->
deltaT = round( Tsft0 );
525 for (
UINT4 i = 1;
i < numEntries;
i ++ ) {
526 UINT4 thisStride = 1;
540 XLAL_CHECK_NULL( stride == thisStride,
XLAL_EINVAL,
"Suspicious SFT Catalog with non-constant timestamps multiplicities '%u != %u'\n", stride, thisStride );
575 for (
UINT4 X = 0; X < numIFOs; X ++ ) {
620 ncol = sscanf( flines->
lines->
tokens[0],
"%lf %lf %lf %lf", &col[0], &col[1], &col[2], &col[3] );
627 XLALPrintError(
"\n%s: WARNING: segment file '%s' is in DEPRECATED 4-column format (startGPS endGPS duration NumSFTs, duration is ignored)\n",
__func__, fname );
638 for (
UINT4 iSeg = 0; iSeg < numSegments; iSeg ++ ) {
647 XLAL_CHECK_NULL( ret == 2,
XLAL_EIO,
"%s: number of columns in segment file '%s' is inconsistent (line 1: %i, line %u: %i)",
__func__, fname, ncol, iSeg + 1, ret );
651 XLAL_CHECK_NULL( ret == 3,
XLAL_EIO,
"%s: number of columns in segment file '%s' is inconsistent (line 1: %i, line %u: %i)",
__func__, fname, ncol, iSeg + 1, ret );
652 XLAL_CHECK_NULL( NumSFTs > 0,
XLAL_EIO,
"%s: number of SFTs (3rd column) in segment file '%s' must be a positive integer if given (line %u: %i)",
__func__, fname, iSeg + 1, NumSFTs );
656 XLAL_CHECK_NULL( ret == 4,
XLAL_EIO,
"%s: number of columns in segment file '%s' is inconsistent (line 1 = %i, line %u = %i)",
__func__, fname, ncol, iSeg + 1, ret );
713 REAL8 analysisStartTime, analysisEndTime;
718 if ( overlapFraction != 0.0 ) {
736 else if ( synchronize ) {
746 analysisEndTime = round( floor( (
segEndTime - analysisStartTime -
Tsft ) / ( ( 1.0 - overlapFraction ) *
Tsft ) ) * ( 1.0 - overlapFraction ) *
Tsft ) +
Tsft + analysisStartTime;
755 REAL8 endTime = analysisStartTime;
756 while ( endTime < analysisEndTime ) {
760 endTime += ( 1.0 - overlapFraction ) *
Tsft;
762 if ( endTime <= analysisEndTime ) {
779 REAL8 analysisStartTime, analysisEndTime;
784 if ( overlapFraction != 0.0 ) {
802 else if ( synchronize ) {
812 analysisEndTime = round( floor( (
segEndTime - analysisStartTime -
Tsft ) / ( ( 1.0 - overlapFraction ) *
Tsft ) ) * ( 1.0 - overlapFraction ) *
Tsft ) +
Tsft + analysisStartTime;
821 REAL8 endTime = analysisStartTime;
822 while ( endTime < analysisEndTime ) {
826 endTime += ( 1.0 - overlapFraction ) *
Tsft;
828 if ( endTime <= analysisEndTime ) {
832 ret->
data[
j] = sftStart;
#define __func__
log an I/O error, i.e.
Internal SFT types and functions.
static const REAL8 fudge_down
int XLALReadSegmentsFromFile_support_4column_format
LIGOTimeGPSVector * timestamps
int XLALParseDataFile(LALParsedDataFile **cfgdata, const CHAR *fname)
void XLALDestroyParsedDataFile(LALParsedDataFile *cfgdata)
char * XLALGPSToStr(char *s, const LIGOTimeGPS *t)
#define LAL_GPS_PRINT(gps)
void * XLALCalloc(size_t m, size_t n)
void * XLALMalloc(size_t n)
void * XLALRealloc(void *p, size_t n)
LIGOTimeGPSVector * XLALMakeTimestamps(LIGOTimeGPS tStart, REAL8 Tspan, REAL8 Tsft, REAL8 Toverlap)
Given a start-time, Tspan, Tsft and Toverlap, returns a list of timestamps covering this time-stretch...
LIGOTimeGPSVector * XLALExtractTimestampsFromSFTs(const SFTVector *sfts)
Extract timstamps-vector from the given SFTVector.
MultiLIGOTimeGPSVector * XLALReadMultiTimestampsFilesConstrained(const LALStringVector *fnames, const LIGOTimeGPS *minGPS, const LIGOTimeGPS *maxGPS)
Load several timestamps files, return a MultiLIGOTimeGPSVector struct, allocated here.
MultiLIGOTimeGPSVector * XLALMakeMultiTimestamps(LIGOTimeGPS tStart, REAL8 Tspan, REAL8 Tsft, REAL8 Toverlap, UINT4 numDet)
Same as XLALMakeTimestamps() just for several detectors, additionally specify the number of detectors...
REAL8 TSFTfromDFreq(REAL8 dFreq)
int XLALFindTimesliceBounds(UINT4 *iStart, UINT4 *iEnd, const LIGOTimeGPSVector *timestamps, const LIGOTimeGPS *minStartGPS, const LIGOTimeGPS *maxStartGPS)
MultiLIGOTimeGPSVector * XLALTimestampsFromMultiSFTCatalogView(const MultiSFTCatalogView *multiView)
Given a multi-SFTCatalogView, return a MultiLIGOTimeGPSVector holding the SFT timestamps.
LALSegList * XLALReadSegmentsFromFile(const char *fname)
Function to read a segment list from given filename, returns a sorted LALSegList.
LIGOTimeGPSVector * XLALCreateTimestampVector(UINT4 len)
Allocate a LIGOTimeGPSVector.
LIGOTimeGPSVector * XLALResizeTimestampVector(LIGOTimeGPSVector *vector, UINT4 length)
Resize a LIGOTimeGPSVector.
LIGOTimeGPSVector * XLALTimestampsFromSegmentFile(const char *filename, REAL8 Tsft, REAL8 Toverlap, BOOLEAN adjustSegExtraTime, BOOLEAN synchronize)
Extract timestamps-vector from a segment file, with functionality based on MakeSFTDAG The filename sh...
MultiLIGOTimeGPSVector * XLALExtractMultiTimestampsFromSFTs(const MultiSFTVector *multiSFTs)
Given a multi-SFT vector, return a MultiLIGOTimeGPSVector holding the SFT timestamps.
LIGOTimeGPSVector * XLALReadTimestampsFile(const CHAR *fname)
backwards compatible wrapper to XLALReadTimestampsFileConstrained() without GPS-time constraints
int XLALCWGPSinRange(const LIGOTimeGPS gps, const LIGOTimeGPS *minGPS, const LIGOTimeGPS *maxGPS)
Defines the official CW convention for whether a GPS time is 'within' a given range,...
void XLALDestroyMultiTimestamps(MultiLIGOTimeGPSVector *multiTS)
Destroy a MultiLIGOTimeGPSVector timestamps vector.
MultiLIGOTimeGPSVector * XLALCreateMultiLIGOTimeGPSVector(UINT4 numDetectors)
Simple creator function for MultiLIGOTimeGPSVector with numDetectors entries.
void XLALDestroyTimestampVector(LIGOTimeGPSVector *vect)
De-allocate a LIGOTimeGPSVector.
MultiLIGOTimeGPSVector * XLALReadMultiTimestampsFiles(const LALStringVector *fnames)
backwards compatible wrapper to XLALReadMultiTimestampsFilesConstrained() without GPS-time constraint...
LIGOTimeGPSVector * XLALReadTimestampsFileConstrained(const CHAR *fname, const LIGOTimeGPS *minGPS, const LIGOTimeGPS *maxGPS)
Load timestamps file 'fname' into LIGOTimeGPSVector struct, allocated here.
LIGOTimeGPSVector * XLALTimestampsFromSFTCatalog(const SFTCatalog *catalog)
Extract timestamps-vector of unique timestamps from the given SFTCatalog.
int XLALSegListInit(LALSegList *seglist)
int XLALSegListSort(LALSegList *seglist)
int XLALSegListFree(LALSegList *seglist)
int XLALSegListAppend(LALSegList *seglist, const LALSeg *seg)
int XLALSegSet(LALSeg *seg, const LIGOTimeGPS *start, const LIGOTimeGPS *end, const INT4 id)
#define XLAL_ERROR_NULL(...)
int int int XLALPrintInfo(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_CHECK(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_CHECK_NULL(assertion,...)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
int XLALGPSCmp(const LIGOTimeGPS *t0, const LIGOTimeGPS *t1)
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
A vector of COMPLEX8FrequencySeries.
COMPLEX8FrequencySeries * data
Pointer to the data array.
UINT4 length
Number of elements in array.
A vector of 'timestamps' of type LIGOTimeGPS.
REAL8 deltaT
'length' of each timestamp (e.g.
LIGOTimeGPS * data
array of timestamps
UINT4 length
number of timestamps
A collection of (multi-IFO) LIGOTimeGPSVector time-stamps vectors.
UINT4 length
number of timestamps vectors or ifos
LIGOTimeGPSVector ** data
timestamps vector for each ifo
A multi-SFT-catalogue "view": a multi-IFO vector of SFT-catalogs.
SFTCatalog * data
array of SFT-catalog pointers
UINT4 length
number of detectors
A collection of SFT vectors – one for each IFO in a multi-IFO search.
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
SFTtype header
SFT-header info.