HierarchicalSearch.c File Reference

Author:
Badri Krishnan, Alicia Sintes, Reinhard Prix, Bernd Machenschalk Program for calculating F-stat values for different time segments and combining them semi-coherently using the Hough transform, and following up candidates using a longer coherent integration.
More...

#include "HierarchicalSearch.h"
#include "StackSlideFstat.h"

Include dependency graph for HierarchicalSearch.c:

Go to the source code of this file.

Data Structures

struct  UsefulStageVariables
 Useful stuff for a single stage of the Hierarchical search. More...

Defines

#define TRUE   (1==1)
#define FALSE   (1==0)
#define HS_CHECKPOINTING   0
#define GET_CHECKPOINT(toplist, total, count, outputname, cptname)   *total=0;
#define INSERT_INTO_HOUGHFSTAT_TOPLIST   insert_into_houghFStat_toplist
#define SHOW_PROGRESS(rac, dec, tpl_count, tpl_total, freq, fband)
#define SET_CHECKPOINT
#define MAIN   main
#define FOPEN   fopen
#define COMPUTEFSTATFREQBAND   ComputeFStatFreqBand
#define COMPUTEFSTATHOUGHMAP   ComputeFstatHoughMap
#define HSMAX(x, y)   ( (x) > (y) ? (x) : (y) )
#define HSMIN(x, y)   ( (x) < (y) ? (x) : (y) )
#define INIT_MEM(x)   memset(&(x), 0, sizeof((x)))
#define BLOCKSIZE_REALLOC   50
#define EARTHEPHEMERIS   "earth05-09.dat"
#define SUNEPHEMERIS   "sun05-09.dat"
#define BLOCKSRNGMED   101
 Default running median window size.
#define FSTART   310.0
 Default Start search frequency.
#define FBAND   0.01
 Default search band.
#define FDOT   0.0
 Default value of first spindown.
#define DFDOT   0.0
 Default range of first spindown parameter.
#define SKYREGION   "allsky"
 default sky region to search over -- just a single point
#define NFDOT   10
 Default size of hough cylinder of look up tables.
#define DTERMS   8
 Default number of dirichlet kernel terms for calculating Fstat.
#define MISMATCH   0.2
 Default for metric grid maximal mismatch value.
#define DALPHA   0.001
 Default resolution for isotropic or flat grids.
#define DDELTA   0.001
 Default resolution for isotropic or flat grids.
#define FSTATTHRESHOLD   2.6
 Default threshold on Fstatistic for peak selection.
#define NCAND1   5
 Default number of candidates to be followed up from first stage.
#define FNAMEOUT   "./out/HS.dat"
 Default output file basename.
#define PIXELFACTOR   2.0
#define LAL_INT4_MAX   2147483647

Functions

 RCSID ("$Id: HierarchicalSearch.c,v 1.199 2008/10/08 10:00:29 bema Exp $")
void ComputeStackNoiseWeights (LALStatus *status, REAL8Vector **out, MultiNoiseWeightsSequence *in)
 Calculate noise weight for each stack.
void ComputeStackNoiseAndAMWeights (LALStatus *status, REAL8Vector *out, MultiNoiseWeightsSequence *inNoise, MultiDetectorStateSeriesSequence *inDetStates, SkyPosition skypos)
 Calculate noise and AM weight for each stack for a given sky position.
void GetStackVelPos (LALStatus *status, REAL8VectorSequence **velStack, REAL8VectorSequence **posStack, MultiDetectorStateSeriesSequence *stackMultiDetStates)
 Calculate average velocity and position of detector network during each stack.
void SetUpSFTs (LALStatus *status, MultiSFTVectorSequence *stackMultiSFT,MultiNoiseWeightsSequence *stackMultiNoiseWeights,MultiDetectorStateSeriesSequence *stackMultiDetStates,UsefulStageVariables *in)
 Set up stacks, read SFTs, calculate SFT noise weights and calculate detector-state.
