41 #include <lal/LALStdlib.h>
42 #include <lal/LALConstants.h>
43 #include <lal/AVFactories.h>
44 #include <lal/SeqFactories.h>
45 #include <lal/StringVector.h>
47 #include <lal/Segments.h>
48 #include <lal/DetectorSite.h>
49 #include <lal/SkyCoordinates.h>
50 #include <lal/LALRunningMedian.h>
51 #include <lal/RngMedBias.h>
52 #include <lal/UserInputParse.h>
53 #include <lal/PulsarDataTypes.h>
179 typedef struct tagMultiSFTVector {
188 typedef struct tagLIGOTimeGPSVector {
198 typedef struct tagMultiLIGOTimeGPSVector {
212 typedef struct tagSFTConstraints {
224 SWIGLAL( IMMUTABLE_MEMBERS( tagSFTDescriptor,
window_type ) );
226 typedef struct tagSFTDescriptor {
238 typedef struct tagSFTCatalog {
255 typedef struct tagMultiSFTCatalogView {
266 typedef struct tagSFTFilenameSpec {
LIGOTimeGPSVector * timestamps
int XLALSFTVectorResizeBand(SFTVector *SFTs, REAL8 f0, REAL8 Band)
Resize the frequency-band of a given SFT vector to [f0, f0+Band].
SFTtype * XLALCreateSFT(UINT4 numBins)
XLAL function to create one SFT-struct.
SFTVector * XLALDuplicateSFTVector(const SFTVector *sftsIn)
Create a complete copy of an SFT vector.
const LALDetector * XLALGetSiteInfo(const CHAR *name)
Find the site geometry-information 'LALDetector' for given a detector name (or prefix).
int XLALRegisterSpecialCWDetector(const LALDetector *specialDetector)
Register a special detector for use with CW codes.
void XLALDestroySFTVector(SFTVector *vect)
XLAL interface to destroy an SFTVector.
void XLALDestroySFTCatalog(SFTCatalog *catalog)
Free an 'SFT-catalogue'.
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...
MultiSFTVector * XLALLoadMultiSFTs(const SFTCatalog *inputCatalog, REAL8 fMin, REAL8 fMax)
Function to load a catalog of SFTs from possibly different detectors.
void XLALDestroyMultiSFTCatalogView(MultiSFTCatalogView *multiView)
Destroys a MultiSFTCatalogView, without freeing the original catalog that the 'view' was referring to...
COMPLEX8FrequencySeries SFTtype
A so-called 'SFT' (short-Fourier-transform) will be stored in a COMPLEX8FrequencySeries.
int XLALSFTVectorAdd(SFTVector *a, const SFTVector *b)
Adds SFT-data from SFTvector 'b' to elements of SFTVector 'a'.
void XLALDestroyMultiSFTVector(MultiSFTVector *multvect)
Destroy a multi SFT-vector.
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...
MultiSFTVector * XLALExtractStrictBandFromMultiSFTVector(const MultiSFTVector *inSFTs, REAL8 fMin, REAL8 Band)
Return a copy of a MultiSFT vector containing only the bins in [fMin, fMin+Band).
COMPLEX8FrequencySeriesVector SFTVector
The corresponding vector-type to hold a vector of 'SFTs'.
CHAR * XLALGetChannelPrefix(const CHAR *name)
Find the valid CW detector prefix.
SFTCatalog * XLALMultiAddToFakeSFTCatalog(SFTCatalog *catalog, const LALStringVector *detectors, const MultiLIGOTimeGPSVector *timestamps)
Multi-detector and multi-timestamp wrapper of XLALAddToFakeSFTCatalog().
SFTCatalog * XLALReturnSFTCatalogTimeslice(const SFTCatalog *catalog, const LIGOTimeGPS *minStartGPS, const LIGOTimeGPS *maxStartGPS)
int XLALExtractBandFromSFT(SFTtype **outSFT, const SFTtype *inSFT, REAL8 fMin, REAL8 Band)
Return an SFTs containing only the bins in [fMin, fMin+Band].
MultiSFTVector * XLALExtractBandFromMultiSFTVector(const MultiSFTVector *inSFTs, REAL8 fMin, REAL8 Band)
Return a MultiSFT vector containing only the bins in [fMin, fMin+Band].
int XLALExtractStrictBandFromSFT(SFTtype **outSFT, const SFTtype *inSFT, REAL8 fMin, REAL8 Band)
Return a copy of an SFT containing only the bins in [fMin, fMin+Band).
int XLALCheckCRCSFTCatalog(BOOLEAN *crc_check, SFTCatalog *catalog)
This function reads in the SFTs in the catalog and validates their CRC64 checksums.
MultiSFTCatalogView * XLALGetMultiSFTCatalogView(const SFTCatalog *catalog)
Return a MultiSFTCatalogView generated from an input SFTCatalog.
int XLALFindCoveringSFTBins(UINT4 *firstBin, UINT4 *numBins, REAL8 fMinIn, REAL8 BandIn, REAL8 Tsft)
Return the 'effective' frequency-band [fMinEff, fMaxEff] = [firstBin, lastBin] * 1/Tsft,...
int XLALMultiSFTVectorResizeBand(MultiSFTVector *multiSFTs, REAL8 f0, REAL8 Band)
Resize the frequency-band of a given multi-SFT vector to [f0, f0+Band].
int XLALFindTimesliceBounds(UINT4 *iStart, UINT4 *iEnd, const LIGOTimeGPSVector *timestamps, const LIGOTimeGPS *minStartGPS, const LIGOTimeGPS *maxStartGPS)
LALStringVector * XLALFindFiles(const CHAR *globstring)
Returns a list of filenames matching the input argument, which may be one of the following:
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...
int XLALSFTResizeBand(SFTtype *SFT, REAL8 f0, REAL8 Band)
Resize the frequency-band of a given SFT to [f0, f0+Band].
int XLALWriteSFT2FilePointer(const SFTtype *sft, FILE *fp, const CHAR *SFTwindowtype, const REAL8 SFTwindowparam, const CHAR *SFTcomment)
Write the given SFTtype to a FILE pointer.
int XLALAppendSFT2Vector(SFTVector *vect, const SFTtype *sft)
Append the given SFTtype to the SFT-vector (no SFT-specific checks are done!)
SFTVector * XLALCreateEmptySFTVector(UINT4 numSFTs)
XLAL function to create an SFTVector of numSFT SFTs (which are not allocated).
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.
MultiSFTVector * XLALExtractMultiSFTVectorWithMultiTimestamps(const MultiSFTVector *multiSFTs, const MultiLIGOTimeGPSVector *multiTimestamps)
Extract a MultiSFTVector from another MultiSFTVector but only those timestamps matching.
LIGOTimeGPSVector * XLALCreateTimestampVector(UINT4 len)
Allocate a LIGOTimeGPSVector.
LALStringVector * XLALListIFOsInCatalog(const SFTCatalog *catalog)
Return a sorted string vector listing the unique IFOs in the given catalog.
MultiSFTVector * XLALReadSFDB(REAL8 f_min, REAL8 f_max, const CHAR *file_pattern, const CHAR *timeStampsStarting, const CHAR *timeStampsFinishing)
Return a MultiSFTVector struct from an input set of SFDBs, possibly from more than one detector.
MultiSFTVector * XLALLoadMultiSFTsFromView(const MultiSFTCatalogView *multiCatalogView, REAL8 fMin, REAL8 fMax)
This function loads a MultiSFTVector from a given input MultiSFTCatalogView, otherwise the documentat...
int XLALSFTAdd(SFTtype *a, const SFTtype *b)
Adds SFT-data from SFT 'b' to SFT 'a'.
int XLALCompareSFTWindows(const CHAR *type1, const REAL8 param1, const CHAR *type2, const REAL8 param2)
Check whether two SFT windows, each defined by a type name and parameter value, match.
char * XLALBuildSFTFilenameFromSpec(const SFTFilenameSpec *spec)
Build an SFT file name from the given specification.
int XLALCopySFT(SFTtype *dest, const SFTtype *src)
Copy an entire SFT-type into another.
UINT4 XLALRoundFrequencyUpToSFTBin(const REAL8 freq, const REAL8 df)
Round a REAL8 frequency up to the nearest integer SFT bin number.
SFTCatalog * XLALAddToFakeSFTCatalog(SFTCatalog *catalog, const CHAR *detector, const LIGOTimeGPSVector *timestamps)
Create a 'fake' SFT catalog which contains only detector and timestamp information.
LIGOTimeGPSVector * XLALResizeTimestampVector(LIGOTimeGPSVector *vector, UINT4 length)
Resize a LIGOTimeGPSVector.
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...
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...
MultiSFTVector * XLALCreateEmptyMultiSFTVector(UINT4Vector *numsft)
Create an empty multi-IFO SFT vector with a given number of SFTs per IFO (which are not allocated).
int XLALLatestMultiSFTsample(LIGOTimeGPS *out, const MultiSFTVector *multisfts)
Find the time of the end of the latest SFT in a multi-SFT data structure.
int XLALFindCWDetector(CHAR **prefix, INT4 *lalCachedIndex, const CHAR *name, const BOOLEAN exactMatch)
Parses valid CW detector names and prefixes.
UINT4 XLALRoundFrequencyDownToSFTBin(const REAL8 freq, const REAL8 df)
Round a REAL8 frequency down to the nearest integer SFT bin number.
SFTCatalog * XLALSFTdataFind(const CHAR *file_pattern, const SFTConstraints *constraints)
Find the list of SFTs matching the file_pattern and satisfying the given constraints,...
const CHAR * XLALshowSFTLocator(const struct tagSFTLocator *locator)
Mostly for debugging purposes: provide a user-API to allow inspecting the SFT-locator [which is an OP...
void XLALDestroySFT(SFTtype *sft)
Destructor for one SFT.
int XLALReorderMultiSFTVector(MultiSFTVector *multiSFTs, const LALStringVector *IFOs)
Reorder the MultiSFTVector with specified list of IFOs.
int XLALCheckValidDescriptionField(const char *desc)
Check whether given string qualifies as a valid 'description' field of a FRAME filename (per ) or SFT...
int XLALWriteSFTVector2NamedFile(const SFTVector *sftVect, const CHAR *SFTfilename, const CHAR *SFTwindowtype, const REAL8 SFTwindowparam, const CHAR *SFTcomment)
Write the given SFTVector to a single merged SFT file with the supplied filename.
MultiLIGOTimeGPSVector * XLALExtractMultiTimestampsFromSFTs(const MultiSFTVector *multiSFTs)
Given a multi-SFT vector, return a MultiLIGOTimeGPSVector holding the SFT timestamps.
int XLALMultiSFTVectorAdd(MultiSFTVector *a, const MultiSFTVector *b)
Adds SFT-data from MultiSFTvector 'b' to elements of MultiSFTVector 'a'.
int XLALWriteSFTVector2StandardFile(const SFTVector *sftVect, SFTFilenameSpec *SFTfnspec, const CHAR *SFTcomment, const BOOLEAN merged)
Write the given SFTVector to SFT file(s) with a standard () filename(s).
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,...
int XLALWriteSFT2StandardFile(const SFTtype *sft, SFTFilenameSpec *SFTfnspec, const CHAR *SFTcomment)
Write the given SFTtype to a SFT file with a standard () filename.
int XLALParseSFTFilenameIntoSpec(SFTFilenameSpec *spec, const char *SFTpath)
Parse a SFT file path and return its specification.
int XLALWriteSFT2NamedFile(const SFTtype *sft, const CHAR *SFTfilename, const CHAR *SFTwindowtype, const REAL8 SFTwindowparam, const CHAR *SFTcomment)
Write the given SFTtype to a SFT file with the supplied filename.
void XLALDestroyMultiTimestamps(MultiLIGOTimeGPSVector *multiTS)
Destroy a MultiLIGOTimeGPSVector timestamps vector.
MultiLIGOTimeGPSVector * XLALCreateMultiLIGOTimeGPSVector(UINT4 numDetectors)
Simple creator function for MultiLIGOTimeGPSVector with numDetectors entries.
SFTVector * XLALCreateSFTVector(UINT4 numSFTs, UINT4 numBins)
XLAL function to create an SFTVector of numSFT SFTs with SFTlen frequency-bins (which will be allocat...
int XLALSFTCatalogTimeslice(SFTCatalog *slice, const SFTCatalog *catalog, const LIGOTimeGPS *minStartGPS, const LIGOTimeGPS *maxStartGPS)
Set a SFT catalog 'slice' to a timeslice of a larger SFT catalog 'catalog', with entries restricted t...
int XLALFillSFTFilenameSpecStrings(SFTFilenameSpec *spec, const CHAR *path, const CHAR *extn, const CHAR *detector, const CHAR *window_type, const CHAR *privMisc, const CHAR *pubObsKind, const CHAR *pubChannel)
Convenience function for filling out the string fields in a SFTFilenameSpec.
SFTVector * XLALExtractBandFromSFTVector(const SFTVector *inSFTs, REAL8 fMin, REAL8 Band)
Return a vector of SFTs containing only the bins in [fMin, fMin+Band].
SFTVector * XLALExtractStrictBandFromSFTVector(const SFTVector *inSFTs, REAL8 fMin, REAL8 Band)
Return a copy of a vector of SFTs containing only the bins in [fMin, fMin+Band).
int XLALCheckSFTFileIsValid(const char *fname)
Verify that the contents of a SFT file are valid.
void XLALDestroyTimestampVector(LIGOTimeGPSVector *vect)
De-allocate a LIGOTimeGPSVector.
MultiLIGOTimeGPSVector * XLALReadMultiTimestampsFiles(const LALStringVector *fnames)
backwards compatible wrapper to XLALReadMultiTimestampsFilesConstrained() without GPS-time constraint...
INT4 XLALCountIFOsInCatalog(const SFTCatalog *catalog)
Count the number of the unique IFOs in the given catalog.
LIGOTimeGPSVector * XLALReadTimestampsFileConstrained(const CHAR *fname, const LIGOTimeGPS *minGPS, const LIGOTimeGPS *maxGPS)
Load timestamps file 'fname' into LIGOTimeGPSVector struct, allocated here.
int XLALEarliestMultiSFTsample(LIGOTimeGPS *out, const MultiSFTVector *multisfts)
Finds the earliest timestamp in a multi-SFT data structure.
SFTVector * XLALExtractSFTVectorWithTimestamps(const SFTVector *sfts, const LIGOTimeGPSVector *timestamps)
Extract an SFTVector from another SFTVector but only those timestamps matching.
BOOLEAN XLALIsValidCWDetector(const CHAR *name)
Determine if 'name' is a valid detector name or prefix.
LIGOTimeGPSVector * XLALTimestampsFromSFTCatalog(const SFTCatalog *catalog)
Extract timestamps-vector of unique timestamps from the given SFTCatalog.
A vector of COMPLEX8FrequencySeries.
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.
UINT4 length
number of ifos
SFTVector ** data
sftvector for each ifo
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
A 'descriptor' of an SFT: basically containing the header-info plus an opaque description of where ex...
SFTtype header
SFT-header info.
UINT4 version
SFT-specification version.
struct tagSFTLocator * locator
internal description of where to find this SFT [opaque!]
UINT4 numBins
number of frequency-bins in this SFT
UINT8 crc64
crc64 checksum
const char * window_type
window function applied to SFT
CHAR * comment
comment-entry in SFT-header
REAL8 window_param
parameter of window function, if required
Structure specifying an SFT file name, following the convention in .
UINT4 pubRevision
For public SFTs: revision number of SFT production.
UINT4 SFTtimebase
Timebase in seconds of the SFT; set by XLALWriteSFT[Vector]2StandardFile()
UINT4 SFTspan
Total time interval in seconds covered by SFT file; set by XLALWriteSFT[Vector]2StandardFile()
UINT4 nbBinWidthRem
For narrow-band SFTs: remainder of division of SFT bandwidth by SFT time base.
UINT4 gpsStart
GPS time in seconds at the beginning of the first SFT in the file; set by XLALWriteSFT[Vector]2Standa...
UINT4 nbBinWidthFreq
For narrow-band SFTs: SFT bandwidth divided by SFT time base, rounded down.
UINT4 nbFirstBinRem
For narrow-band SFTs: remainder of division of SFT first bin frequency by SFT time base.
UINT4 numSFTs
Number of SFTs in the file; set by XLALWriteSFT[Vector]2StandardFile()
UINT4 pubObsRun
For public SFTs: observing run number.
UINT4 nbFirstBinFreq
For narrow-band SFTs: SFT first bin frequency divided by SFT time base, rounded down.
REAL8 window_param
parameter of window function, if required