LALPulsar  6.1.0.1-89842e6
HierarchSearchGCT.c File Reference

Hierarchical semicoherent CW search code based on F-Statistic, exploiting global-correlation coordinates (Phys.Rev.Lett. 103, 181102, 2009) More...

Prototypes

void SetUpSFTs (LALStatus *status, UsefulStageVariables *in)
 Set up stacks, read SFTs, calculate SFT noise weights and calculate detector-state. More...
 
void PrintFstatVec (LALStatus *status, FstatResults *in, FILE *fp, PulsarDopplerParams *thisPoint, LIGOTimeGPS refTime, INT4 stackIndex)
 Print Fstat vectors. More...
 
void PrintCatalogInfo (LALStatus *status, const SFTCatalog *catalog, FILE *fp)
 Print some sft catalog info. More...
 
void PrintStackInfo (LALStatus *status, const SFTCatalogSequence *catalogSeq, FILE *fp)
 Print some stack info from sft catalog sequence. More...
 
void UpdateSemiCohToplists (LALStatus *status, toplist_t *list1, toplist_t *list2, toplist_t *list3, FineGrid *in, REAL8 f1dot_fg, REAL8 f2dot_fg, REAL8 f3dot_fg, UsefulStageVariables *usefulparams, REAL4 NSegmentsInv, REAL4 *NSegmentsInvX, BOOLEAN have_f3dot)
 Get SemiCoh candidates into toplist(s) This function allows for inserting candidates into up to 3 toplists at once, which might be sorted differently! More...
 
void UpdateSemiCohToplistsOptimTriple (LALStatus *status, SortBy_t toplists_sortby, toplist_t *list1, toplist_t *list2, toplist_t *list3, FineGrid *in, REAL8 f1dot_fg, REAL8 f2dot_fg, REAL8 f3dot_fg, UsefulStageVariables *usefulparams, REAL4 NSegmentsInv, REAL4 *NSegmentsInvX, BOOLEAN have_f3dot)
 Get SemiCoh candidates into toplist(s) This function allows for inserting candidates into up to 3 toplists at once, which might be sorted differently! More...
 
void GetSegsPosVelAccEarthOrb (LALStatus *status, REAL8VectorSequence **posSeg, REAL8VectorSequence **velSeg, REAL8VectorSequence **accSeg, UsefulStageVariables *usefulparams)
 Calculate Earth orbital position, velocity and acceleration at midpoint of each segment. More...
 
static INT4 ComputeU1idx (REAL8 freq_event, REAL8 f1dot_event, REAL8 A1, REAL8 B1, REAL8 U1start, REAL8 U1winInv)
 Calculate the U1 index for a given point in parameter space. More...
 
void ComputeU2idx (REAL8 freq_event, REAL8 f1dot_event, REAL8 A2, REAL8 B2, REAL8 U2start, REAL8 U2winInv, INT4 *U2idx)
 Calculate the U2 index for a given point in parameter space. More...
 
int compareCoarseGridUindex (const void *a, const void *b)
 
int compareFineGridNC (const void *a, const void *b)
 
int compareFineGridsumTwoF (const void *a, const void *b)
 
SFTCatalogSequenceXLALSetUpStacksFromSegmentList (const SFTCatalog *catalog, const LALSegList *segList)
 Set up 'segmented' SFT-catalogs for given list of segments and a total SFT-catalog. More...
 
int XLALExtrapolateToplistPulsarSpins (toplist_t *list, const LIGOTimeGPS outRefTime, const LIGOTimeGPS inRefTime)
 XLAL function to extrapolate the pulsar spin parameters of all toplist candidates from reftime of the input toplist ('inRefTime') to a user-specified output reftime 'outRefTime'. More...
 
static int write_TimingInfo (const CHAR *fname, const timingInfo_t *ti)
 Function to append one timing-info line to output file. More...
 
static REAL4 findLoudestTwoF (const FstatResults *in)
 
int main (int argc, char *argv[])
 
