Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-8a6b96f
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Header CWMakeFakeData.h

Detailed Description

Module for generating 'fake' data containing CW signals and/or Gaussian noise. This basically presents a high-level wrapper API to the lower-level CW signal-generation functions in lalsuite.

Author
Reinhard Prix, Karl Wette

Prototypes

int XLALCWMakeFakeMultiData (MultiSFTVector **multiSFTs, MultiREAL8TimeSeries **multiTseries, const PulsarParamsVector *injectionSources, const CWMFDataParams *dataParams, const EphemerisData *edat)
 Generate fake 'CW' data, returned either as SFTVector or REAL4Timeseries or both, for given CW-signal ("pulsar") parameters and output parameters (frequency band etc) More...
 
int XLALCWMakeFakeData (SFTVector **SFTvect, REAL8TimeSeries **Tseries, const PulsarParamsVector *injectionSources, const CWMFDataParams *dataParams, UINT4 detectorIndex, const EphemerisData *edat)
 Single-IFO version of XLALCWMakeFakeMultiData(), handling the actual work, but same input API. More...
 
REAL4TimeSeriesXLALGenerateCWSignalTS (const PulsarParams *pulsarParams, const LALDetector *site, LIGOTimeGPS startTime, REAL8 duration, REAL8 fSamp, REAL8 fHet, const EphemerisData *edat, REAL8 sourceDeltaT)
 Generate a (heterodyned) REAL4 timeseries of a CW signal for given pulsarParams, site, start-time, duration, and sampling-rate. More...
 
SFTVectorXLALMakeSFTsFromREAL8TimeSeries (const REAL8TimeSeries *timeseries, const LIGOTimeGPSVector *timestamps, const char *windowType, REAL8 windowParam)
 Make SFTs from given REAL8TimeSeries at given timestamps, potentially applying a time-domain window on each timestretch first. More...
 
int XLALFindSmallestValidSamplingRate (UINT4 *n1, UINT4 n0, const LIGOTimeGPSVector *timestamps)
 Find the smallest sampling rate of the form fsamp = n / Tsft, with n>=n0, such that all gap sizes Dt_i between SFTs of the given timestamps are also exactly resolved, ie. More...
 
static UINT4 gcd (UINT4 numer, UINT4 denom)
 
PulsarParamsVectorXLALCreatePulsarParamsVector (UINT4 numPulsars)
 Create zero-initialized PulsarParamsVector for numPulsars. More...
 
void XLALDestroyPulsarParamsVector (PulsarParamsVector *ppvect)
 Destructor for PulsarParamsVector type. More...
 
int XLALReadPulsarParams (PulsarParams *pulsarParams, LALParsedDataFile *cfgdata, const CHAR *secName, const LIGOTimeGPS *refTimeDef)
 Function to parse a config-file-type string (or section thereof) into a PulsarParams struct. More...
 
PulsarParamsVectorXLALPulsarParamsFromFile (const char *fname, const LIGOTimeGPS *refTimeDef)
 Parse a given 'CWsources' config file for PulsarParams, return vector of all pulsar definitions found [using sections]. More...
 
int XLALCheckConfigFileWasFullyParsed (const char *fname, const LALParsedDataFile *cfgdata)
 
PulsarParamsVectorXLALPulsarParamsFromUserInput (const LALStringVector *UserInput, const LIGOTimeGPS *refTimeDef)
 Function to determine the PulsarParamsVector input from a user-input defining CW sources. More...
 
PulsarParamsVectorXLALPulsarParamsVectorAppend (PulsarParamsVector *list, const PulsarParamsVector *add)
 Append the given PulsarParamsVector 'add' to the vector 'list' ( which can be NULL), return resulting list with new elements 'add' appended at the end of 'list'. More...
 
int XLALFITSWritePulsarParamsVector (FITSFile *file, const CHAR *tableName, const PulsarParamsVector *list)
 Write a PulsarParamsVector to a FITS file. More...
 
void XLALDestroyCWMFDataParams (CWMFDataParams *params)
 Destructor for a CWMFDataParams type. More...
 

Data Structures

struct  PulsarParamsVector
 Straightforward vector type of N PulsarParams structs. More...
 
struct  CWMFDataParams
 Struct controlling all the aspects of the fake data (time-series + SFTs) to be produced by XLALCWMakeFakeData() and XLALCWMakeFakeMultiData() More...
 

Macros

#define SQ(x)   ( (x) * (x) )
 Functions to generate 'fake' data containing CW signals and/or Gaussian noise. These basically present a high-level wrapper API to the lower-level CW signal-generation functions in lalsuite. More...
 

Variables

const char *const InjectionSourcesHelpString
 