void PrintFstatVec (LALStatus *status, REAL8FrequencySeries *in, FILE *fp, PulsarDopplerParams *thisPoint, LIGOTimeGPS refTime, INT4 stackIndex)
 Print Fstat vectors.
void PrintSemiCohCandidates (LALStatus *status, SemiCohCandidateList *in, FILE *fp, LIGOTimeGPS refTime)
 Print Hough candidates.
void PrintHoughHistogram (LALStatus *status, UINT8Vector *hist, CHAR *fnameOut)
 Print hough histogram to a file.
void PrintCatalogInfo (LALStatus *status, const SFTCatalog *catalog, FILE *fp)
 Print some sft catalog info.
void PrintStackInfo (LALStatus *status, const SFTCatalogSequence *catalogSeq, FILE *fp)
 Print some stack info from sft catalog sequence.
void GetSemiCohToplist (LALStatus *status, toplist_t *list, SemiCohCandidateList *in, REAL8 meanN, REAL8 sigmaN)
 Get SemiCoh candidates toplist.
void ComputeNumExtraBins (LALStatus *status, SemiCoherentParams *par, REAL8 fdot, REAL8 f0, REAL8 deltaF)
 Optimized calculation of Fstat overhead.
void DumpLUT2file (LALStatus *status, HOUGHptfLUT *lut, HOUGHPatchGrid *patch, CHAR *basename, INT4 index)
 Print single Hough map to a specified output file.
void GetXiInSingleStack (LALStatus *status, REAL8Vector *out, HOUGHSizePar *size, HOUGHDemodPar *par)
int MAIN (int argc, char *argv[])
void ComputeFstatHoughMap (LALStatus *status, SemiCohCandidateList *out, HOUGHPeakGramVector *pgV, SemiCoherentParams *params)
 Function for calculating Hough Maps and candidates.
void FstatVectToPeakGram (LALStatus *status, HOUGHPeakGramVector *pgV, REAL8FrequencySeriesVector *FstatVect, REAL8 thr)
 Function for selecting frequency bins from a set of Fstatistic vectors.
void SetUpStacks (LALStatus *status, SFTCatalogSequence *out, REAL8 tStack, SFTCatalog *in, UINT4 nStacksMax)
 Breaks up input sft catalog into specified number of stacks.
void PrintHmap2file (LALStatus *status, HOUGHMapTotal *ht, CHAR *fnameOut, INT4 iHmap)
 Print single Hough map to a specified output file.
void GetHoughCandidates_toplist (LALStatus *status, toplist_t *list, HOUGHMapTotal *ht, HOUGHPatchGrid *patch, HOUGHDemodPar *parDem)
 Get Hough candidates as a toplist.
void GetHoughCandidates_threshold (LALStatus *status, SemiCohCandidateList *out, HOUGHMapTotal *ht, HOUGHPatchGrid *patch, HOUGHDemodPar *parDem, REAL8 threshold)
 Get Hough candidates as a toplist using a fixed threshold.
void GetFstatCandidates_toplist (LALStatus *status, toplist_t *list, REAL8FrequencySeries *in, REAL8 alpha, REAL8 delta, REAL8 fdot)
void GetChkPointIndex (LALStatus *status, INT4 *loopindex, const CHAR *fnameChkPoint)
 Read checkpointing file This does not (yet) check any consistency of the existing results file.

Variables

int lalDebugLevel
 DECLARE AND SET GLOBAL DEBUG LEVEL.
BOOLEAN uvar_printMaps = FALSE
 global variable for printing Hough maps
BOOLEAN uvar_printStats = FALSE
 global variable for calculating Hough map stats
BOOLEAN uvar_dumpLUT = FALSE
 global variable for printing Hough look-up-tables for debugging
LALStatusglobal_status


Detailed Description

Author:
Badri Krishnan, Alicia Sintes, Reinhard Prix, Bernd Machenschalk Program for calculating F-stat values for different time segments and combining them semi-coherently using the Hough transform, and following up candidates using a longer coherent integration.