void SetUpStacks (LALStatus *status, SFTCatalogSequence *out, REAL8 tStack, SFTCatalog *in, UINT4 nStacksMax)
 Breaks up input sft catalog into specified number of stacks Loops over elements of the catalog, assigns a bin index and allocates memory to the output catalog sequence appropriately. More...
 

Detailed Description

Hierarchical semicoherent CW search code based on F-Statistic, exploiting global-correlation coordinates (Phys.Rev.Lett. 103, 181102, 2009)

Author
Holger Pletsch

Definition in file HierarchSearchGCT.c.

Go to the source code of this file.

Data Structures

struct  UsefulStageVariables
 useful variables for each hierarchical stage More...
 
struct  timingInfo_t
 Struct holding various timing measurements and relevant search parameters. More...
 

Macros

#define ALRealloc   LALRealloc
 
#define ALFree   LALFree
 
#define NUDGE   10*LAL_REAL8_EPS
 
#define TRUE   (1==1)
 
#define FALSE   (1==0)
 
#define GET_GCT_CHECKPOINT   read_gct_checkpoint
 
#define SET_GCT_CHECKPOINT   write_gct_checkpoint
 
#define FSTART   100.0
 Default Start search frequency. More...
 
#define FBAND   0.0
 Default search band. More...
 
#define FDOT   0.0
 Default value of first spindown. More...
 
#define DFDOT   0.0
 Default range of first spindown parameter. More...
 
#define F2DOT   0.0
 Default value of second spindown. More...
 
#define F3DOT   0.0
 Default value of third spindown. More...
 
#define DF2DOT   0.0
 Default range of second spindown parameter. More...
 
#define DF3DOT   0.0
 Default range of third spindown parameter. More...
 
#define SKYREGION   "allsky"
 default sky region to search over – just a single point More...
 
#define MISMATCH   0.3
 Default for metric grid maximal mismatch value. More...
 
#define DALPHA   0.001
 Default resolution for isotropic or flat grids. More...
 
#define DDELTA   0.001
 Default resolution for isotropic or flat grids. More...
 
#define FSTATTHRESHOLD   2.6
 Default threshold on Fstatistic for peak selection. More...
 
#define NCAND1   10
 Default number of candidates to be followed up from first stage. More...
 
#define FNAMEOUT   "./HS_GCT.out"
 Default output file basename. More...
 
#define LAL_INT4_MAX   2147483647
 
#define BLOCKSIZE_REALLOC   50
 
#define Vorb_GCT   = 2.9785e04;
 
#define Vspin_GCT   = 465.10;
 
#define REARTH_GCT   = 6.378140e06;
 
#define C_GCT   = 299792458;
 
#define HSMAX(x, y)   ( (x) > (y) ? (x) : (y) )
 
#define HSMIN(x, y)   ( (x) < (y) ? (x) : (y) )
 
#define GETTIME()   (uvar_outputTiming ? XLALGetCPUTime() : 0)
 
#define ALIGN_REAL4   4 /* 16 bytes / sizeof(REAL4) = 4 */
 

Variables

char ** global_argv
 
int global_argc
 
LALStatusglobal_status
 
charglobal_column_headings_stringp
 
int XLALReadSegmentsFromFile_support_4column_format
 

Macro Definition Documentation

◆ ALRealloc

#define ALRealloc   LALRealloc

Definition at line 51 of file HierarchSearchGCT.c.

◆ ALFree

#define ALFree   LALFree

Definition at line 52 of file HierarchSearchGCT.c.

◆ NUDGE

#define NUDGE   10*LAL_REAL8_EPS

Definition at line 57 of file HierarchSearchGCT.c.

◆ TRUE

#define TRUE   (1==1)

Definition at line 59 of file HierarchSearchGCT.c.

◆ FALSE

#define FALSE   (1==0)

Definition at line 60 of file HierarchSearchGCT.c.

◆ GET_GCT_CHECKPOINT