Function Documentation

◆ XLALCWMakeFakeMultiData()

int XLALCWMakeFakeMultiData ( MultiSFTVector **  multiSFTs,
MultiREAL8TimeSeries **  multiTseries,
const PulsarParamsVector injectionSources,
const CWMFDataParams dataParams,
const EphemerisData edat 
)

Generate fake 'CW' data, returned either as SFTVector or REAL4Timeseries or both, for given CW-signal ("pulsar") parameters and output parameters (frequency band etc)

Parameters
[out]multiSFTspointer to optional SFT-vector for output
[out]multiTseriespointer to optional timeseries-vector for output
[in]injectionSources(optional) array of sources inject
[in]dataParamsparameters specifying the type of data to generate
[in]edatephemeris data

Definition at line 90 of file CWMakeFakeData.c.

◆ XLALCWMakeFakeData()

int XLALCWMakeFakeData ( SFTVector **  SFTvect,
REAL8TimeSeries **  Tseries,
const PulsarParamsVector injectionSources,
const CWMFDataParams dataParams,
UINT4  detectorIndex,
const EphemerisData edat 
)

Single-IFO version of XLALCWMakeFakeMultiData(), handling the actual work, but same input API.

The 'detectorIndex' has the index of the detector to be used from the multi-IFO arrays.

Definition at line 165 of file CWMakeFakeData.c.

◆ XLALGenerateCWSignalTS()

REAL4TimeSeries * XLALGenerateCWSignalTS ( const PulsarParams pulsarParams,
const LALDetector site,
LIGOTimeGPS  startTime,
REAL8  duration,
REAL8  fSamp,
REAL8  fHet,
const EphemerisData edat,
REAL8  sourceDeltaT 
)

Generate a (heterodyned) REAL4 timeseries of a CW signal for given pulsarParams, site, start-time, duration, and sampling-rate.

NOTE: this is mostly an API-wrapper to the more 'old-style' function XLALGeneratePulsarSignal() [which will become deprecated in the future], extended for the option to generate transient-CW signals

Parameters
pulsarParamsinput CW pulsar-signal parameters
sitedetector
startTimetime-series start-time GPS
durationtime-series duration to generate
fSampsampling frequency
fHetheterodyning frequency
edatephemeris data
sourceDeltaTsource-frame sampling period (optional: 0 == previous internal defaults)

Definition at line 396 of file CWMakeFakeData.c.

◆ XLALMakeSFTsFromREAL8TimeSeries()

SFTVector * XLALMakeSFTsFromREAL8TimeSeries ( const REAL8TimeSeries timeseries,
const LIGOTimeGPSVector timestamps,
const char windowType,
REAL8  windowParam 
)

Make SFTs from given REAL8TimeSeries at given timestamps, potentially applying a time-domain window on each timestretch first.

Parameters
timeseriesinput time-series
timestampstimestamps to produce SFTs for (can be NULL), if given must all lies within timeseries' time-span
windowTypeoptional time-domain window function to apply before FFTing
windowParamwindow parameter, if any

Definition at line 480 of file CWMakeFakeData.c.

◆ XLALFindSmallestValidSamplingRate()

int XLALFindSmallestValidSamplingRate ( UINT4 n1,
UINT4  n0,
const LIGOTimeGPSVector timestamps 
)

Find the smallest sampling rate of the form fsamp = n / Tsft, with n>=n0, such that all gap sizes Dt_i between SFTs of the given timestamps are also exactly resolved, ie.

that Dt_i * fsamp = integer, for all i

The smallest allowed sampling rate is the user-specified fsamp0 = n0 / Tsft, which guarantees by construction that fSamp0 * Tsft = n0 = integer This sampling rate would be valid if there are no gaps between SFTs, so it's only in cases of gaps that are non-integer multiples of Tsft that we'll (potentially) have to increase the sampling rate.

NOTE: This approach replaces the old mfdv4 habit of 'nudging' noise SFTs start-times to fall on integer timesteps of the fsamp0 timeseries. The purpose of this function is to avoid this behaviour, by appropriately increasing the sampling rate as required.

NOTE2: we only allow integer-second gaps, everything else will be rejected with an error-message.

NOTE3: Tsft=timestamps->deltaT must be integer seconds, everything else is rejected with an error as well

Definition at line 620 of file CWMakeFakeData.c.

◆ gcd()

static UINT4 gcd ( UINT4  numer,
UINT4  denom 
)
static

Definition at line 704 of file CWMakeFakeData.c.

◆ XLALCreatePulsarParamsVector()

PulsarParamsVector * XLALCreatePulsarParamsVector ( UINT4  numPulsars)

