Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-3a66518
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ComputePSD.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007, 2010 Karl Wette
3* Copyright (C) 2007 Badri Krishnan, Iraj Gholami, Reinhard Prix, Alicia Sintes
4*
5* This program is free software; you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation; either version 2 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with with program; see the file COPYING. If not, write to the
17* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18* MA 02110-1301 USA
19*/
20
21/**
22 * \file
23 * \ingroup lalpulsar_bin_SFTTools
24 * \author Badri Krishnan, Iraj Gholami, Reinhard Prix, Alicia Sintes, Karl Wette
25 * \brief Compute power spectral densities
26 */
27
28#include "config.h"
29
30#include <glob.h>
31#include <stdlib.h>
32#include <math.h>
33#include <stdio.h>
34#include <stdlib.h>
35#include <string.h>
36
37#include <gsl/gsl_sort.h>
38#include <gsl/gsl_math.h>
39
40#include <lal/LALStdlib.h>
41#include <lal/LALConstants.h>
42#include <lal/AVFactories.h>
43#include <lal/SeqFactories.h>
44#include <lal/SFTfileIO.h>
45#include <lal/Random.h>
46#include <lal/PulsarDataTypes.h>
47#include <lal/UserInput.h>
48#include <lal/NormalizeSFTRngMed.h>
49#include <lal/LALInitBarycenter.h>
50#include <lal/SFTClean.h>
51#include <lal/Segments.h>
52#include <lal/FrequencySeries.h>
53#include <lal/Units.h>
54#include <lal/LogPrintf.h>
55#include <lal/LALPulsarVCSInfo.h>
56
57/* ---------- Error codes and messages ---------- */
58#define COMPUTEPSDC_ENORM 0
59#define COMPUTEPSDC_ESUB 1
60#define COMPUTEPSDC_EARG 2
61#define COMPUTEPSDC_EBAD 3
62#define COMPUTEPSDC_EFILE 4
63#define COMPUTEPSDC_ENULL 5
64#define COMPUTEPSDC_EMEM 6
65
66#define COMPUTEPSDC_MSGENORM "Normal exit"
67#define COMPUTEPSDC_MSGESUB "Subroutine failed"
68#define COMPUTEPSDC_MSGEARG "Error parsing arguments"
69#define COMPUTEPSDC_MSGEBAD "Bad argument values"
70#define COMPUTEPSDC_MSGEFILE "Could not create output file"
71#define COMPUTEPSDC_MSGENULL "Null Pointer"
72#define COMPUTEPSDC_MSGEMEM "Out of memory"
73
74/*---------- local defines ---------- */
75
76#define TRUE (1==1)
77#define FALSE (1==0)
78
79/* ----- Macros ----- */
80
81/* ---------- local types ---------- */
82
83/** user input variables */
84typedef struct {
85 CHAR *inputData; /**< directory for input sfts */
86 CHAR *outputPSD; /**< directory for output sfts */
88
89 REAL8 Freq; /**< *physical* start frequency to compute PSD for (excluding rngmed wings) */
90 REAL8 FreqBand; /**< *physical* frequency band to compute PSD for (excluding rngmed wings) */
91
92 REAL8 startTime; /**< earliest SFT-timestamp to include */
93 REAL8 endTime; /**< last SFT-timestamp to include */
94 CHAR *IFO;
97 INT4 blocksRngMed; /**< number of running-median bins to use */
99
100 INT4 PSDmthopSFTs; /**< for PSD, type of math. operation over SFTs */
101 INT4 PSDmthopIFOs; /**< for PSD, type of math. operation over IFOs */
102 BOOLEAN outputNormSFT; /**< output normalised SFT power? */
103 INT4 nSFTmthopSFTs; /**< for norm. SFT, type of math. operation over SFTs */
104 INT4 nSFTmthopIFOs; /**< for norm. SFT, type of math. operation over IFOs */
105 BOOLEAN normalizeByTotalNumSFTs; /**< apply normalization factor from total number of SFTs over all IFOs */
106
107 REAL8 binSizeHz; /**< output PSD bin size in Hz */
108 INT4 binSize; /**< output PSD bin size in no. of bins */
109 INT4 PSDmthopBins; /**< for PSD, type of math. operation over bins */
110 INT4 nSFTmthopBins; /**< for norm. SFT, type of math. operation over bins */
111 REAL8 binStepHz; /**< output PSD bin step in Hz */
112 INT4 binStep; /**< output PSD bin step in no. of bins */
113 BOOLEAN outFreqBinEnd; /**< output the end frequency of each bin? */
114
115 BOOLEAN dumpMultiPSDVector; /**< output multi-PSD vector over IFOs, timestamps, and frequencies into file(s) */
116 CHAR *outputQ; /**< output the 'data-quality factor' Q(f) into this file */
117
118 REAL8 fStart; /**< Start Frequency to load from SFT and compute PSD, including wings (it is RECOMMENDED to use --Freq instead) */
119 REAL8 fBand; /**< Frequency Band to load from SFT and compute PSD, including wings (it is RECOMMENDED to use --FreqBand instead) */
120
122
123/**
124 * Config variables 'derived' from user-input
125 */
126typedef struct {
127 REAL8 FreqMin; /**< frequency of first PSD bin for output */
128 REAL8 FreqBand; /**< width of frequency band for output */
129 LALSeg dataSegment; /**< the data-segment for which PSD was computed */
131
132/* ---------- global variables ----------*/
133extern int vrbflg;
134
135/* ---------- local prototypes ---------- */
136int initUserVars( int argc, char *argv[], UserVariables_t *uvar );
137void LALfwriteSpectrograms( LALStatus *status, const CHAR *bname, const MultiPSDVector *multiPSD );
139
140int XLALWriteREAL8FrequencySeries_to_file( const REAL8FrequencySeries *series, const char *fname );
141
142/*============================================================
143 * FUNCTION definitions
144 *============================================================*/
145int
146main( int argc, char *argv[] )
147{
148 static LALStatus status; /* LALStatus pointer */
151
152 vrbflg = 1; /* verbose error-messages */
153
154 /* set LAL error-handler */
156
157 /* register and read user variables */
158 if ( initUserVars( argc, argv, &uvar ) != XLAL_SUCCESS ) {
159 return EXIT_FAILURE;
160 }
161
162 MultiSFTVector *inputSFTs = NULL;
163 if ( ( inputSFTs = XLALReadSFTs( &cfg, &uvar ) ) == NULL ) {
164 XLALPrintError( "Call to XLALReadSFTs() failed with xlalErrno = %d\n", xlalErrno );
165 return EXIT_FAILURE;
166 }
167
168 /* clean sfts if required */
169 if ( XLALUserVarWasSet( &uvar.linefiles ) ) {
170 RandomParams *randPar = NULL;
171 FILE *fpRand = NULL;
172 INT4 seed, ranCount;
173
174 if ( ( fpRand = fopen( "/dev/urandom", "r" ) ) == NULL ) {
175 fprintf( stderr, "Error in opening /dev/urandom" );
176 return EXIT_FAILURE;
177 }
178
179 if ( ( ranCount = fread( &seed, sizeof( seed ), 1, fpRand ) ) != 1 ) {
180 fprintf( stderr, "Error in getting random seed" );
181 return EXIT_FAILURE;
182 }
183
184 LAL_CALL( LALCreateRandomParams( &status, &randPar, seed ), &status );
185
186 LAL_CALL( LALRemoveKnownLinesInMultiSFTVector( &status, inputSFTs, uvar.maxBinsClean, uvar.blocksRngMed, uvar.linefiles, randPar ), &status );
187 LAL_CALL( LALDestroyRandomParams( &status, &randPar ), &status );
188 fclose( fpRand );
189 } /* end cleaning */
190
191 /* call the main loop function; output vectors will be allocated inside
192 * NOTE: inputSFTs will be normalized in place for efficiency reasons
193 */
194 REAL8Vector *finalPSD = NULL;
195 MultiPSDVector *multiPSDVector = NULL;
196 REAL8Vector *normSFT = NULL;
197 BOOLEAN returnMultiPSDVector = ( uvar.outputSpectBname || uvar.dumpMultiPSDVector || uvar.outputQ );
199 &multiPSDVector,
200 &normSFT,
201 inputSFTs,
202 returnMultiPSDVector,
203 uvar.outputNormSFT,
204 uvar.blocksRngMed,
205 uvar.PSDmthopSFTs,
206 uvar.PSDmthopIFOs,
207 uvar.nSFTmthopSFTs,
208 uvar.nSFTmthopIFOs,
209 uvar.normalizeByTotalNumSFTs,
210 cfg.FreqMin,
211 cfg.FreqBand,
212 TRUE // normalizeSFTsInPlace
213 ) == XLAL_SUCCESS, XLAL_EFUNC );
214
215 /* output spectrograms */
216 if ( uvar.outputSpectBname ) {
217 LAL_CALL( LALfwriteSpectrograms( &status, uvar.outputSpectBname, multiPSDVector ), &status );
218 }
219
220 /* ---------- if user requested it, output complete MultiPSDVector over IFOs X, timestamps and freq-bins into ASCI file(s) */
221 if ( uvar.dumpMultiPSDVector ) {
222 if ( XLALDumpMultiPSDVector( uvar.outputPSD, multiPSDVector ) != XLAL_SUCCESS ) {
223 XLALPrintError( "%s: XLALDumpMultiPSDVector() failed, xlalErrnor = %d\n", __func__, xlalErrno );
224 return EXIT_FAILURE;
225 }
226 } /* if uvar.dumpMultiPSDVector */
227
228 /* ----- if requested, compute data-quality factor 'Q' -------------------- */
229 if ( uvar.outputQ ) {
231 if ( ( Q = XLALComputeSegmentDataQ( multiPSDVector, cfg.dataSegment ) ) == NULL ) {
232 XLALPrintError( "%s: XLALComputeSegmentDataQ() failed with xlalErrno = %d\n", __func__, xlalErrno );
233 return EXIT_FAILURE;
234 }
235 if ( XLAL_SUCCESS != XLALWriteREAL8FrequencySeries_to_file( Q, uvar.outputQ ) ) {
236 return EXIT_FAILURE;
237 }
239 } /* if outputQ */
240
241 /* ---------- BINNING if requested ---------- */
242 /* start frequency and frequency spacing */
243 REAL8 Freq0 = inputSFTs->data[0]->data[0].f0;
244 REAL8 dFreq = inputSFTs->data[0]->data[0].deltaF;
245 /* work out bin size */
246 UINT4 finalBinSize;
247 if ( XLALUserVarWasSet( &uvar.binSize ) ) {
248 finalBinSize = uvar.binSize;
249 } else if ( XLALUserVarWasSet( &uvar.binSizeHz ) ) {
250 finalBinSize = ( UINT4 )floor( uvar.binSizeHz / dFreq + 0.5 ); /* round to nearest bin */
251 } else {
252 finalBinSize = 1;
253 }
254
255 /* work out bin step */
256 UINT4 finalBinStep;
257 if ( XLALUserVarWasSet( &uvar.binStep ) ) {
258 finalBinStep = uvar.binStep;
259 } else if ( XLALUserVarWasSet( &uvar.binStepHz ) ) {
260 finalBinStep = ( UINT4 )floor( uvar.binStepHz / dFreq + 0.5 ); /* round to nearest bin */
261 } else {
262 finalBinStep = finalBinSize;
263 }
264
265 /* write final PSD to file */
266 if ( XLALUserVarWasSet( &uvar.outputPSD ) ) {
267 LogPrintf( LOG_DEBUG, "Printing PSD to file ...\n" );
268 FILE *fpOut = NULL;
269 XLAL_CHECK_MAIN( ( fpOut = fopen( uvar.outputPSD, "wb" ) ) != NULL, XLAL_EIO, "Unable to open output file %s for writing", uvar.outputPSD );
271 for ( int a = 0; a < argc; a++ ) { /* write the command-line */
272 fprintf( fpOut, "%%%% argv[%d]: '%s'\n", a, argv[a] );
273 }
274 XLAL_CHECK_MAIN( XLALWritePSDtoFilePointer( fpOut, finalPSD, normSFT, uvar.outputNormSFT, uvar.outFreqBinEnd, uvar.PSDmthopBins, uvar.nSFTmthopBins, finalBinSize, finalBinStep, Freq0, dFreq ) == XLAL_SUCCESS, XLAL_EFUNC );
275 LogPrintfVerbatim( LOG_DEBUG, "done.\n" );
276 fclose( fpOut );
277 }
278
279 /* we are now done with the psd */
280 if ( returnMultiPSDVector ) {
281 XLALDestroyMultiPSDVector( multiPSDVector );
282 }
283 XLALDestroyMultiSFTVector( inputSFTs );
284 XLALDestroyREAL8Vector( finalPSD );
285 XLALDestroyREAL8Vector( normSFT );
286
288
290
291 return EXIT_SUCCESS;
292
293} /* main() */
294
295
296/** register all "user-variables" */
297int
298initUserVars( int argc, char *argv[], UserVariables_t *uvar )
299{
300
301 /* set a few defaults */
302 uvar->maxBinsClean = 100;
303 uvar->blocksRngMed = 101;
304
305 uvar->startTime = 0.0;
306 uvar->endTime = 0.0;
307
308 uvar->inputData = NULL;
309
310 uvar->IFO = NULL;
311
312 /* default: read all SFT bins */
313 uvar->fStart = -1;
314 uvar->fBand = 0;
315
316 uvar->outputPSD = NULL;
317 uvar->outputNormSFT = FALSE;
318 uvar->outFreqBinEnd = FALSE;
319
322
325
327
329
330 uvar->binSizeHz = 0.0;
331 uvar->binSize = 1;
334 uvar->binStep = 0.0;
335 uvar->binStep = 1;
336
337 /* register user input variables */
338 XLALRegisterUvarMember( inputData, STRING, 'i', REQUIRED, "Input SFT pattern. Possibilities are:\n"
339 " - '<SFT file>;<SFT file>;...', where <SFT file> may contain wildcards\n - 'list:<file containing list of SFT files>'" );
340 XLALRegisterUvarMember( outputPSD, STRING, 'o', OPTIONAL, "Output PSD into this file" );
341 XLALRegisterUvarMember( outputQ, STRING, 0, OPTIONAL, "Output the 'data-quality factor' Q(f) into this file" );
342 XLALRegisterUvarMember( outputSpectBname, STRING, 0, OPTIONAL, "Filename-base for (binary) spectrograms (one per IFO)" );
343
344 XLALRegisterUvarMember( Freq, REAL8, 0, OPTIONAL, "physical start frequency to compute PSD for (excluding rngmed wings)" );
345 XLALRegisterUvarMember( FreqBand, REAL8, 0, OPTIONAL, "physical frequency band to compute PSD for (excluding rngmed wings)" );
346
347 XLALRegisterUvarMember( startTime, REAL8, 's', OPTIONAL, "SFT timestamps must be >= this GPS timestamp" );
348 XLALRegisterUvarMember( endTime, REAL8, 'e', OPTIONAL, "SFT timestamps must be < this GPS timestamp" );
349 XLALRegisterUvarMember( timeStampsFile, STRING, 't', OPTIONAL, "Time-stamps file" );
350 XLALRegisterUvarMember( IFO, STRING, 0, OPTIONAL, "Detector filter" );
351
352 XLALRegisterUvarMember( blocksRngMed, INT4, 'w', OPTIONAL, "Running Median window size" );
353
354 XLALRegisterUvarAuxDataMember( PSDmthopSFTs, UserEnum, &MathOpTypeChoices, 'S', OPTIONAL, "For PSD, type of math. operation over SFTs, can be given by string names (preferred) or legacy numbers: \n"
355 "arithsum (0), arithmean (1), arithmedian (2), "
356 "harmsum (3), harmmean (4), "
357 "powerminus2sum (5), powerminus2mean (6), "
358 "min (7), max (8)" );
359 XLALRegisterUvarAuxDataMember( PSDmthopIFOs, UserEnum, &MathOpTypeChoices, 'I', OPTIONAL, "For PSD, type of math. op. over IFOs: "
360 "see --PSDmthopSFTs" );
361 XLALRegisterUvarMember( outputNormSFT, BOOLEAN, 'n', OPTIONAL, "Output normalised SFT power to PSD file" );
362 XLALRegisterUvarAuxDataMember( nSFTmthopSFTs, UserEnum, &MathOpTypeChoices, 'N', OPTIONAL, "For norm. SFT, type of math. op. over SFTs: "
363 "see --PSDmthopSFTs" );
364 XLALRegisterUvarAuxDataMember( nSFTmthopIFOs, UserEnum, &MathOpTypeChoices, 'J', OPTIONAL, "For norm. SFT, type of math. op. over IFOs: "
365 "see --PSDmthopSFTs" );
366
367 XLALRegisterUvarMember( normalizeByTotalNumSFTs, BOOLEAN, 0, OPTIONAL, "For harmsum/powerminus2sum, apply normalization factor from total number of SFTs over all IFOs (mimics harmmean/powerminus2mean over a combined set of all SFTs)" );
368
369 XLALRegisterUvarMember( binSize, INT4, 'z', OPTIONAL, "Bin the output into bins of size (in number of bins)" );
370 XLALRegisterUvarMember( binSizeHz, REAL8, 'Z', OPTIONAL, "Bin the output into bins of size (in Hz)" );
371 XLALRegisterUvarAuxDataMember( PSDmthopBins, UserEnum, &MathOpTypeChoices, 'A', OPTIONAL, "If binning, for PSD type of math. op. over bins: "
372 "see --PSDmthopSFTs" );
373 XLALRegisterUvarAuxDataMember( nSFTmthopBins, UserEnum, &MathOpTypeChoices, 'B', OPTIONAL, "If binning, for norm. SFT type of math. op. over bins: "
374 "see --PSDmthopSFTs" );
375 XLALRegisterUvarMember( binStep, INT4, 'p', OPTIONAL, "If binning, step size to move bin along "
376 "(in number of bins, default is bin size)" );
377 XLALRegisterUvarMember( binStepHz, REAL8, 'P', OPTIONAL, "If binning, step size to move bin along "
378 "(in Hz, default is bin size)" );
379 XLALRegisterUvarMember( outFreqBinEnd, BOOLEAN, 'E', OPTIONAL, "Output the end frequency of each bin" );
380
381 XLALRegisterUvarMember( maxBinsClean, INT4, 'm', OPTIONAL, "Maximum Cleaning Bins" );
382 XLALRegisterUvarMember( linefiles, STRINGVector, 0, OPTIONAL, "Comma separated list of linefiles "
383 "(names must contain IFO name)" );
384
385 XLALRegisterUvarMember( dumpMultiPSDVector, BOOLEAN, 'd', OPTIONAL, "Output multi-PSD vector over IFOs, timestamps, and frequencies into file(s) '<outputPSD>-IFO'" );
386
387 /* ----- developer options ---------- */
388 XLALRegisterUvarMember( fStart, REAL8, 'f', DEVELOPER, "Start Frequency to load from SFT and compute PSD, including rngmed wings (BETTER: use --Freq instead)" );
389 XLALRegisterUvarMember( fBand, REAL8, 'b', DEVELOPER, "Frequency Band to load from SFT and compute PSD, including rngmed wings (BETTER: use --FreqBand instead)" );
390
391
392 /* read all command line variables */
393 BOOLEAN should_exit = 0;
395 if ( should_exit ) {
396 exit( 1 );
397 }
398
399 /* check user-input consistency */
400 if ( XLALUserVarWasSet( &( uvar->PSDmthopSFTs ) ) && !( 0 <= uvar->PSDmthopSFTs && uvar->PSDmthopSFTs < MATH_OP_LAST ) ) {
401 XLALPrintError( "ERROR: --PSDmthopSFTs(-S) must be between 0 and %i", MATH_OP_LAST - 1 );
402 return XLAL_FAILURE;
403 }
404 if ( XLALUserVarWasSet( &( uvar->PSDmthopIFOs ) ) && !( 0 <= uvar->PSDmthopIFOs && uvar->PSDmthopIFOs < MATH_OP_LAST ) ) {
405 XLALPrintError( "ERROR: --PSDmthopIFOs(-I) must be between 0 and %i", MATH_OP_LAST - 1 );
406 return XLAL_FAILURE;
407 }
408 if ( XLALUserVarWasSet( &( uvar->nSFTmthopSFTs ) ) && !( 0 <= uvar->nSFTmthopSFTs && uvar->nSFTmthopSFTs < MATH_OP_LAST ) ) {
409 XLALPrintError( "ERROR: --nSFTmthopSFTs(-N) must be between 0 and %i", MATH_OP_LAST - 1 );
410 return XLAL_FAILURE;
411 }
412 if ( XLALUserVarWasSet( &( uvar->nSFTmthopIFOs ) ) && !( 0 <= uvar->nSFTmthopIFOs && uvar->nSFTmthopIFOs < MATH_OP_LAST ) ) {
413 XLALPrintError( "ERROR: --nSFTmthopIFOs(-J) must be between 0 and %i", MATH_OP_LAST - 1 );
414 return XLAL_FAILURE;
415 }
416 if ( XLALUserVarWasSet( &( uvar->PSDmthopBins ) ) && !( 0 <= uvar->PSDmthopBins && uvar->PSDmthopBins < MATH_OP_LAST ) ) {
417 XLALPrintError( "ERROR: --PSDmthopBins(-A) must be between 0 and %i", MATH_OP_LAST - 1 );
418 return XLAL_FAILURE;
419 }
420 if ( XLALUserVarWasSet( &( uvar->nSFTmthopBins ) ) && !( 0 <= uvar->nSFTmthopBins && uvar->nSFTmthopBins < MATH_OP_LAST ) ) {
421 XLALPrintError( "ERROR: --nSFTmthopBins(-B) must be between 0 and %i", MATH_OP_LAST - 1 );
422 return XLAL_FAILURE;
423 }
424 if ( XLALUserVarWasSet( &( uvar->binSize ) ) && XLALUserVarWasSet( &( uvar->binSizeHz ) ) ) {
425 XLALPrintError( "ERROR: --binSize(-z) and --binSizeHz(-Z) are mutually exclusive" );
426 return XLAL_FAILURE;
427 }
428 if ( XLALUserVarWasSet( &( uvar->binSize ) ) && uvar->binSize <= 0 ) {
429 XLALPrintError( "ERROR: --binSize(-z) must be strictly positive" );
430 return XLAL_FAILURE;
431 }
432 if ( XLALUserVarWasSet( &( uvar->binSizeHz ) ) && uvar->binSizeHz <= 0.0 ) {
433 XLALPrintError( "ERROR: --binSizeHz(-Z) must be strictly positive" );
434 return XLAL_FAILURE;
435 }
436 if ( XLALUserVarWasSet( &( uvar->binStep ) ) && XLALUserVarWasSet( &( uvar->binStepHz ) ) ) {
437 XLALPrintError( "ERROR: --binStep(-p) and --binStepHz(-P) are mutually exclusive" );
438 return XLAL_FAILURE;
439 }
440 if ( XLALUserVarWasSet( &( uvar->binStep ) ) && uvar->binStep <= 0 ) {
441 XLALPrintError( "ERROR: --binStep(-p) must be strictly positive" );
442 return XLAL_FAILURE;
443 }
444 if ( XLALUserVarWasSet( &( uvar->binStepHz ) ) && uvar->binStepHz <= 0.0 ) {
445 XLALPrintError( "ERROR: --binStepHz(-P) must be strictly positive" );
446 return XLAL_FAILURE;
447 }
448 BOOLEAN have_fStart = XLALUserVarWasSet( &uvar->fStart );
449 BOOLEAN have_Freq = XLALUserVarWasSet( &uvar->Freq );
450 BOOLEAN have_fBand = XLALUserVarWasSet( &uvar->fBand );
451 BOOLEAN have_FreqBand = XLALUserVarWasSet( &uvar->FreqBand );
452 XLAL_CHECK( !( have_fStart && have_Freq ), XLAL_EINVAL, "use only one of --fStart OR --Freq (see --help)" );
453 XLAL_CHECK( !( have_fBand && have_FreqBand ), XLAL_EINVAL, "use only one of --fBand OR --FreqBand (see --help)" );
454 XLAL_CHECK( !( ( have_fStart && have_FreqBand ) || ( have_Freq && have_fBand ) ), XLAL_EINVAL, "don't mix {--fStart,--fBand} with {--Freq,--FreqBand} inputs (see --help)" );
455
456 return XLAL_SUCCESS;
457
458} /* initUserVars() */
459
460
461/**
462 * Write a multi-PSD into spectrograms for each IFO.
463 * Using gnuplot 'binary' matrix format
464 * The filename for each IFO is generated as 'bname-IFO'
465 */
466void
467LALfwriteSpectrograms( LALStatus *status, const CHAR *bname, const MultiPSDVector *multiPSD )
468{
469 CHAR *fname;
470 float num, *row_data; /* cast to float for writing (gnuplot binary format) */
471 FILE *fp;
472
475
476 if ( !bname || !multiPSD || multiPSD->length == 0 ) {
478 }
479
480 /* loop over IFOs */
481 for ( UINT4 X = 0; X < multiPSD->length ; X ++ ) {
482 UINT4 len = strlen( bname ) + 4; /* append '-XN' to get IFO-specific filename */
483 const CHAR *tmp;
484 REAL8 f0, df;
485
486 UINT4 numSFTs = multiPSD->data[X]->length;
487 UINT4 numBins = multiPSD->data[X]->data[0].data->length;
488
489 /* allocate memory for data row-vector */
490 if ( ( row_data = LALMalloc( numBins * sizeof( float ) ) ) == NULL ) {
492 }
493
494 if ( ( fname = LALMalloc( len * sizeof( CHAR ) ) ) == NULL ) {
495 LALFree( row_data );
497 }
498 tmp = multiPSD->data[X]->data[0].name;
499 sprintf( fname, "%s-%c%c", bname, tmp[0], tmp[1] );
500
501 if ( ( fp = fopen( fname, "wb" ) ) == NULL ) {
502 LogPrintf( LOG_CRITICAL, "Failed to open spectrogram file '%s' for writing!\n", fname );
503 goto failed;
504 }
505
506 /* write number of columns: i.e. frequency-bins */
507 num = ( float )numBins;
508 if ( ( fwrite( ( char * ) &num, sizeof( float ), 1, fp ) ) != 1 ) {
509 LogPrintf( LOG_CRITICAL, "Failed to fwrite() to spectrogram file '%s'\n", fname );
510 goto failed;
511 }
512
513 /* write frequencies as column-titles */
514 f0 = multiPSD->data[X]->data[0].f0;
515 df = multiPSD->data[X]->data[0].deltaF;
516 for ( UINT4 k = 0; k < numBins; k ++ ) {
517 row_data[k] = ( float )( f0 + 1.0 * k * df );
518 }
519 if ( fwrite( ( char * ) row_data, sizeof( float ), numBins, fp ) != numBins ) {
520 LogPrintf( LOG_CRITICAL, "Failed to fwrite() to spectrogram file '%s'\n", fname );
521 goto failed;
522 }
523
524 /* write PSDs of successive SFTs in rows, first column is GPS-time in seconds */
525 for ( UINT4 j = 0; j < numSFTs ; j ++ ) {
526 num = ( float ) multiPSD->data[X]->data[j].epoch.gpsSeconds;
527 for ( UINT4 k = 0; k < numBins; k ++ ) {
528 row_data[k] = ( float ) sqrt( multiPSD->data[X]->data[j].data->data[k] );
529 }
530
531 if ( ( fwrite( ( char * ) &num, sizeof( float ), 1, fp ) != 1 ) ||
532 ( fwrite( ( char * ) row_data, sizeof( float ), numBins, fp ) != numBins ) ) {
533 LogPrintf( LOG_CRITICAL, "Failed to fwrite() to spectrogram file '%s'\n", fname );
534 goto failed;
535 }
536
537 } /* for j < numSFTs */
538
539 fclose( fp );
540 LALFree( fname );
541 LALFree( row_data );
542
543 } /* for X < numIFOs */
544
546 RETURN( status );
547
548 /* cleanup and exit on write-error */
549failed:
550 if ( fname ) {
551 LALFree( fname );
552 }
553 if ( row_data ) {
554 LALFree( row_data );
555 }
556 if ( fp ) {
557 fclose( fp );
558 }
560
561} /* LALfwriteSpectrograms() */
562
563
564/**
565 * Load all SFTs according to user-input, returns multi-SFT vector.
566 * \return cfg:
567 * Returns 'effective' range of SFT-bins [firstBin, lastBin], which which the PSD will be estimated:
568 * - if the user input {fStart, fBand} then these are loaded from SFTs and directly translated into bins
569 * - if user input {Freq, FreqBand}, we load a wider frequency-band ADDING running-median/2 on either side
570 * from the SFTs, and firstBind, lastBin correspond to {Freq,FreqBand} (rounded to closest bins)
571 * Also returns the 'data-segment' for which SFTs were loaded
572 *
573 */
575XLALReadSFTs( ConfigVariables_t *cfg, /**< [out] return derived configuration info (firstBin, lastBin, segment) */
576 const UserVariables_t *uvar /**< [in] complete user-input */
577 )
578{
579 SFTCatalog *catalog = NULL;
580 SFTConstraints XLAL_INIT_DECL( constraints );
581 LIGOTimeGPS startTimeGPS = {0, 0}, endTimeGPS = {0, 0};
582 LIGOTimeGPSVector *inputTimeStampsVector = NULL;
583
584 /* check input */
585 if ( !uvar || !uvar->inputData ) {
586 XLALPrintError( "%s: invalid NULL input 'uvar' or 'uvar->inputData'\n", __func__ );
588 }
589 if ( !cfg ) {
590 XLALPrintError( "%s: invalid NULL input 'cfg'", __func__ );
592 }
593
594 /* set detector constraint */
595 if ( XLALUserVarWasSet( &uvar->IFO ) ) {
596 constraints.detector = uvar->IFO;
597 } else {
598 constraints.detector = NULL;
599 }
600
601 if ( XLALUserVarWasSet( &uvar->startTime ) ) {
602 XLALGPSSetREAL8( &startTimeGPS, uvar->startTime );
603 constraints.minStartTime = &startTimeGPS;
604 }
605
606 if ( XLALUserVarWasSet( &uvar->endTime ) ) {
607 XLALGPSSetREAL8( &endTimeGPS, uvar->endTime );
608 constraints.maxStartTime = &endTimeGPS;
609 }
610
611 if ( XLALUserVarWasSet( &uvar->timeStampsFile ) ) {
612 if ( ( inputTimeStampsVector = XLALReadTimestampsFile( uvar->timeStampsFile ) ) == NULL ) {
614 }
615
616 constraints.timestamps = inputTimeStampsVector;
617 }
618
619 /* get sft catalog */
620 LogPrintf( LOG_DEBUG, "Finding all SFTs to load ... " );
621 if ( ( catalog = XLALSFTdataFind( uvar->inputData, &constraints ) ) == NULL ) {
622 XLALPrintError( "%s: XLALSFTdataFind() failed with xlalErrno = %d\n", __func__, xlalErrno );
624 }
625 if ( ( catalog == NULL ) || ( catalog->length == 0 ) ) {
626 XLALPrintError( "%s: Unable to match any SFTs with pattern '%s'\n", __func__, uvar->inputData );
628 }
629 LogPrintfVerbatim( LOG_DEBUG, "done (found %i SFTs).\n", catalog->length );
630
631 /* now we can free the inputTimeStampsVector */
632 if ( inputTimeStampsVector ) {
633 XLALDestroyTimestampVector( inputTimeStampsVector );
634 }
635
636 /* ---------- figure out the right frequency-band to read from the SFTs, depending on user-input ----- */
637 REAL8 fMin, fMax;
638 if ( XLALUserVarWasSet( &uvar->Freq ) ) {
639 REAL8 dFreq = catalog->data[0].header.deltaF;
640 /* rngmed bin offset from start and end */
641 UINT4 rngmedSideBandBins = uvar->blocksRngMed / 2 + 1; /* truncates down plus add one bin extra safety! */
642 REAL8 rngmedSideBand = rngmedSideBandBins * dFreq;
643 fMin = uvar->Freq - rngmedSideBand;
644 fMax = uvar->Freq + uvar->FreqBand + rngmedSideBand;
645 cfg->FreqMin = uvar->Freq;
646 cfg->FreqBand = uvar->FreqBand;
647 } else {
648 /* if no user-input on freq-band, we fall back to defaults on {fStart, fBand} */
649 /* (no truncation of rngmed sidebands) */
650 fMin = uvar->fStart;
651 fMax = uvar->fStart + uvar->fBand;
652 cfg->FreqMin = uvar->fStart;
653 cfg->FreqBand = uvar->fBand;
654 }
655
656 /* ----- figure out the data-segment span from the user-input and SFT-catalog ----- */
657 /* if used passed these, then 'startTimeGPS' and 'endTimeGPS' are already set */
658 if ( startTimeGPS.gpsSeconds == 0 ) {
659 startTimeGPS = catalog->data[0].header.epoch;
660 }
661 if ( endTimeGPS.gpsSeconds == 0 ) {
662 endTimeGPS = catalog->data[catalog->length - 1].header.epoch;
663 }
664 /* SFT 'constraints' only refer to SFT *start-times*, for segment we need the end-time */
665 REAL8 deltaF = catalog->data[0].header.deltaF;
666 REAL8 Tsft = 1.0 / deltaF;
667 XLALGPSAdd( &endTimeGPS, Tsft );
668
669 /* ---------- read the sfts ---------- */
670 LogPrintf( LOG_DEBUG, "Loading all SFTs over frequency band [%f,%f]...\n", fMin, fMax );
671 MultiSFTVector *multi_sfts;
672 if ( ( multi_sfts = XLALLoadMultiSFTs( catalog, fMin, fMax ) ) == NULL ) {
673 XLALPrintError( "%s: XLALLoadMultiSFTs( %f, %f ) failed with xlalErrno = %d\n", __func__, fMin, fMax, xlalErrno );
675 }
676 XLALDestroySFTCatalog( catalog );
677 LogPrintfVerbatim( LOG_DEBUG, "done.\n" );
678 /* ---------- end loading SFTs ---------- */
679
680 /* return results */
681 cfg->dataSegment.start = startTimeGPS;
682 cfg->dataSegment.end = endTimeGPS;
683
684 UINT4 numBins = multi_sfts->data[0]->data[0].data->length;
685 REAL8 f0sfts = multi_sfts->data[0]->data[0].f0;
686 LogPrintf( LOG_DEBUG, "Loaded SFTs have %d bins, sampled at %fHz, covering frequency band [%f, %f]\n", numBins, deltaF, f0sfts, f0sfts + numBins * deltaF );
687
688 return multi_sfts;
689
690} /* XLALReadSFTs() */
691
692
693/**
694 * Write given REAL8FrequencySeries into file
695 */
696int
697XLALWriteREAL8FrequencySeries_to_file( const REAL8FrequencySeries *series, /**< [in] frequency-series to write to file */
698 const char *fname /**< [in] filename to write into */
699 )
700{
701 /* check input consistency */
702 if ( !series || !fname ) {
703 XLALPrintError( "%s: invalid NULL input.\n", __func__ );
705 }
706
707 FILE *fp;
708 if ( ( fp = fopen( fname, "wb" ) ) == NULL ) {
709 XLALPrintError( "%s: failed to open file '%s' for writing.\n", __func__, fname );
711 }
712
713 /* write header info in comments */
714 if ( XLAL_SUCCESS != XLALOutputVCSInfo( fp, lalPulsarVCSInfoList, 0, "%% " ) ) {
716 }
717
718 fprintf( fp, "%%%% name = '%s'\n", series->name );
719 fprintf( fp, "%%%% epoch = {%d, %d}\n", series->epoch.gpsSeconds, series->epoch.gpsNanoSeconds );
720 fprintf( fp, "%%%% f0 = %f Hz\n", series->f0 );
721 fprintf( fp, "%%%% deltaF = %g Hz\n", series->deltaF );
722
723 CHAR unitStr[1024];
724 if ( XLALUnitAsString( &unitStr[0], sizeof( unitStr ) - 1, &series->sampleUnits ) == NULL ) {
725 XLALPrintError( "%s: XLALUnitAsString() failed with xlalErrno = %d.\n", __func__, xlalErrno );
727 }
728 fprintf( fp, "%%%% Units = %s\n", unitStr );
729
730 fprintf( fp, "%%%% Freq [Hz] Data(Freq)\n" );
731 UINT4 numBins = series->data->length;
732 for ( UINT4 iFreq = 0; iFreq < numBins; iFreq ++ ) {
733 REAL8 thisFreq = series->f0 + iFreq * series->deltaF;
734 fprintf( fp, "%20.16f %20.16g\n", thisFreq, series->data->data[iFreq] );
735 }
736
737 fclose( fp );
738
739 return XLAL_SUCCESS;
740
741} /* XLALWriteREAL8FrequencySeries_to_file() */
int main(int argc, char *argv[])
Definition: ComputePSD.c:146
MultiSFTVector * XLALReadSFTs(ConfigVariables_t *cfg, const UserVariables_t *uvar)
Load all SFTs according to user-input, returns multi-SFT vector.
Definition: ComputePSD.c:575
#define COMPUTEPSDC_EFILE
Definition: ComputePSD.c:62
int initUserVars(int argc, char *argv[], UserVariables_t *uvar)
register all "user-variables"
Definition: ComputePSD.c:298
#define COMPUTEPSDC_EMEM
Definition: ComputePSD.c:64
int XLALWriteREAL8FrequencySeries_to_file(const REAL8FrequencySeries *series, const char *fname)
Write given REAL8FrequencySeries into file.
Definition: ComputePSD.c:697
int vrbflg
defined in lal/lib/std/LALError.c
#define TRUE
Definition: ComputePSD.c:76
#define FALSE
Definition: ComputePSD.c:77
#define COMPUTEPSDC_MSGEFILE
Definition: ComputePSD.c:70
#define COMPUTEPSDC_ENULL
Definition: ComputePSD.c:63
#define COMPUTEPSDC_MSGENULL
Definition: ComputePSD.c:71
#define COMPUTEPSDC_MSGEMEM
Definition: ComputePSD.c:72
void LALfwriteSpectrograms(LALStatus *status, const CHAR *bname, const MultiPSDVector *multiPSD)
Write a multi-PSD into spectrograms for each IFO.
Definition: ComputePSD.c:467
#define __func__
log an I/O error, i.e.
#define IFO
lal_errhandler_t lal_errhandler
int LAL_ERR_EXIT(LALStatus *stat, const char *func, const char *file, const int line, volatile const char *id)
#define LAL_CALL(function, statusptr)
int j
int k
void LALCheckMemoryLeaks(void)
#define LALMalloc(n)
#define LALFree(p)
const LALVCSInfoList lalPulsarVCSInfoList
NULL-terminated list of VCS and build information for LALPulsar and its dependencies
#define ABORT(statusptr, code, mesg)
#define ATTATCHSTATUSPTR(statusptr)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
#define STRING(a)
#define fprintf
const double Q
void XLALDestroyREAL8FrequencySeries(REAL8FrequencySeries *series)
unsigned char BOOLEAN
double REAL8
#define XLAL_INIT_DECL(var,...)
char CHAR
uint32_t UINT4
int32_t INT4
int XLALOutputVCSInfo(FILE *fp, const LALVCSInfoList vcs_list, const int verbose, const char *prefix)
void void LogPrintfVerbatim(LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
void LogPrintf(LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
LOG_CRITICAL
LOG_DEBUG
int XLALDumpMultiPSDVector(const CHAR *outbname, const MultiPSDVector *multiPSDVect)
Dump complete multi-PSDVector over IFOs, timestamps and frequency-bins into per-IFO ASCII output-file...
Definition: PSDutils.c:936
int XLALWritePSDtoFilePointer(FILE *fpOut, REAL8Vector *PSDVect, REAL8Vector *normSFTVect, BOOLEAN outputNormSFT, BOOLEAN outFreqBinEnd, INT4 PSDmthopBins, INT4 nSFTmthopBins, INT4 binSize, INT4 binStep, REAL8 Freq0, REAL8 dFreq)
Write a PSD vector as an ASCII table to an open output file pointer.
Definition: PSDutils.c:1056
const UserChoices MathOpTypeChoices
Definition: PSDutils.c:44
void XLALDestroyMultiPSDVector(MultiPSDVector *multvect)
Destroy a multi PSD-vector.
Definition: PSDutils.c:102
int XLALComputePSDandNormSFTPower(REAL8Vector **finalPSD, MultiPSDVector **multiPSDVector, REAL8Vector **normSFT, MultiSFTVector *inputSFTs, const BOOLEAN returnMultiPSDVector, const BOOLEAN returnNormSFT, const UINT4 blocksRngMed, const MathOpType PSDmthopSFTs, const MathOpType PSDmthopIFOs, const MathOpType nSFTmthopSFTs, const MathOpType nSFTmthopIFOs, const BOOLEAN normalizeByTotalNumSFTs, const REAL8 FreqMin, const REAL8 FreqBand, const BOOLEAN normalizeSFTsInPlace)
Compute the PSD (power spectral density) and the "normalized power" over a MultiSFTVector.
Definition: PSDutils.c:677
REAL8FrequencySeries * XLALComputeSegmentDataQ(const MultiPSDVector *multiPSDVect, LALSeg segment)
Compute the "data-quality factor" over the given SFTs.
Definition: PSDutils.c:375
@ MATH_OP_HARMONIC_SUM
Definition: PSDutils.h:86
@ MATH_OP_HARMONIC_MEAN
Definition: PSDutils.h:87
@ MATH_OP_MAXIMUM
Definition: PSDutils.h:91
@ MATH_OP_LAST
Definition: PSDutils.h:92
@ MATH_OP_ARITHMETIC_MEDIAN
Definition: PSDutils.h:85
@ MATH_OP_ARITHMETIC_MEAN
Definition: PSDutils.h:84
void LALCreateRandomParams(LALStatus *status, RandomParams **params, INT4 seed)
static const INT4 a
void LALDestroyRandomParams(LALStatus *status, RandomParams **params)
void LALRemoveKnownLinesInMultiSFTVector(LALStatus *status, MultiSFTVector *MultiSFTVect, INT4 width, INT4 window, LALStringVector *linefiles, RandomParams *randPar)
top level function to remove lines from a multi sft vector given a list of files containing list of k...
Definition: lib/SFTClean.c:953
void XLALDestroySFTCatalog(SFTCatalog *catalog)
Free an 'SFT-catalogue'.
Definition: SFTcatalog.c:329
MultiSFTVector * XLALLoadMultiSFTs(const SFTCatalog *inputCatalog, REAL8 fMin, REAL8 fMax)
Function to load a catalog of SFTs from possibly different detectors.
Definition: SFTfileIO.c:416
void XLALDestroyMultiSFTVector(MultiSFTVector *multvect)
Destroy a multi SFT-vector.
Definition: SFTtypes.c:424
SFTCatalog * XLALSFTdataFind(const CHAR *file_pattern, const SFTConstraints *constraints)
Find the list of SFTs matching the file_pattern and satisfying the given constraints,...
Definition: SFTcatalog.c:71
LIGOTimeGPSVector * XLALReadTimestampsFile(const CHAR *fname)
backwards compatible wrapper to XLALReadTimestampsFileConstrained() without GPS-time constraints
void XLALDestroyTimestampVector(LIGOTimeGPSVector *vect)
De-allocate a LIGOTimeGPSVector.
Definition: SFTtimestamps.c:69
char * XLALUnitAsString(char *string, UINT4 length, const LALUnit *input)
int XLALUserVarReadAllInput(BOOLEAN *should_exit, int argc, char *argv[], const LALVCSInfoList vcs_list)
void XLALDestroyUserVars(void)
#define XLALRegisterUvarMember(name, type, option, category,...)
int XLALUserVarWasSet(const void *cvar)
#define XLALRegisterUvarAuxDataMember(name, type, cdata, option, category,...)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
#define XLAL_ERROR_NULL(...)
#define xlalErrno
#define XLAL_ERROR(...)
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_MAIN(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_SUCCESS
XLAL_EFUNC
XLAL_EIO
XLAL_ESYS
XLAL_EINVAL
XLAL_EFAILED
XLAL_FAILURE
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
int deltaF
fStart
COMPLEX8Sequence * data
COMPLEX8FrequencySeries * data
Pointer to the data array.
Config variables 'derived' from user-input.
Definition: ComputePSD.c:126
LALSeg dataSegment
the data-segment for which PSD was computed
Definition: ComputePSD.c:129
REAL8 FreqMin
frequency of first PSD bin for output
Definition: ComputePSD.c:127
REAL8 FreqBand
width of frequency band for output
Definition: ComputePSD.c:128
LIGOTimeGPS end
LIGOTimeGPS start
INT4 gpsNanoSeconds
A vector of 'timestamps' of type LIGOTimeGPS.
Definition: SFTfileIO.h:188
A collection of PSD vectors – one for each IFO in a multi-IFO search.
Definition: PSDutils.h:62
PSDVector ** data
sftvector for each ifo
Definition: PSDutils.h:67
UINT4 length
number of ifos
Definition: PSDutils.h:66
A collection of SFT vectors – one for each IFO in a multi-IFO search.
Definition: SFTfileIO.h:179
SFTVector ** data
sftvector for each ifo
Definition: SFTfileIO.h:184
REAL8Sequence * data
CHAR name[LALNameLength]
REAL8FrequencySeries * data
Pointer to the data array.
UINT4 length
Number of elements in array.
REAL8 * data
An "SFT-catalogue": a vector of SFTdescriptors, as returned by XLALSFTdataFind()
Definition: SFTfileIO.h:238
SFTDescriptor * data
array of data-entries describing matched SFTs
Definition: SFTfileIO.h:243
UINT4 length
number of SFTs in catalog
Definition: SFTfileIO.h:242
'Constraints' for SFT-matching: which detector, within which time-stretch and which timestamps exactl...
Definition: SFTfileIO.h:212
SFTtype header
SFT-header info.
Definition: SFTfileIO.h:228
user input variables
Definition: compareFstats.c:51
INT4 PSDmthopSFTs
for PSD, type of math.
Definition: ComputePSD.c:100
INT4 binSize
output PSD bin size in no.
Definition: ComputePSD.c:108
REAL8 endTime
last SFT-timestamp to include
Definition: ComputePSD.c:93
INT4 blocksRngMed
number of running-median bins to use
Definition: ComputePSD.c:97
CHAR * outputSpectBname
Definition: ComputePSD.c:87
REAL8 binStepHz
output PSD bin step in Hz
Definition: ComputePSD.c:111
INT4 nSFTmthopIFOs
for norm.
Definition: ComputePSD.c:104
LALStringVector * linefiles
Definition: ComputePSD.c:96
INT4 PSDmthopBins
for PSD, type of math.
Definition: ComputePSD.c:109
REAL8 startTime
earliest SFT-timestamp to include
Definition: ComputePSD.c:92
BOOLEAN outputNormSFT
output normalised SFT power?
Definition: ComputePSD.c:102
REAL8 fStart
Start Frequency to load from SFT and compute PSD, including wings (it is RECOMMENDED to use –Freq ins...
Definition: ComputePSD.c:118
CHAR * outputQ
output the 'data-quality factor' Q(f) into this file
Definition: ComputePSD.c:116
REAL8 binSizeHz
output PSD bin size in Hz
Definition: ComputePSD.c:107
BOOLEAN outFreqBinEnd
output the end frequency of each bin?
Definition: ComputePSD.c:113
REAL8 Freq
physical start frequency to compute PSD for (excluding rngmed wings)
LIGOTimeGPS startTime
Start-time of requested signal in detector-frame (GPS seconds)
CHAR * timeStampsFile
Definition: ComputePSD.c:95
BOOLEAN normalizeByTotalNumSFTs
apply normalization factor from total number of SFTs over all IFOs
Definition: ComputePSD.c:105
BOOLEAN dumpMultiPSDVector
output multi-PSD vector over IFOs, timestamps, and frequencies into file(s)
Definition: ComputePSD.c:115
INT4 binStep
output PSD bin step in no.
Definition: ComputePSD.c:112
INT4 nSFTmthopBins
for norm.
Definition: ComputePSD.c:110
CHAR * inputData
directory for input sfts
Definition: ComputePSD.c:85
CHAR * outputPSD
directory for output sfts
Definition: ComputePSD.c:86
INT4 PSDmthopIFOs
for PSD, type of math.
Definition: ComputePSD.c:101
REAL8 FreqBand
physical frequency band to compute PSD for (excluding rngmed wings)
Definition: ComputePSD.c:90
REAL8 fBand
Frequency Band to load from SFT and compute PSD, including wings (it is RECOMMENDED to use –FreqBand ...
Definition: ComputePSD.c:119
INT4 nSFTmthopSFTs
for norm.
Definition: ComputePSD.c:103
CHAR * IFO
Detector: H1, L1, H2, V1, ...
double df