#define GET_GCT_CHECKPOINT   read_gct_checkpoint

Definition at line 68 of file HierarchSearchGCT.c.

◆ SET_GCT_CHECKPOINT

#define SET_GCT_CHECKPOINT   write_gct_checkpoint

Definition at line 69 of file HierarchSearchGCT.c.

◆ FSTART

#define FSTART   100.0

Default Start search frequency.

Definition at line 73 of file HierarchSearchGCT.c.

◆ FBAND

#define FBAND   0.0

Default search band.

Definition at line 74 of file HierarchSearchGCT.c.

◆ FDOT

#define FDOT   0.0

Default value of first spindown.

Definition at line 75 of file HierarchSearchGCT.c.

◆ DFDOT

#define DFDOT   0.0

Default range of first spindown parameter.

Definition at line 76 of file HierarchSearchGCT.c.

◆ F2DOT

#define F2DOT   0.0

Default value of second spindown.

Definition at line 77 of file HierarchSearchGCT.c.

◆ F3DOT

#define F3DOT   0.0

Default value of third spindown.

Definition at line 78 of file HierarchSearchGCT.c.

◆ DF2DOT

#define DF2DOT   0.0

Default range of second spindown parameter.

Definition at line 79 of file HierarchSearchGCT.c.

◆ DF3DOT

#define DF3DOT   0.0

Default range of third spindown parameter.

Definition at line 80 of file HierarchSearchGCT.c.

◆ SKYREGION

#define SKYREGION   "allsky"

default sky region to search over – just a single point

Definition at line 81 of file HierarchSearchGCT.c.

◆ MISMATCH

#define MISMATCH   0.3

Default for metric grid maximal mismatch value.

Definition at line 82 of file HierarchSearchGCT.c.

◆ DALPHA

#define DALPHA   0.001

Default resolution for isotropic or flat grids.

Definition at line 83 of file HierarchSearchGCT.c.

◆ DDELTA

#define DDELTA   0.001

Default resolution for isotropic or flat grids.

Definition at line 84 of file HierarchSearchGCT.c.

◆ FSTATTHRESHOLD

#define FSTATTHRESHOLD   2.6

Default threshold on Fstatistic for peak selection.

Definition at line 85 of file HierarchSearchGCT.c.

◆ NCAND1

#define NCAND1   10

Default number of candidates to be followed up from first stage.

Definition at line 86 of file HierarchSearchGCT.c.

◆ FNAMEOUT

#define FNAMEOUT   "./HS_GCT.out"

Default output file basename.

Definition at line 87 of file HierarchSearchGCT.c.

◆ LAL_INT4_MAX

#define LAL_INT4_MAX   2147483647

Definition at line 89 of file HierarchSearchGCT.c.

◆ BLOCKSIZE_REALLOC

#define BLOCKSIZE_REALLOC   50

Definition at line 92 of file HierarchSearchGCT.c.

◆ Vorb_GCT

#define Vorb_GCT   = 2.9785e04;

Definition at line 94 of file HierarchSearchGCT.c.

◆ Vspin_GCT

#define Vspin_GCT   = 465.10;

Definition at line 95 of file HierarchSearchGCT.c.

◆ REARTH_GCT

#define REARTH_GCT   = 6.378140e06;

Definition at line 96 of file HierarchSearchGCT.c.

◆ C_GCT

#define C_GCT   = 299792458;

Definition at line 97 of file HierarchSearchGCT.c.

◆ HSMAX

#define HSMAX (   x,
  y 
)    ( (x) > (y) ? (x) : (y) )

Definition at line 100 of file HierarchSearchGCT.c.

◆ HSMIN

#define HSMIN (   x,
  y 
)    ( (x) < (y) ? (x) : (y) )

Definition at line 101 of file HierarchSearchGCT.c.

◆ GETTIME

#define GETTIME ( )    (uvar_outputTiming ? XLALGetCPUTime() : 0)