Create zero-initialized PulsarParamsVector for numPulsars.

Definition at line 722 of file CWMakeFakeData.c.

◆ XLALDestroyPulsarParamsVector()

void XLALDestroyPulsarParamsVector ( PulsarParamsVector ppvect)

Destructor for PulsarParamsVector type.

Definition at line 740 of file CWMakeFakeData.c.

◆ XLALReadPulsarParams()

int XLALReadPulsarParams ( PulsarParams pulsarParams,
LALParsedDataFile cfgdata,
const CHAR secName,
const LIGOTimeGPS refTimeDef 
)

Function to parse a config-file-type string (or section thereof) into a PulsarParams struct.

NOTE: The section-name is optional, and can be given as NULL, in which case the top of the file (ie the "default section") is used.

NOTE2: eventually ATNF/TEMPO2-style 'par-file' variables will also be understood by this function, but we start out with a simpler version that just deals with our 'CW-style' input variable for now

NOTE3: The config-file must be of a special "SourceParamsIO" form, defining the following required and optional parameters:

REQUIRED: Alpha, Delta, Freq, refTime (unless refTimeDef != NULL)

OPTIONAL: f1dot, f2dot, f3dot, f4dot, f5dot, f6dot {h0, cosi} or {aPlus, aCross}, psi, phi0 transientWindowType, transientStartTime, transientTau

Other config-variables found in the file will ... ?? error or accept?

Parameters
[out]pulsarParamspulsar parameters to fill in from config string
[in]cfgdatapre-parsed "SourceParamsIO" config-file contents
[in]secNamesection-name to use from config-file string (can be NULL)
[in]refTimeDefdefault reference time if refTime is not given

Definition at line 782 of file CWMakeFakeData.c.

◆ XLALPulsarParamsFromFile()

PulsarParamsVector * XLALPulsarParamsFromFile ( const char fname,
const LIGOTimeGPS refTimeDef 
)

Parse a given 'CWsources' config file for PulsarParams, return vector of all pulsar definitions found [using sections].

Parameters
[in]fname'CWsources' config file name
[in]refTimeDefdefault reference time if refTime is not given

Definition at line 992 of file CWMakeFakeData.c.

◆ XLALCheckConfigFileWasFullyParsed()

int XLALCheckConfigFileWasFullyParsed ( const char fname,
const LALParsedDataFile cfgdata 
)

Definition at line 1036 of file CWMakeFakeData.c.

◆ XLALPulsarParamsFromUserInput()

PulsarParamsVector * XLALPulsarParamsFromUserInput ( const LALStringVector UserInput,
const LIGOTimeGPS refTimeDef 
)

Function to determine the PulsarParamsVector input from a user-input defining CW sources.

This option supports a dual-type feature: if any string in the list is of the form '{...}', then it determines the contents of a config-file, otherwise the name-pattern of config-files to be parsed by XLALFindFiles(), NOTE: when specifying file-contents, options can be separated by ';' and/or newlines)

Parameters
[in]UserInputuser-input CSV list defining 'CW sources'
[in]refTimeDefdefault reference time if refTime is not given

Definition at line 1065 of file CWMakeFakeData.c.

◆ XLALPulsarParamsVectorAppend()

PulsarParamsVector * XLALPulsarParamsVectorAppend ( PulsarParamsVector list,
const PulsarParamsVector add 
)

Append the given PulsarParamsVector 'add' to the vector 'list' ( which can be NULL), return resulting list with new elements 'add' appended at the end of 'list'.

Definition at line 1129 of file CWMakeFakeData.c.

◆ XLALFITSWritePulsarParamsVector()

int XLALFITSWritePulsarParamsVector ( FITSFile file,
const CHAR tableName,
const PulsarParamsVector list 
)

Write a PulsarParamsVector to a FITS file.

Definition at line 1159 of file CWMakeFakeData.c.

◆ XLALDestroyCWMFDataParams()

void XLALDestroyCWMFDataParams ( CWMFDataParams params)

Destructor for a CWMFDataParams type.

Note
: This is mostly useful for the SWIG wrappers

Definition at line 1208 of file CWMakeFakeData.c.

Macro Definition Documentation

◆ SQ

#define SQ (   x)    ( (x) * (x) )

Functions to generate 'fake' data containing CW signals and/or Gaussian noise. These basically present a high-level wrapper API to the lower-level CW signal-generation functions in lalsuite.

Author
Reinhard Prix

Definition at line 52 of file CWMakeFakeData.c.

Variable Documentation

◆ InjectionSourcesHelpString

const char* const InjectionSourcesHelpString
extern

Definition at line 58 of file CWMakeFakeData.c.