#include "config.h"#include <stdio.h>#include <string.h>#include <errno.h>#include <math.h>#include <lal/AVFactories.h>#include <lal/RngMedBias.h>#include <lal/LALDemod.h>#include <lal/LALComputeAM.h>#include <lal/ComputeSky.h>#include <lal/LALInitBarycenter.h>#include <lal/UserInput.h>#include <lal/ExtrapolatePulsarSpins.h>#include <lal/LogPrintf.h>#include <lalapps.h>#include "ComputeFStatistic.h"#include "clusters.h"#include "FstatToplist.h"Include dependency graph for ComputeFStatistic.c:

Go to the source code of this file.
Data Structures | |
| struct | headertag |
Defines | |
| #define | __USE_ISOC99 1 |
| #define | USE_BOINC 0 |
| #define | EPHEM_YEARS "00-04" |
| #define | SFT_BNAME "SFT" |
| #define | TRUE (1==1) |
| #define | FALSE (1==0) |
| #define | MYMAX(x, y) ((x) > (y) ? (x) : (y) ) |
| #define | DEFAULT_EPHEMDIR "env LAL_DATA_PATH" |
| #define | CLUSTERED_FNAME "Fstats" |
| #define | res 64 |
| #define | EPHEM_EXT ".dat" |
Functions | |
| int | finite (double) |
| RCSID ("$Id: ComputeFStatistic.c,v 1.392 2007/10/26 16:04:13 reinhard Exp $") | |
| int | main (int argc, char *argv[]) |
| MAIN function of ComputeFStatistic code. | |
| void | initUserVars (LALStatus *status) |
| Register all our "user-variables" that can be specified from cmd-line and/or config-file. | |
| INT4 | ReadSFTData (void) |
| Reads in data from SFT-files. | |
| INT4 | UpsampleSFTData (void) |
| Upsamples the SFT data. | |
| void | InitFStat (LALStatus *status, ConfigVariables *cfg) |
| Do some basic initializations of the F-statistic code before starting the main-loop. | |
| void | CreateDemodParams (LALStatus *, PulsarDopplerParams dopplerpos) |
| void | CreateNautilusDetector (LALStatus *status, LALDetector *Detector) |
| Set up the LALDetector struct representing the NAUTILUS detector. | |
| void | Freemem (LALStatus *status) |
| Free all globally allocated memory. | |
| void | EstimateFLines (LALStatus *stat) |
| Find outliers and then clusters in the F-statistic array over frequency. | |
| void | NormaliseSFTDataRngMdn (LALStatus *stat, INT4 windowSize) |
| Normalise the SFT-array SFTData by the running median. | |
| INT4 | EstimateSignalParameters (INT4 *maxIndex) |
| int | writeFLines (INT4 *maxIndex, PulsarDopplerParams searchpos, FILE *fpOut) |
| int | writeFLinesCS (INT4 *maxIndex, PulsarDopplerParams searchpos, FILE *fpOut, long *bytecount, UINT4 *checksum) |
| INT4 | PrintTopValues (REAL8 TwoFthr, INT4 ReturnMaxN, PulsarDopplerParams searchpos) |
| Print the values of (f,FF) above a certain threshold in 2F, called 2Fthr. | |
| int | compare (const void *ip, const void *jp) |
| Sorting function to sort into DECREASING order. | |
| INT4 | writeFaFb (INT4 *maxIndex, PulsarDopplerParams searchpos) |
| void | checkUserInputConsistency (LALStatus *lstat) |
| Some general consistency-checks on user-input. | |
| void | InitSearchGrid (LALStatus *status, DopplerSkyScanState *scan, ConfigVariables *cfg) |
| Set up the search-grid and prepare DopplerSkyScan for stepping through parameter-space. | |
| void | WriteFStatLog (LALStatus *stat, char *argv[]) |
| Log the all relevant parameters of the present search-run to a log-file. | |
| void | swapheader (struct headertag *thisheader) |
| void | getCheckpointCounters (LALStatus *stat, UINT4 *loopcounter, UINT4 *checksum, long *bytecounter, const CHAR *fstat_fname, const CHAR *ckpfn) |
| Check presence and consistency of checkpoint-file and use to set loopcounter if valid. | |
| int | debug_dump_commandline (int argc, char *argv[]) |
| int | is_zip_file (const char *fname) |
| void | ourREPORTSTATUS (LALStatus *) |
Variables | |
| headertag | header |
| INT4 | uvar_Dterms |
| CHAR * | uvar_IFO |
| BOOLEAN | uvar_SignalOnly |
| BOOLEAN | uvar_EstimSigParam |
| REAL8 | uvar_Freq |
| REAL8 | uvar_dFreq |
| REAL8 | uvar_FreqBand |
| REAL8 | uvar_Alpha |
| REAL8 | uvar_dAlpha |
| REAL8 | uvar_AlphaBand |
| REAL8 | uvar_Delta |
| REAL8 | uvar_dDelta |
| REAL8 | uvar_DeltaBand |
| REAL8 | uvar_f1dot |
| REAL8 | uvar_df1dot |
| REAL8 | uvar_f1dotBand |
| REAL8 | uvar_Fthreshold |
| CHAR * | uvar_ephemDir |
| CHAR * | uvar_ephemYear |
| INT4 | uvar_gridType |
| INT4 | uvar_metricType |
| REAL8 | uvar_metricMismatch |
| CHAR * | uvar_skyRegion |
| CHAR * | uvar_DataDir |
| CHAR * | uvar_mergedSFTFile |
| CHAR * | uvar_BaseName |
| CHAR * | uvar_DataFiles |
| BOOLEAN | uvar_help |
| CHAR * | uvar_outputLabel |
| CHAR * | uvar_outputFstat |
| CHAR * | uvar_outputLoudest |
| CHAR * | uvar_skyGridFile |
| CHAR * | uvar_outputSkyGrid |
| CHAR * | uvar_workingDir |
| BOOLEAN | uvar_doCheckpointing |
| INT4 | uvar_expLALDemod |
| REAL8 | uvar_startTime |
| REAL8 | uvar_endTime |
| REAL8 | uvar_refTime |
| CHAR * | uvar_outputClusters |
| INT4 | uvar_RngMedWindow |
| INT4 | uvar_OutputBufferKB |
| INT4 | uvar_MaxFileSizeKB |
| INT4 | uvar_NumCandidatesToKeep |
| BOOLEAN | uvar_projectMetric |
| REAL8 | uvar_WUfpops |
| FFT ** | SFTData = NULL |
| SFT Data for LALDemod. | |
| FFT ** | UpSFTData = NULL |
| Upsampled SFT Data for LALDemodFAST. | |
| DemodPar * | DemodParams |
| Demodulation parameters for LALDemod. | |
| LIGOTimeGPS * | timestamps |
| Time stamps from SFT data. | |
| LALFstat | Fstat |
| output from LALDemod(): F-statistic and amplitudes Fa and Fb | |
| AMCoeffs | amc |
| amplitude-modulation coefficients (and derived quantities) | |
| Clusters | HFLines |
| stores information about outliers/clusters in F-statistic | |
| Clusters | HPLines |
| stores information about outliers/clusters in SFT-power spectrum | |
| Clusters * | highSpLines = &HPLines |
| Clusters * | highFLines = &HFLines |
| REAL8 | medianbias = 1.0 |
| median-bias depending on window-size | |
| FILE * | fp_mergedSFT |
| input-file containing merged SFTs | |
| FILE * | fpmax |
| output-file: maximum of F-statistic over frequency-range | |
| FILE * | fpClusters |
| output-file pointer to clustered Fstat output | |
| FILE * | fpFstat |
| output-file pointer to *unclustered* Fstat output | |
| ConfigVariables | GV |
| global container for various derived configuration settings | |
| int | reverse_endian = -1 |
| endian order of SFT data. | |
| CHAR | CFstatFilename [MAXFILENAMELENGTH] |
| clustered Fstats file name | |
| CHAR | FstatFilename [MAXFILENAMELENGTH] |
| (unclustered) Fstats file name | |
| CHAR | ckp_fname [MAXFILENAMELENGTH+4] |
| filename of checkpoint-file, global for polka | |
| CHAR * | Outputfilename |
| Name of output file, either Fstats- or Polka file name. | |
| INT4 | cfsRunNo = 0 |
| CFS run-number: 0=run only once, 1=first run, 2=second run. | |
| toplist_t * | toplist = NULL |
| char * | fstatbuff = NULL |
| FstatOutputEntry | empty_FstatOutputEntry |
| INT4 | maxSFTindex = 0 |
| maximal sftindex, for error-checking | |
| int | vrbflg |
| LALStatus | global_status |
| #define __USE_ISOC99 1 |
Definition at line 48 of file ComputeFStatistic.c.
| #define USE_BOINC 0 |
Definition at line 103 of file ComputeFStatistic.c.
| #define EPHEM_YEARS "00-04" |
Definition at line 349 of file ComputeFStatistic.c.
| #define SFT_BNAME "SFT" |
Definition at line 350 of file ComputeFStatistic.c.
| #define TRUE (1==1) |
Definition at line 353 of file ComputeFStatistic.c.
| #define FALSE (1==0) |
Definition at line 356 of file ComputeFStatistic.c.
| #define DEFAULT_EPHEMDIR "env LAL_DATA_PATH" |
| #define CLUSTERED_FNAME "Fstats" |
| #define res 64 |
| #define EPHEM_EXT ".dat" |
| int finite | ( | double | ) |
| RCSID | ( | "$Id: ComputeFStatistic. | c, | |
| v 1.392 2007/10/26 16:04:13 reinhard Exp $" | ||||
| ) |
MAIN function of ComputeFStatistic code.
Main function
| [in] | argc | INT4 |
| [in] | argv[] | CHAR* |
declaration
setup
noise
generate gw signal
maximize likelihood function for parameter estimation
postprocessing
cleanup
Definition at line 122 of file InspiralSpinBankTest.c.
| void initUserVars | ( | LALStatus * | status | ) |
Register all our "user-variables" that can be specified from cmd-line and/or config-file.
Here we set defaults for some user-variables and register them with the UserInput module.
| INT4 ReadSFTData | ( | void | ) |
Reads in data from SFT-files.
This function reads in the SFTs from the list of files in ConfigVariables GV.filelist or from merged SFTs in uvar_mergedSFTFile. If user has specified --startTime or --endTime The read SFT-data is stored in the global array SFTData and the timestamps of the SFTs are stored in the global array timestamps (both are allocated here).
NOTE: this function is obsolete and should be replaced by the use of the SFT-IO lib in LAL.
| int UpsampleSFTData | ( | void | ) |
Upsamples the SFT data.
This function upsamples the SFTs using the Dirichlet kernel
Definition at line 2064 of file ComputeFStatistic.c.
| void InitFStat | ( | LALStatus * | status, | |
| ConfigVariables * | cfg | |||
| ) |
Do some basic initializations of the F-statistic code before starting the main-loop.
NOTE: the logical *order* of things in here is very important, so be careful
Definition at line 2202 of file ComputeFStatistic.c.
| void CreateDemodParams | ( | LALStatus * | , | |
| PulsarDopplerParams | dopplerpos | |||
| ) |
Definition at line 1692 of file ComputeFStatistic.c.
| void CreateNautilusDetector | ( | LALStatus * | , | |
| LALDetector * | Detector | |||
| ) |
Set up the LALDetector struct representing the NAUTILUS detector.
| void Freemem | ( | LALStatus * | status | ) |
Free all globally allocated memory.
| void EstimateFLines | ( | LALStatus * | stat | ) |
Find outliers and then clusters in the F-statistic array over frequency.
These clusters get written in the global highFLines.
Normalise the SFT-array SFTData by the running median.
The running median windowSize in this routine determines the sample bias which, instead of log(2.0), must be multiplied by F statistics.
Definition at line 3488 of file ComputeFStatistic.c.
| int writeFLines | ( | INT4 * | maxIndex, | |
| PulsarDopplerParams | searchpos, | |||
| FILE * | fpOut | |||
| ) |
Definition at line 1793 of file ComputeFStatistic.c.
| int writeFLinesCS | ( | INT4 * | maxIndex, | |
| PulsarDopplerParams | searchpos, | |||
| FILE * | fpOut, | |||
| long * | bytecount, | |||
| UINT4 * | checksum | |||
| ) |
Definition at line 1852 of file ComputeFStatistic.c.
| INT4 PrintTopValues | ( | REAL8 | TwoFthr, | |
| INT4 | ReturnMaxN, | |||
| PulsarDopplerParams | searchpos | |||
| ) |
Print the values of (f,FF) above a certain threshold in 2F, called 2Fthr.
If there are more than ReturnMaxN of these, then it simply returns the top ReturnMaxN of them. If there are none, then it returns none. It also returns some basic statisical information about the distribution of 2F: the mean and standard deviation. Returns zero if all is well, else nonzero if a problem was encountered. Basic strategy: sort the array by values of F, then look at the top ones. Then search for the points above threshold.
Definition at line 3125 of file ComputeFStatistic.c.
| int compare | ( | const void * | ip, | |
| const void * | jp | |||
| ) |
Sorting function to sort into DECREASING order.
Used in PrintTopValues().
| int writeFaFb | ( | INT4 * | maxIndex, | |
| PulsarDopplerParams | searchpos | |||
| ) |
Definition at line 1574 of file ComputeFStatistic.c.
| void checkUserInputConsistency | ( | LALStatus * | status | ) |
Some general consistency-checks on user-input.
Throws an error plus prints error-message if problems are found.
Definition at line 2757 of file ComputeFStatistic.c.
| void InitSearchGrid | ( | LALStatus * | status, | |
| DopplerSkyScanState * | scan, | |||
| ConfigVariables * | cfg | |||
| ) |
Set up the search-grid and prepare DopplerSkyScan for stepping through parameter-space.
Definition at line 4204 of file ComputeFStatistic.c.
| void WriteFStatLog | ( | LALStatus * | stat, | |
| char * | argv[] | |||
| ) |
Log the all relevant parameters of the present search-run to a log-file.
The name of the log-file is "Fstats{uvar_outputLabel}.log". NOTE: Currently this function only logs the user-input and code-versions.
Definition at line 2882 of file ComputeFStatistic.c.
| void swapheader | ( | struct headertag * | thisheader | ) |
Definition at line 3638 of file ComputeFStatistic.c.
| void getCheckpointCounters | ( | LALStatus * | stat, | |
| UINT4 * | loopcounter, | |||
| UINT4 * | checksum, | |||
| long * | bytecounter, | |||
| const CHAR * | fstat_fname, | |||
| const CHAR * | ckpfn | |||
| ) |
Check presence and consistency of checkpoint-file and use to set loopcounter if valid.
The name of the checkpoint-file is <fname>.ckp
| OUT] | loopcounter number of completed loops (refers to main-loop in main()) | |
| OUT] | checksum checksum of file (up the bytecounter bytes) | |
| OUT] | bytecounter bytes nominally written to fstats file (for consistency-check) | |
| IN] | fstat_fname Name of Fstats-file. |
Definition at line 4040 of file ComputeFStatistic.c.
| int debug_dump_commandline | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Definition at line 4252 of file ComputeFStatistic.c.
| int is_zip_file | ( | const char * | fname | ) |
Definition at line 4269 of file ComputeFStatistic.c.
| void ourREPORTSTATUS | ( | LALStatus * | ) |
Definition at line 385 of file ComputeFStatistic.c.
Definition at line 214 of file ComputeFStatistic.c.
Definition at line 215 of file ComputeFStatistic.c.
Definition at line 216 of file ComputeFStatistic.c.
Definition at line 217 of file ComputeFStatistic.c.
Definition at line 218 of file ComputeFStatistic.c.
Definition at line 219 of file ComputeFStatistic.c.
Definition at line 220 of file ComputeFStatistic.c.
Definition at line 221 of file ComputeFStatistic.c.
Definition at line 222 of file ComputeFStatistic.c.
Definition at line 223 of file ComputeFStatistic.c.
Definition at line 224 of file ComputeFStatistic.c.
Definition at line 225 of file ComputeFStatistic.c.
Definition at line 226 of file ComputeFStatistic.c.
Definition at line 227 of file ComputeFStatistic.c.
Definition at line 228 of file ComputeFStatistic.c.
Definition at line 229 of file ComputeFStatistic.c.
Definition at line 230 of file ComputeFStatistic.c.
Definition at line 231 of file ComputeFStatistic.c.
Definition at line 232 of file ComputeFStatistic.c.
Definition at line 233 of file ComputeFStatistic.c.
Definition at line 234 of file ComputeFStatistic.c.
Definition at line 235 of file ComputeFStatistic.c.
Definition at line 236 of file ComputeFStatistic.c.
Definition at line 237 of file ComputeFStatistic.c.
Definition at line 238 of file ComputeFStatistic.c.
Definition at line 239 of file ComputeFStatistic.c.
Definition at line 240 of file ComputeFStatistic.c.
Definition at line 241 of file ComputeFStatistic.c.
Definition at line 242 of file ComputeFStatistic.c.
Definition at line 243 of file ComputeFStatistic.c.
Definition at line 244 of file ComputeFStatistic.c.
Definition at line 245 of file ComputeFStatistic.c.
Definition at line 246 of file ComputeFStatistic.c.
Definition at line 247 of file ComputeFStatistic.c.
Definition at line 248 of file ComputeFStatistic.c.
Definition at line 249 of file ComputeFStatistic.c.
Definition at line 250 of file ComputeFStatistic.c.
Definition at line 251 of file ComputeFStatistic.c.
Definition at line 252 of file ComputeFStatistic.c.
Definition at line 253 of file ComputeFStatistic.c.
Definition at line 254 of file ComputeFStatistic.c.
Definition at line 259 of file ComputeFStatistic.c.
Definition at line 260 of file ComputeFStatistic.c.
Definition at line 261 of file ComputeFStatistic.c.
Definition at line 263 of file ComputeFStatistic.c.
Definition at line 264 of file ComputeFStatistic.c.
output from LALDemod(): F-statistic and amplitudes Fa and Fb
Definition at line 273 of file ComputeFStatistic.c.
amplitude-modulation coefficients (and derived quantities)
Definition at line 274 of file ComputeFStatistic.c.
stores information about outliers/clusters in F-statistic
Definition at line 275 of file ComputeFStatistic.c.
stores information about outliers/clusters in SFT-power spectrum
Definition at line 276 of file ComputeFStatistic.c.
Definition at line 277 of file ComputeFStatistic.c.
| Clusters * highFLines = &HFLines |
Definition at line 277 of file ComputeFStatistic.c.
| REAL8 medianbias = 1.0 |
| FILE* fp_mergedSFT |