Definition at line 103 of file HierarchSearchGCT.c.

◆ ALIGN_REAL4

#define ALIGN_REAL4   4 /* 16 bytes / sizeof(REAL4) = 4 */

Function Documentation

◆ SetUpSFTs()

void SetUpSFTs ( LALStatus status,
UsefulStageVariables in 
)

Set up stacks, read SFTs, calculate SFT noise weights and calculate detector-state.

Parameters
statuspointer to LALStatus structure
ininput params

Definition at line 2013 of file HierarchSearchGCT.c.

◆ PrintFstatVec()

void PrintFstatVec ( LALStatus status,
FstatResults in,
FILE *  fp,
PulsarDopplerParams thisPoint,
LIGOTimeGPS  refTime,
INT4  stackIndex 
)

Print Fstat vectors.

Definition at line 2876 of file HierarchSearchGCT.c.

◆ PrintCatalogInfo()

void PrintCatalogInfo ( LALStatus status,
const SFTCatalog catalog,
FILE *  fp 
)

Print some sft catalog info.

Definition at line 2489 of file HierarchSearchGCT.c.

◆ PrintStackInfo()

void PrintStackInfo ( LALStatus status,
const SFTCatalogSequence catalogSeq,
FILE *  fp 
)

Print some stack info from sft catalog sequence.

Definition at line 2522 of file HierarchSearchGCT.c.

◆ UpdateSemiCohToplists()

void UpdateSemiCohToplists ( LALStatus status,
toplist_t list1,
toplist_t list2,
toplist_t list3,
FineGrid in,
REAL8  f1dot_fg,
REAL8  f2dot_fg,
REAL8  f3dot_fg,
UsefulStageVariables usefulparams,
REAL4  NSegmentsInv,
REAL4 NSegmentsInvX,
BOOLEAN  have_f3dot 
)

Get SemiCoh candidates into toplist(s) This function allows for inserting candidates into up to 3 toplists at once, which might be sorted differently!

Definition at line 2727 of file HierarchSearchGCT.c.

◆ UpdateSemiCohToplistsOptimTriple()

void UpdateSemiCohToplistsOptimTriple ( LALStatus status,
SortBy_t  toplist_sortby,
toplist_t list1,
toplist_t list2,
toplist_t list3,
FineGrid in,
REAL8  f1dot_fg,
REAL8  f2dot_fg,
REAL8  f3dot_fg,
UsefulStageVariables usefulparams,
REAL4  NSegmentsInv,
REAL4 NSegmentsInvX,
BOOLEAN  have_f3dot 
)

Get SemiCoh candidates into toplist(s) This function allows for inserting candidates into up to 3 toplists at once, which might be sorted differently!

Definition at line 2564 of file HierarchSearchGCT.c.

◆ GetSegsPosVelAccEarthOrb()

void GetSegsPosVelAccEarthOrb ( LALStatus status,
REAL8VectorSequence **  posSeg,
REAL8VectorSequence **  velSeg,
REAL8VectorSequence **  accSeg,
UsefulStageVariables usefulparams 
)

Calculate Earth orbital position, velocity and acceleration at midpoint of each segment.

Definition at line 2933 of file HierarchSearchGCT.c.

◆ ComputeU1idx()

static INT4 ComputeU1idx ( REAL8  freq_event,
REAL8  f1dot_event,
REAL8  A1,
REAL8  B1,
REAL8  U1start,
REAL8  U1winInv 
)
inlinestatic

Calculate the U1 index for a given point in parameter space.

Definition at line 3008 of file HierarchSearchGCT.c.

◆ ComputeU2idx()

void ComputeU2idx ( REAL8  freq_event,
REAL8  f1dot_event,
REAL8  A2,
REAL8  B2,
REAL8  U2start,
REAL8  U2winInv,
INT4 U2idx 
)

Calculate the U2 index for a given point in parameter space.

Definition at line 3025 of file HierarchSearchGCT.c.

◆ compareCoarseGridUindex()