Description
This code implements a hierarchical strategy to look for unknown gravitational wave pulsars. It scans through the parameter space using a less sensitive but computationally inexpensive search and follows up the candidates using more sensitive methods.

Algorithm
Currently the code does a single stage hierarchical search using the Hough algorithm and follows up the candidates using a full coherent integration.

Questions/To-do

Definition in file HierarchicalSearch.c.


Define Documentation

#define TRUE   (1==1)

Definition at line 124 of file HierarchicalSearch.c.

#define FALSE   (1==0)

Definition at line 125 of file HierarchicalSearch.c.

#define HS_CHECKPOINTING   0

Definition at line 134 of file HierarchicalSearch.c.

#define GET_CHECKPOINT ( toplist,
total,
count,
outputname,
cptname   )     *total=0;

Definition at line 135 of file HierarchicalSearch.c.

#define INSERT_INTO_HOUGHFSTAT_TOPLIST   insert_into_houghFStat_toplist

Definition at line 136 of file HierarchicalSearch.c.

#define SHOW_PROGRESS ( rac,
dec,
tpl_count,
tpl_total,
freq,
fband   ) 

Definition at line 137 of file HierarchicalSearch.c.

#define SET_CHECKPOINT

Definition at line 138 of file HierarchicalSearch.c.

#define MAIN   main

Definition at line 139 of file HierarchicalSearch.c.

#define FOPEN   fopen

Definition at line 140 of file HierarchicalSearch.c.

#define COMPUTEFSTATFREQBAND   ComputeFStatFreqBand

Definition at line 141 of file HierarchicalSearch.c.

#define COMPUTEFSTATHOUGHMAP   ComputeFstatHoughMap

Definition at line 142 of file HierarchicalSearch.c.

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

Definition at line 151 of file HierarchicalSearch.c.

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

Definition at line 152 of file HierarchicalSearch.c.

#define INIT_MEM ( x   )     memset(&(x), 0, sizeof((x)))

Definition at line 154 of file HierarchicalSearch.c.

#define BLOCKSIZE_REALLOC   50

Definition at line 156 of file HierarchicalSearch.c.

#define EARTHEPHEMERIS   "earth05-09.dat"

Definition at line 231 of file HierarchicalSearch.c.

#define SUNEPHEMERIS   "sun05-09.dat"

Definition at line 232 of file HierarchicalSearch.c.

#define BLOCKSRNGMED   101

Default running median window size.

Definition at line 234 of file HierarchicalSearch.c.

#define FSTART   310.0

Default Start search frequency.

Definition at line 235 of file HierarchicalSearch.c.

#define FBAND   0.01

Default search band.

Definition at line 237 of file HierarchicalSearch.c.

#define FDOT   0.0

Default value of first spindown.

Definition at line 238 of file HierarchicalSearch.c.

#define DFDOT   0.0

Default range of first spindown parameter.

Definition at line 239 of file HierarchicalSearch.c.

#define SKYREGION   "allsky"

default sky region to search over -- just a single point

Definition at line 240 of file HierarchicalSearch.c.

#define NFDOT   10

Default size of hough cylinder of look up tables.

Definition at line 241 of file HierarchicalSearch.c.

#define DTERMS   8

Default number of dirichlet kernel terms for calculating Fstat.

Definition at line 242 of file HierarchicalSearch.c.

#define MISMATCH   0.2

Default for metric grid maximal mismatch value.

Definition at line 243 of file HierarchicalSearch.c.

#define DALPHA   0.001

Default resolution for isotropic or flat grids.

Definition at line 244 of file HierarchicalSearch.c.

#define DDELTA   0.001

Default resolution for isotropic or flat grids.

Definition at line 245 of file HierarchicalSearch.c.

#define FSTATTHRESHOLD   2.6

Default threshold on Fstatistic for peak selection.

Definition at line 246 of file HierarchicalSearch.c.

#define NCAND1   5

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

Definition at line 247 of file HierarchicalSearch.c.

#define FNAMEOUT   "./out/HS.dat"

