21 #ifndef _TRANSIENTCW_UTILS_H
22 #define _TRANSIENTCW_UTILS_H
31 #include <gsl/gsl_vector.h>
32 #include <gsl/gsl_matrix.h>
35 #include <lal/AVFactories.h>
36 #include <lal/LogPrintf.h>
37 #include <lal/SFTfileIO.h>
38 #include <lal/PulsarDataTypes.h>
39 #include <lal/ComputeFstat.h>
40 #include <lal/SinCosLUT.h>
41 #include <lal/FileIO.h>
42 #include <lal/ProbabilityDensity.h>
63 #define DAY24 (24 * 3600)
70 #define TRANSIENT_EXP_EFOLDING 3.0
75 typedef struct tagtransientWindowRange_t {
91 typedef struct tagtransientFstatMap_t {
100 typedef struct tagtransientCandidate_t {
161 if ( timestamp < t0 || timestamp >
t1 ) {
183 if ( timestamp < t0 || timestamp >
t1 ) {
186 REAL8 x = 1.0 * ( timestamp -
t0 ) / tau;
223 XLALPrintError(
"invalid transient window type %d not in [%d, %d].\n",
transientWindowType_t
Struct to define parameters of a 'transient window' to be applied to obtain transient signals.
@ TRANSIENT_RECTANGULAR
standard rectangular window covering [t0, t0+tau]
@ TRANSIENT_NONE
Note: in this case the window-parameters will be ignored, and treated as rect={data},...
@ TRANSIENT_EXPONENTIAL
exponentially decaying window e^{-t0/tau} starting at t0.
transientFstatMap_t * XLALComputeTransientFstatMap(const MultiFstatAtomVector *multiFstatAtoms, transientWindowRange_t windowRange, BOOLEAN useFReg)
Function to compute transient-window "F-statistic map" over start-time and timescale {t0,...
void XLALDestroyTransientFstatMap(transientFstatMap_t *FstatMap)
Standard destructor for transientFstatMap_t Fully NULL-robust as usual.
int XLALParseTransientWindowName(const char *windowName)
Parse a transient window name string into the corresponding transientWindowType.
int XLALApplyTransientWindow2NoiseWeights(MultiNoiseWeights *multiNoiseWeights, const MultiLIGOTimeGPSVector *multiTS, transientWindow_t transientWindow)
apply transient window to give multi noise-weights, associated with given multi timestamps
int write_transientCandidate_to_fp(LALFILE *fp, const transientCandidate_t *thisCand, const char timeUnit)
Write one line for given transient CW candidate into output file.
int XLALGetTransientWindowTimespan(UINT4 *t0, UINT4 *t1, transientWindow_t transientWindow)
Helper-function to determine the total timespan of a transient CW window, ie.
FstatAtomVector * XLALmergeMultiFstatAtomsBinned(const MultiFstatAtomVector *multiAtoms, UINT4 deltaT)
Combine N Fstat-atoms vectors into a single 'canonical' binned and ordered atoms-vector.
void XLALDestroyExpLUT(void)
Destructor function for expLUT_t lookup table.
REAL8 XLALFastNegExp(REAL8 mx)
Fast exponential function e^-x using lookup-table (LUT).
int write_MultiFstatAtoms_to_fp(LALFILE *fp, const MultiFstatAtomVector *multiAtoms)
Write multi-IFO F-stat atoms 'multiAtoms' into output stream 'fstat'.
CHAR * XLALPulsarDopplerParams2String(const PulsarDopplerParams *par)
Turn pulsar doppler-params into a single string that can be used for filenames The format is tRefNNNN...
int write_transientCandidateAll_to_fp(LALFILE *fp, const transientCandidate_t *thisCand)
Write full set of t0 and tau grid points for given transient CW candidate into output file.
static REAL8 XLALGetTransientWindowValue(UINT4 timestamp, UINT4 t0, UINT4 t1, UINT4 tau, transientWindowType_t type)
Function to compute the value of a given transient-window function at a given timestamp.
int XLALApplyTransientWindow(REAL4TimeSeries *series, transientWindow_t transientWindow)
apply a "transient CW window" described by TransientWindowParams to the given timeseries
pdf1D_t * XLALComputeTransientPosterior_t0(transientWindowRange_t windowRange, const transientFstatMap_t *FstatMap)
Compute transient-CW posterior (normalized) on start-time t0, using given type and parameters of tran...
static REAL8 XLALGetExponentialTransientWindowValue(UINT4 timestamp, UINT4 t0, UINT4 t1, UINT4 tau)
Function to compute the value of an exponential transient-window at a given timestamp.
static REAL8 XLALGetRectangularTransientWindowValue(UINT4 timestamp, UINT4 t0, UINT4 t1)
Function to compute the value of a rectangular transient-window at a given timestamp.
pdf1D_t * XLALComputeTransientPosterior_tau(transientWindowRange_t windowRange, const transientFstatMap_t *FstatMap)
Compute transient-CW posterior (normalized) on timescale tau, using given type and parameters of tran...
REAL8 XLALComputeTransientBstat(transientWindowRange_t windowRange, const transientFstatMap_t *FstatMap)
Compute transient-CW Bayes-factor B_SG = P(x|HypS)/P(x|HypG) (where HypG = Gaussian noise hypothesis)...
void XLALDestroyTransientCandidate(transientCandidate_t *cand)
Standard destructor for transientCandidate_t Fully NULL-robust as usual.
int write_transientFstatMap_to_fp(LALFILE *fp, const transientFstatMap_t *FstatMap, const transientWindowRange_t *windowRange, const PulsarDopplerParams *doppler)
Write full set of t0 and tau grid points (assumed at fixed Doppler parameters) into output file.
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
A vector of -statistic 'atoms', i.e.
A multi-detector vector of FstatAtomVector.
A collection of (multi-IFO) LIGOTimeGPSVector time-stamps vectors.
One noise-weight (number) per SFT (therefore indexed over IFOs and SFTs.
Type containing the 'Doppler-parameters' affecting the time-evolution of the phase.
Struct holding a transient CW candidate.
transientFstatMap_t * FstatMap
F-statistic over transient-window range {t0, tau} AND ML-estimators { Fmax, t0_Fmax,...
REAL8 t0_MP
maximum-posterior estimate for t0
PulsarDopplerParams doppler
Doppler params of this 'candidate'.
REAL8 tau_MP
maximum-posterior estimate for tau
REAL8 logBstat
log of Bayes-factor, marginalized over transientWindowRange
transientWindowRange_t windowRange
type and parameters specifying the transient window range in {t0, tau} covered
Struct holding a transient-window "F-statistic map" over start-time and timescale {t0,...
gsl_matrix * F_mn
"payload" F-map: F_mn for t0_m = t0 + m*dt0, and tau_n = tau + n*dtau
UINT4 tau_ML
maximum-likelihood estimator for duration Tcoh of max{2F} over the transientWindowRange (in seconds)
UINT4 t0_ML
maximum-likelihood estimator for start-time t0 of max{2F} over transientWindowRange (in GPS seconds)
REAL8 maxF
maximal F-value obtained over transientWindowRange
Struct defining one transient window instance.
Struct defining a range of transient windows.
UINT4 tauBand
range of transient timescales tau to search, in seconds
UINT4 dtau
stepsize to search tau-range with, in seconds
UINT4 tau
shortest transient timescale tau in seconds
UINT4 t0
earliest GPS start-time 't0' in seconds
UINT4 dt0
stepsize to search t0-range with, in seconds
transientWindowType_t type
window-type: none, rectangular, exponential, ....
UINT4 t0Band
range of start-times 't0' to search, in seconds