int compareCoarseGridUindex ( const void *  a,
const void *  b 
)

◆ compareFineGridNC()

int compareFineGridNC ( const void *  a,
const void *  b 
)

◆ compareFineGridsumTwoF()

int compareFineGridsumTwoF ( const void *  a,
const void *  b 
)

◆ XLALSetUpStacksFromSegmentList()

SFTCatalogSequence * XLALSetUpStacksFromSegmentList ( const SFTCatalog catalog,
const LALSegList segList 
)

Set up 'segmented' SFT-catalogs for given list of segments and a total SFT-catalog.

Note: this function does not allow 'empty' segments to be returned, i.e. if there is any segment that would contain no SFTs from the given SFT-catalog, an error is returned. These segment-lists are 'precomputed' and therefore one can assume that empty segments are not intended. However, the function will not complain if some SFTs from the catalog are 'unused', i.e. they didn't fit into any of the given segments.

Note
the input segment list must be sorted, otherwise an error is returned
Parameters
catalogcomplete list of SFTs read in
segListpre-computed list of segments to split SFTs into

Definition at line 3055 of file HierarchSearchGCT.c.

◆ XLALExtrapolateToplistPulsarSpins()

int XLALExtrapolateToplistPulsarSpins ( toplist_t list,
const LIGOTimeGPS  outRefTime,
const LIGOTimeGPS  inRefTime 
)

XLAL function to extrapolate the pulsar spin parameters of all toplist candidates from reftime of the input toplist ('inRefTime') to a user-specified output reftime 'outRefTime'.

Parameters
list[out/in] toplist with GCTtopOutputEntry items, 'Freq,F1dot,F2dot,F3dot' fields will be overwritten
outRefTimereference time as requested for the final candidate output
inRefTimereference time of the input toplist

Definition at line 3164 of file HierarchSearchGCT.c.

◆ write_TimingInfo()

static int write_TimingInfo ( const CHAR fname,
const timingInfo_t ti 
)
static

Function to append one timing-info line to output file.

Definition at line 3215 of file HierarchSearchGCT.c.

◆ findLoudestTwoF()

static REAL4 findLoudestTwoF ( const FstatResults in)
inlinestatic

Definition at line 2864 of file HierarchSearchGCT.c.

◆ main()

int main ( int  argc,
char argv[] 
)

< ALTERNATIVE: file containing a pre-computed segment list of tuples (startGPS endGPS duration[h] NumSFTs)

< Earth ephemeris file to use

< Sun ephemeris file to use

Definition at line 239 of file HierarchSearchGCT.c.

◆ SetUpStacks()

void SetUpStacks ( LALStatus status,
SFTCatalogSequence out,
REAL8  tStack,
SFTCatalog in,
UINT4  nStacksMax 
)

Breaks up input sft catalog into specified number of stacks Loops over elements of the catalog, assigns a bin index and allocates memory to the output catalog sequence appropriately.

If there are long gaps in the data, then some of the catalogs in the output catalog sequence may be of zero length.

Parameters
statuspointer to LALStatus structure
outOutput catalog of sfts -- one for each stack
tStackOutput duration of each stack
inInput sft catalog to be broken up into stacks (ordered in increasing time)
nStacksMaxUser specified number of stacks

Definition at line 2390 of file HierarchSearchGCT.c.

Variable Documentation

◆ global_argv

char** global_argv

Definition at line 70 of file HierarchSearchGCT.c.

◆ global_argc

int global_argc

Definition at line 71 of file HierarchSearchGCT.c.

◆ global_status

LALStatus* global_status

Definition at line 230 of file HierarchSearchGCT.c.

◆ global_column_headings_stringp

char* global_column_headings_stringp

Definition at line 231 of file HierarchSearchGCT.c.

◆ XLALReadSegmentsFromFile_support_4column_format

int XLALReadSegmentsFromFile_support_4column_format
extern

Definition at line 38 of file SFTtimestamps.c.