Default output file basename.

Definition at line 248 of file HierarchicalSearch.c.

#define PIXELFACTOR   2.0

Definition at line 249 of file HierarchicalSearch.c.

#define LAL_INT4_MAX   2147483647

Definition at line 251 of file HierarchicalSearch.c.


Function Documentation

RCSID ( "$Id: HierarchicalSearch.  c,
v 1.199 2008/10/08 10:00:29 bema Exp $"   
)

void ComputeStackNoiseWeights ( LALStatus status,
REAL8Vector **  out,
MultiNoiseWeightsSequence in 
)

Calculate noise weight for each stack.

Definition at line 3022 of file HierarchicalSearch.c.

void ComputeStackNoiseAndAMWeights ( LALStatus status,
REAL8Vector out,
MultiNoiseWeightsSequence inNoise,
MultiDetectorStateSeriesSequence inDetStates,
SkyPosition  skypos 
)

Calculate noise and AM weight for each stack for a given sky position.

Definition at line 3086 of file HierarchicalSearch.c.

void GetStackVelPos ( LALStatus status,
REAL8VectorSequence **  velStack,
REAL8VectorSequence **  posStack,
MultiDetectorStateSeriesSequence stackMultiDetStates 
)

Calculate average velocity and position of detector network during each stack.

Definition at line 2932 of file HierarchicalSearch.c.

void SetUpSFTs ( LALStatus status,
MultiSFTVectorSequence stackMultiSFT,
MultiNoiseWeightsSequence stackMultiNoiseWeights,
MultiDetectorStateSeriesSequence stackMultiDetStates,
UsefulStageVariables in 
)

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

Parameters:
stackMultiSFT  output multi sft vector for each stack
stackMultiNoiseWeights  output multi noise weights for each stack
stackMultiDetStates  output multi detector states for each stack
in  input params

Definition at line 1291 of file HierarchicalSearch.c.

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

Print Fstat vectors.

Definition at line 2699 of file HierarchicalSearch.c.

void PrintSemiCohCandidates ( LALStatus status,
SemiCohCandidateList in,
FILE *  fp,
LIGOTimeGPS  refTime 
)

Print Hough candidates.

Definition at line 2664 of file HierarchicalSearch.c.

void PrintHoughHistogram ( LALStatus status,
UINT8Vector hist,
CHAR fnameOut 
)

Print hough histogram to a file.

Definition at line 2784 of file HierarchicalSearch.c.

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

Print some sft catalog info.

Definition at line 2816 of file HierarchicalSearch.c.

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

Print some stack info from sft catalog sequence.

Definition at line 2846 of file HierarchicalSearch.c.

void GetSemiCohToplist ( LALStatus status,
toplist_t list,
SemiCohCandidateList in,
REAL8  meanN,
REAL8  sigmaN 
)

Get SemiCoh candidates toplist.

Definition at line 3167 of file HierarchicalSearch.c.

void ComputeNumExtraBins ( LALStatus status,
SemiCoherentParams par,
REAL8  fdot,
REAL8  f0,
REAL8  deltaF 
)

Optimized calculation of Fstat overhead.

Definition at line 3217 of file HierarchicalSearch.c.

void DumpLUT2file ( LALStatus status,
HOUGHptfLUT lut,
HOUGHPatchGrid patch,
CHAR basename,
INT4  index 
)

Print single Hough map to a specified output file.

Definition at line 2312 of file HierarchicalSearch.c.

void GetXiInSingleStack ( LALStatus status,
REAL8Vector out,
HOUGHSizePar size,
HOUGHDemodPar par 
)

Definition at line 3413 of file HierarchicalSearch.c.

int MAIN ( int  argc,
char *  argv[] 
)

Definition at line 266 of file HierarchicalSearch.c.

void ComputeFstatHoughMap ( LALStatus status,
SemiCohCandidateList out,
HOUGHPeakGramVector pgV,
SemiCoherentParams params 
)

Function for calculating Hough Maps and candidates.

Parameters:
pgV is a HOUGHPeakGramVector obtained after thresholding Fstatistic vectors
params is a pointer to HoughParams -- parameters for calculating Hough maps houghCand Candidates from thresholding Hough number counts
This function takes a peakgram as input. This peakgram was constructed by setting a threshold on a sequence of Fstatistic vectors. The function produces a Hough map in the sky for each value of the frequency and spindown. The Hough nummber counts are then used to select candidates in parameter space to be followed up in a more refined search. This uses DriveHough_v3.c as a prototype suitably modified to work on demodulated data instead of SFTs.

Definition at line 1537 of file HierarchicalSearch.c.

void FstatVectToPeakGram ( LALStatus status,
HOUGHPeakGramVector pgV,
REAL8FrequencySeriesVector FstatVect,
REAL8  thr 
)

Function for selecting frequency bins from a set of Fstatistic vectors.

Parameters:
FstatVect : sequence of Fstatistic vectors
thr is a REAL8 threshold for selecting frequency bins
Returns:
pgV : a vector of peakgrams
Input is a vector of Fstatistic vectors. It allocates memory for the peakgrams based on the frequency span of the Fstatistic vectors and fills tyem up by setting a threshold on the Fstatistic. Peakgram must be deallocated outside the function.

Definition at line 2077 of file HierarchicalSearch.c.

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:
out  Output catalog of sfts -- one for each stack
tStack  Output duration of each stack
in  Input sft catalog to be broken up into stacks (ordered in increasing time)
nStacksMax  User specified number of stacks

Definition at line 2174 of file HierarchicalSearch.c.

void PrintHmap2file ( LALStatus status,
HOUGHMapTotal ht,
CHAR fnameOut,
INT4  iHmap 
)

Print single Hough map to a specified output file.

Definition at line 2271 of file HierarchicalSearch.c.

void GetHoughCandidates_toplist ( LALStatus status,
toplist_t list,
HOUGHMapTotal ht,
HOUGHPatchGrid patch,
HOUGHDemodPar parDem 
)

Get Hough candidates as a toplist.

Definition at line 2416 of file HierarchicalSearch.c.

void GetHoughCandidates_threshold ( LALStatus status,
SemiCohCandidateList out,
HOUGHMapTotal ht,
HOUGHPatchGrid patch,
HOUGHDemodPar parDem,
REAL8  threshold 
)

Get Hough candidates as a toplist using a fixed threshold.

Definition at line 2477 of file HierarchicalSearch.c.

void GetFstatCandidates_toplist ( LALStatus status,
toplist_t list,
REAL8FrequencySeries in,
REAL8  alpha,
REAL8  delta,
REAL8  fdot 
)

Definition at line 2744 of file HierarchicalSearch.c.

void GetChkPointIndex ( LALStatus status,
INT4 loopindex,
const CHAR fnameChkPoint 
)

Read checkpointing file This does not (yet) check any consistency of the existing results file.

Definition at line 2880 of file HierarchicalSearch.c.


Variable Documentation

int lalDebugLevel

DECLARE AND SET GLOBAL DEBUG LEVEL.

see the section (currently 7.4.1) of the LSD on "Status-reporting objects" for a list of predefined debug levels

Definition at line 62 of file BCVSpinTemplates.c.

BOOLEAN uvar_printMaps = FALSE

global variable for printing Hough maps

Definition at line 147 of file HierarchicalSearch.c.

BOOLEAN uvar_printStats = FALSE

global variable for calculating Hough map stats

Definition at line 148 of file HierarchicalSearch.c.

BOOLEAN uvar_dumpLUT = FALSE

global variable for printing Hough look-up-tables for debugging

Definition at line 149 of file HierarchicalSearch.c.

LALStatus* global_status

Parameters:
global_status LALStatus Used to initialize LALStatus lalStatus.

Definition at line 256 of file HierarchicalSearch.c.


Generated on Sun Oct 12 02:33:03 2008 for LAL by  doxygen 1.5.2