Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALApps 10.1.0.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
inspawgfile.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 Duncan Brown, Jolien Creighton, Patrick Brady
3*
4* This program is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation; either version 2 of the License, or
7* (at your option) any later version.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with with program; see the file COPYING. If not, write to the
16* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301 USA
18*/
19
20/*
21 * inspawgfile.c
22 * Author: Brown, D. A, and Creighton, T. D.
23 */
24
25#include <math.h>
26#include <stdlib.h>
27#include <lal/Date.h>
28#include <lal/LALStdio.h>
29#include <lal/LALStdlib.h>
30#include <lal/LALConstants.h>
31#include <lal/SeqFactories.h>
32#include <lal/Units.h>
33#include <lal/Random.h>
34#include <lal/VectorOps.h>
35#include <lal/SimulateCoherentGW.h>
36#include <lal/GeneratePPNInspiral.h>
37#include <lal/LALSimulation.h>
38#include <lal/StreamInput.h>
39#include <lal/TimeFreqFFT.h>
40#include <lal/TimeSeries.h>
41
42#define INSPAWGFILEC_ENORM 0
43#define INSPAWGFILEC_ESUB 1
44#define INSPAWGFILEC_EARG 2
45#define INSPAWGFILEC_EVAL 3
46#define INSPAWGFILEC_EFILE 4
47#define INSPAWGFILEC_EINPUT 5
48#define INSPAWGFILEC_EMEM 6
49
50#define INSPAWGFILEC_MSGENORM "Normal exit"
51#define INSPAWGFILEC_MSGESUB "Subroutine failed"
52#define INSPAWGFILEC_MSGEARG "Error parsing arguments"
53#define INSPAWGFILEC_MSGEVAL "Input argument out of valid range"
54#define INSPAWGFILEC_MSGEFILE "Could not open file"
55#define INSPAWGFILEC_MSGEINPUT "Error reading file"
56#define INSPAWGFILEC_MSGEMEM "Out of memory"
57
58/* Default parameter settings. */
59#define EPOCH (0)
60#define DIST (0.00002*LAL_MRSUN_SI )
61#define M1 (1.4)
62#define M2 (1.4)
63#define INC (0.0)
64#define PHIC (0.0)
65#define SEC (0)
66#define NSEC (0)
67#define NPT (1048576)
68#define DT (1.0/16384.0)
69#define SIGMA (0.0)
70
71/* Global constants. */
72#define MSGLEN (256) /* maximum length of warning/info messages */
73#define FSTART (40.0) /* initial frequency of waveform */
74#define FSTOP (3000.0) /* termination frequency of waveform */
75#define DELTAT (0.00006103515625) /* sampling interval of amplitude and phase */
76
77/* Usage format string. */
78#define USAGE "Usage: %s [-s sourcefile] [-r respfile] [-o outfile] [-e seed]\n" \
79" [-i infile | -n sec nsec npt dt sigma] [-fi lowf] [-fe highf] \n" \
80" [-d debuglevel] [-p]\n"
81
82/* Macros for printing errors and testing subroutines. */
83#define ERROR( code, msg, statement ) \
84do \
85if ( lalDebugLevel & LALERROR ) \
86{ \
87 LALPrintError( "Error[0] %d: program %s, file %s, line %d, %s\n" \
88 " %s %s\n", (code), *argv, __FILE__, \
89 __LINE__, "$Id$", statement ? statement : \
90 "", (msg) ); \
91} \
92while (0)
93
94#define INFO( statement ) \
95do \
96if ( lalDebugLevel & LALINFO ) \
97{ \
98 LALPrintError( "Info[0]: program %s, file %s, line %d, %s\n" \
99 " %s\n", *argv, __FILE__, __LINE__, \
100 "$Id$", (statement) ); \
101} \
102while (0)
103
104#define WARNING( statement ) \
105do \
106if ( lalDebugLevel & LALWARNING ) \
107{ \
108 LALPrintError( "Warning[0]: program %s, file %s, line %d, %s\n" \
109 " %s\n", *argv, __FILE__, __LINE__, \
110 "$Id$", (statement) ); \
111} \
112while (0)
113
114#define SUB( func, statusptr ) \
115do \
116if ( (func), (statusptr)->statusCode ) \
117{ \
118 ERROR( INSPAWGFILEC_ESUB, INSPAWGFILEC_MSGESUB, \
119 "Function call \"" #func "\" failed:" ); \
120 return INSPAWGFILEC_ESUB; \
121} \
122while (0)
123
124#define CHECKVAL( val, lower, upper ) \
125do \
126if ( ( (val) <= (lower) ) || ( (val) > (upper) ) ) \
127{ \
128 ERROR( INSPAWGFILEC_EVAL, INSPAWGFILEC_MSGEVAL, \
129 "Value of " #val " out of range:" ); \
130 LALPrintError( #val " = %f, range = (%f,%f]\n", (REAL8)(val), \
131 (REAL8)(lower), (REAL8)(upper) ); \
132 return INSPAWGFILEC_EVAL; \
133} \
134while (0)
135
136/* A function to convert INT8 nanoseconds to LIGOTimeGPS. */
137void
139
140
141int
142main(int argc, char **argv)
143{
144 /* Command-line parsing variables. */
145 int arg; /* command-line argument counter */
146 static LALStatus stat; /* status structure */
147 CHAR *sourcefile = NULL; /* name of sourcefile */
148 CHAR *respfile = NULL; /* name of respfile */
149 CHAR *infile = NULL; /* name of infile */
150 CHAR *outfile = NULL; /* name of outfile */
151 CHAR *specfile = NULL; /* name of spectrum file */
152 INT4 seed = 0; /* random number seed */
153 INT4 sec = SEC; /* ouput epoch.gpsSeconds */
154 INT4 nsec = NSEC; /* ouput epoch.gpsNanoSeconds */
155 INT4 npt = NPT; /* number of output points */
156 REAL8 dt = DT; /* output sampling interval */
157 REAL4 sigma = SIGMA; /* noise amplitude */
158 REAL4 fstart = FSTART; /* start frequency */
159 REAL4 fstop = FSTOP; /* stop frequency */
160
161 /* File reading variables. */
162 FILE *fp = NULL; /* generic file pointer */
163 BOOLEAN ok = 1; /* whether input format is correct */
164 UINT4 i; /* generic index over file lines */
165 INT8 epoch; /* epoch stored as an INT8 */
166
167 /* Other global variables. */
168 RandomParams *params = NULL; /* parameters of pseudorandom sequence */
169 DetectorResponse detector; /* the detector in question */
170 REAL4TimeSeries output; /* detector ADC output */
171
172 /* set XLAL error handler to traceback and abort */
174
175 /*******************************************************************
176 * PARSE ARGUMENTS (arg stores the current position) *
177 *******************************************************************/
178
179 /* Exit gracefully if no arguments were given.
180 if ( argc <= 1 ) {
181 INFO( "No testing done." );
182 return 0;
183 } */
184
185 arg = 1;
186 while ( arg < argc ) {
187 /* Parse source file option. */
188 if ( !strcmp( argv[arg], "-s" ) ) {
189 if ( argc > arg + 1 ) {
190 arg++;
191 sourcefile = argv[arg++];
192 }else{
194 LALPrintError( USAGE, *argv );
195 return INSPAWGFILEC_EARG;
196 }
197 }
198 /* Parse response file option. */
199 else if ( !strcmp( argv[arg], "-r" ) ) {
200 if ( argc > arg + 1 ) {
201 arg++;
202 respfile = argv[arg++];
203 }else{
205 LALPrintError( USAGE, *argv );
206 return INSPAWGFILEC_EARG;
207 }
208 }
209 /* Parse input file option. */
210 else if ( !strcmp( argv[arg], "-i" ) ) {
211 if ( argc > arg + 1 ) {
212 arg++;
213 infile = argv[arg++];
214 }else{
216 LALPrintError( USAGE, *argv );
217 return INSPAWGFILEC_EARG;
218 }
219 }
220 /* Parse noise output option. */
221 else if ( !strcmp( argv[arg], "-n" ) ) {
222 if ( argc > arg + 5 ) {
223 arg++;
224 sec = atoi( argv[arg++] );
225 nsec = atoi( argv[arg++] );
226 npt = atoi( argv[arg++] );
227 dt = atof( argv[arg++] );
228 sigma = atof( argv[arg++] );
229 }else{
231 LALPrintError( USAGE, *argv );
232 return INSPAWGFILEC_EARG;
233 }
234 }
235 /* Parse output file option. */
236 else if ( !strcmp( argv[arg], "-o" ) ) {
237 if ( argc > arg + 1 ) {
238 arg++;
239 outfile = argv[arg++];
240 }else{
242 LALPrintError( USAGE, *argv );
243 return INSPAWGFILEC_EARG;
244 }
245 }
246 /* Parse debug level option. */
247 else if ( !strcmp( argv[arg], "-d" ) ) {
248 if ( argc > arg + 1 ) {
249 arg++;
250 }else{
252 LALPrintError( USAGE, *argv );
253 return INSPAWGFILEC_EARG;
254 }
255 }
256 /* Parse start frequency */
257 else if ( !strcmp( argv[arg], "-fi" ) ) {
258 if ( argc > arg + 1 ) {
259 arg++;
260 fstart = atof( argv[arg++] );
261 }else{
263 LALPrintError( USAGE, *argv );
264 return INSPAWGFILEC_EARG;
265 }
266 }
267 /* Parse stop frequency */
268 else if ( !strcmp( argv[arg], "-fe" ) ) {
269 if ( argc > arg + 1 ) {
270 arg++;
271 fstop = atof( argv[arg++] );
272 }else{
274 LALPrintError( USAGE, *argv );
275 return INSPAWGFILEC_EARG;
276 }
277 }
278 /* Parse random seed option. */
279 else if ( !strcmp( argv[arg], "-e" ) ) {
280 if ( argc > arg + 1 ) {
281 arg++;
282 seed = atoi( argv[arg++] );
283 }else{
285 LALPrintError( USAGE, *argv );
286 return INSPAWGFILEC_EARG;
287 }
288 }
289 /* Parse print spectrum */
290 else if ( !strcmp( argv[arg], "-p" ) ) {
291 if ( argc > arg + 1 ) {
292 arg++;
293 specfile = argv[arg++];
294 }else{
296 LALPrintError( USAGE, *argv );
297 return INSPAWGFILEC_EARG;
298 }
299 }
300 /* Check for unrecognized options. */
301 else if ( argv[arg][0] == '-' ) {
303 LALPrintError( USAGE, *argv );
304 return INSPAWGFILEC_EARG;
305 }
306 } /* End of argument parsing loop. */
307
308 /* Check for redundant or bad argument values. */
309 CHECKVAL( npt, 0, 2147483647 );
311
312
313 /*******************************************************************
314 * SETUP *
315 *******************************************************************/
316
317 /* Set up output, detector, and random parameter structures. */
318 output.data = NULL;
319 detector.transfer = (COMPLEX8FrequencySeries *)
321 if ( !(detector.transfer) ) {
323 return INSPAWGFILEC_EMEM;
324 }
325 detector.transfer->data = NULL;
326 detector.site = NULL;
328
329 /* Set up units. */
330 output.sampleUnits = lalADCCountUnit;
331 if (XLALUnitDivide( &(detector.transfer->sampleUnits),
332 &lalADCCountUnit, &lalStrainUnit ) == NULL) {
333 return LAL_EXLAL;
334 }
335
336 /* Read response function. */
337 if ( respfile ) {
338 REAL4VectorSequence *resp = NULL; /* response as vector sequence */
339 COMPLEX8Vector *response = NULL; /* response as complex vector */
340 COMPLEX8Vector *unity = NULL; /* vector of complex 1's */
341
342 if ( ( fp = fopen( respfile, "r" ) ) == NULL ) {
344 respfile );
345 return INSPAWGFILEC_EFILE;
346 }
347
348 /* Read header. */
349 ok &= ( fscanf( fp, "# epoch = %" LAL_INT8_FORMAT "\n", &epoch ) == 1 );
350 I8ToLIGOTimeGPS( &( detector.transfer->epoch ), epoch );
351 ok &= ( fscanf( fp, "# f0 = %lf\n", &( detector.transfer->f0 ) )
352 == 1 );
353 ok &= ( fscanf( fp, "# deltaF = %lf\n",
354 &( detector.transfer->deltaF ) ) == 1 );
355 if ( !ok ) {
357 respfile );
358 return INSPAWGFILEC_EINPUT;
359 }
360
361 /* Read and convert body to a COMPLEX8Vector. */
362 SUB( LALSReadVectorSequence( &stat, &resp, fp ), &stat );
363 fclose( fp );
364 if ( resp->vectorLength != 2 ) {
366 respfile );
367 return INSPAWGFILEC_EINPUT;
368 }
369 SUB( LALCCreateVector( &stat, &response, resp->length ), &stat );
370 memcpy( response->data, resp->data, 2*resp->length*sizeof(REAL4) );
371 SUB( LALSDestroyVectorSequence( &stat, &resp ), &stat );
372
373 /* Convert response function to a transfer function. */
374 SUB( LALCCreateVector( &stat, &unity, response->length ), &stat );
375 for ( i = 0; i < response->length; i++ ) {
376 unity->data[i] = 1.0;
377 }
378 SUB( LALCCreateVector( &stat, &( detector.transfer->data ),
379 response->length ), &stat );
380 SUB( LALCCVectorDivide( &stat, detector.transfer->data, unity,
381 response ), &stat );
382 SUB( LALCDestroyVector( &stat, &response ), &stat );
383 SUB( LALCDestroyVector( &stat, &unity ), &stat );
384 }
385
386 /* No response file, so generate a unit response. */
387 else {
388 I8ToLIGOTimeGPS( &( detector.transfer->epoch ), EPOCH );
389 detector.transfer->f0 = 0.0;
390 detector.transfer->deltaF = 1.5*fstop;
391 SUB( LALCCreateVector( &stat, &( detector.transfer->data ), 2 ),
392 &stat );
393 detector.transfer->data->data[0] = 1.0;
394 detector.transfer->data->data[1] = 1.0;
395 }
396
397
398 /* Read input data. */
399 if ( infile ) {
400 REAL4VectorSequence *input = NULL; /* input as vector sequence */
401 if ( ( fp = fopen( infile, "r" ) ) == NULL ) {
403 infile );
404 return INSPAWGFILEC_EFILE;
405 }
406
407 /* Read header. */
408 ok &= ( fscanf( fp, "# epoch = %" LAL_INT8_FORMAT "\n", &epoch ) == 1 );
409 I8ToLIGOTimeGPS( &( output.epoch ), epoch );
410 ok &= ( fscanf( fp, "# deltaT = %lf\n", &( output.deltaT ) )
411 == 1 );
412 if ( !ok ) {
414 infile );
415 return INSPAWGFILEC_EINPUT;
416 }
417
418 /* Read and convert body. */
419 SUB( LALSReadVectorSequence( &stat, &input, fp ), &stat );
420 fclose( fp );
421 if ( input->vectorLength != 1 ) {
423 infile );
424 return INSPAWGFILEC_EINPUT;
425 }
426 SUB( LALSCreateVector( &stat, &( output.data ), input->length ),
427 &stat );
428 for ( i = 0; i < input->length; i++ )
429 output.data->data[i] = input->data[i];
430 SUB( LALSDestroyVectorSequence( &stat, &input ), &stat );
431 }
432
433 /* No input file, so generate one randomly. */
434 else {
435 output.epoch.gpsSeconds = sec;
436 output.epoch.gpsNanoSeconds = nsec;
437 output.deltaT = dt;
438 SUB( LALSCreateVector( &stat, &( output.data ), npt ), &stat );
439 if ( sigma == 0 ) {
440 memset( output.data->data, 0, npt*sizeof(REAL4) );
441 } else {
442 SUB( LALNormalDeviates( &stat, output.data, params ), &stat );
443 }
444 }
445
446
447 /*******************************************************************
448 * INJECTION *
449 *******************************************************************/
450
451 /* Open sourcefile. */
452 if ( sourcefile ) {
453 if ( ( fp = fopen( sourcefile, "r" ) ) == NULL ) {
455 sourcefile );
456 return INSPAWGFILEC_EFILE;
457 }
458 }
459
460 /* For each line in the sourcefile... */
461 while ( ok ) {
462 PPNParamStruc ppnParams; /* wave generation parameters */
463 REAL4 m1, m2, dist, inc, phic; /* unconverted parameters */
464 CoherentGW waveform; /* amplitude and phase structure */
465 REAL4TimeSeries *signalvec; /* GW signal */
466 REAL8 time; /* length of GW signal */
467 CHAR timeCode; /* code for signal time alignment */
468 CHAR message[MSGLEN]; /* warning/info messages */
469
470 /* Read and convert input line. */
471 if ( sourcefile ) {
472 ok &= ( fscanf( fp, "%c %" LAL_INT8_FORMAT " %f %f %f %f %f\n", &timeCode,
473 &epoch, &m1, &m2, &dist, &inc, &phic ) == 7 );
474 fprintf(stderr, "%c %" LAL_INT8_FORMAT " %f %f %f %f %f\n", timeCode,
475 epoch, m1, m2, dist, inc, phic ); fflush(stderr);
476 ppnParams.mTot = m1 + m2;
477 ppnParams.eta = m1*m2/( ppnParams.mTot*ppnParams.mTot );
478 ppnParams.d = dist*LAL_PC_SI*1000.0;
479 ppnParams.inc = inc*LAL_PI/180.0;
480 ppnParams.phi = phic*LAL_PI/180.0;
481 } else {
482 timeCode = 'i';
483 ppnParams.mTot = M1 + M2;
484 ppnParams.eta = M1*M2/( ppnParams.mTot*ppnParams.mTot );
485 ppnParams.d = DIST;
486 ppnParams.inc = INC;
487 ppnParams.phi = PHIC;
488 epoch = EPOCH;
489 }
490
491 if ( ok ) {
492 /* Set up other parameter structures. */
493 ppnParams.epoch.gpsSeconds = ppnParams.epoch.gpsNanoSeconds = 0;
494 ppnParams.position.latitude = ppnParams.position.longitude = 0.0;
496 ppnParams.psi = 0.0;
497 ppnParams.fStartIn = fstart;
498 ppnParams.fStopIn = fstop;
499 ppnParams.lengthIn = 0;
500 ppnParams.ppn = NULL;
501 ppnParams.deltaT = DELTAT;
502 memset( &waveform, 0, sizeof(CoherentGW) );
503
504 /* Generate waveform at zero epoch. */
505 SUB( LALGeneratePPNInspiral( &stat, &waveform, &ppnParams ),
506 &stat );
507 snprintf( message, MSGLEN, "%d: %s", ppnParams.termCode,
508 ppnParams.termDescription );
509 INFO( message );
510 if ( lalDebugLevel & LALINFO )
511 {
512 LALPrintError( "Info[0]: program %s, file %s, line %d, %s\n"
513 "\tWaveform terminared at %e Hz\n",
514 *argv, __FILE__, __LINE__,
515 "$Id$", ppnParams.fStop );
516 }
517 if ( ppnParams.dfdt > 2.0 ) {
518 snprintf( message, MSGLEN,
519 "Waveform sampling interval is too large:\n"
520 "\tmaximum df*dt = %f", ppnParams.dfdt );
521 WARNING( message );
522 }
523
524 /* Compute epoch for waveform. */
525 time = waveform.a->data->length*DELTAT;
526 if ( timeCode == 'f' )
527 epoch -= (INT8)( 1000000000.0*time );
528 else if ( timeCode == 'c' )
529 epoch -= (INT8)( 1000000000.0*ppnParams.tc );
530 I8ToLIGOTimeGPS( &( waveform.a->epoch ), epoch );
531 waveform.f->epoch = waveform.phi->epoch = waveform.a->epoch;
532
533 /* Generate and inject signal. */
534 signalvec = XLALCreateREAL4TimeSeries( "", &waveform.a->epoch, 0.,
535 output.deltaT, &waveform.a->sampleUnits,
536 (time + 2.0) / output.deltaT );
537 XLALGPSAdd(&signalvec->epoch, -1.0);
538 SUB( LALSimulateCoherentGW( &stat, signalvec, &waveform,
539 &detector ), &stat );
540 SUB( LALSDestroyVectorSequence( &stat, &( waveform.a->data ) ),
541 &stat );
542 SUB( LALSDestroyVector( &stat, &( waveform.f->data ) ), &stat );
543 SUB( LALDDestroyVector( &stat, &( waveform.phi->data ) ), &stat );
544 LALFree( waveform.a );
545 LALFree( waveform.f );
546 LALFree( waveform.phi );
547 XLALSimAddInjectionREAL4TimeSeries( &output, signalvec, NULL );
548 XLALDestroyREAL4TimeSeries( signalvec );
549 }
550
551 /* If there is no source file, inject only one source. */
552 if ( !sourcefile )
553 ok = 0;
554 }
555
556 /* Input file is exhausted (or has a badly-formatted line ). */
557 if ( sourcefile )
558 fclose( fp );
559
560 /*******************************************************************
561 * COMPUTE POWER SPECTRUM *
562 *******************************************************************/
563
564 /* write diagnostic info to disk */
565 if ( specfile ){
566 fprintf(stderr, "error, unable to compute power spectrum.\n" );
567 fprintf(stderr, "LALRealAverageSpectrum has been removed from LAL.\n" );
568 fprintf(stderr, "Fix code to use new LALREAL4AverageSpectrum routine.\n" );
569 fprintf(stderr, "Aborting.\n" );
570 abort();
571#if 0
573 RealDFTParams *dftparams = NULL;
574 LALWindowParams winParams;
575 INT4 length=2048;
576
577 /* Set up the window parameters */
578 winParams.type=0;
579 winParams.length=length;
580
581 /* assign temporary memory for the frequency data */
584 strncpy( fseries->name, "anonymous", LALNameLength );
585 fseries->data = NULL;
586 SUB( LALCreateVector (&stat, &fseries->data,
587 length/2 + 1), &stat );
588
589 /* create the dft params */
590 SUB( LALCreateRealDFTParams(&stat , &dftparams, &winParams, 1),
591 &stat);
592
593 /* compute the average spectrum */
594 SUB( LALRealAverageSpectrum (&stat, fseries, &output, dftparams,
595 0), &stat );
596 LALSPrintFrequencySeries ( fseries, specfile );
597
598 SUB( LALDestroyRealDFTParams(&stat, &dftparams), &stat);
599 SUB( LALDestroyVector(&stat, &fseries->data), &stat);
600 LALFree( fseries );
601#endif
602 }
603
604
605 /*******************************************************************
606 * CLEANUP *
607 *******************************************************************/
608
609 /* Print output file. */
610 if ( outfile ) {
611 if ( ( fp = fopen( outfile, "w" ) ) == NULL ) {
613 outfile );
614 return INSPAWGFILEC_EFILE;
615 }
616 for ( i = 0; i < output.data->length; i++ )
617 fprintf( fp, "%e\n", output.data->data[i] );
618 fclose( fp );
619 }
620
621 /* Destroy remaining memory. */
623 SUB( LALSDestroyVector( &stat, &( output.data ) ), &stat );
624 SUB( LALCDestroyVector( &stat, &( detector.transfer->data ) ),
625 &stat );
626 LALFree( detector.transfer );
627
628 /* Done! */
631 return INSPAWGFILEC_ENORM;
632}
633
634
635/* A function to convert INT8 nanoseconds to LIGOTimeGPS. */
636void
638{
639 INT8 s = input / 1000000000LL;
640 output->gpsSeconds = (INT4)( s );
641 output->gpsNanoSeconds = (INT4)( input - 1000000000LL*s );
642 return;
643}
void LALCheckMemoryLeaks(void)
#define LALMalloc(n)
#define LALFree(p)
#define LAL_EXLAL
void LALSimulateCoherentGW(LALStatus *status, REAL4TimeSeries *output, CoherentGW *input, DetectorResponse *detector)
#define fscanf
#define fprintf
int s
const char * detector
void LALSDestroyVectorSequence(LALStatus *status, REAL4VectorSequence **vectorSequence)
void LALGeneratePPNInspiral(LALStatus *, CoherentGW *output, PPNParamStruc *params)
#define LAL_REAL4_MAX
#define LAL_PI
#define LAL_PC_SI
unsigned char BOOLEAN
double REAL8
int64_t INT8
char CHAR
uint32_t UINT4
int32_t INT4
float REAL4
LALNameLength
#define lalDebugLevel
LALINFO
int LALPrintError(const char *fmt,...)
int XLALSimAddInjectionREAL4TimeSeries(REAL4TimeSeries *target, REAL4TimeSeries *h, const COMPLEX8FrequencySeries *response)
#define LAL_INT8_FORMAT
void LALSPrintFrequencySeries(REAL4FrequencySeries *series, const CHAR *filename)
void LALCreateRandomParams(LALStatus *status, RandomParams **params, INT4 seed)
void LALNormalDeviates(LALStatus *status, REAL4Vector *deviates, RandomParams *params)
void LALDestroyRandomParams(LALStatus *status, RandomParams **params)
COORDINATESYSTEM_EQUATORIAL
void LALSReadVectorSequence(LALStatus *status, REAL4VectorSequence **sequence, FILE *stream)
REAL4TimeSeries * XLALCreateREAL4TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
void XLALDestroyREAL4TimeSeries(REAL4TimeSeries *series)
const LALUnit lalStrainUnit
const LALUnit lalADCCountUnit
LALUnit * XLALUnitDivide(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
void LALCCreateVector(LALStatus *, COMPLEX8Vector **, UINT4)
void LALDestroyVector(LALStatus *, REAL4Vector **)
void LALCDestroyVector(LALStatus *, COMPLEX8Vector **)
void LALDDestroyVector(LALStatus *, REAL8Vector **)
void LALSDestroyVector(LALStatus *, REAL4Vector **)
void LALCreateVector(LALStatus *, REAL4Vector **, UINT4)
void LALSCreateVector(LALStatus *, REAL4Vector **, UINT4)
void LALCCVectorDivide(LALStatus *status, COMPLEX8Vector *out, const COMPLEX8Vector *in1, const COMPLEX8Vector *in2)
void XLALBacktraceErrorHandler(const char *func, const char *file, int line, int errnum)
XLALErrorHandlerType * XLALSetErrorHandler(XLALErrorHandlerType *newHandler)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
#define DELTAT
Definition: inspawgfile.c:75
#define NPT
Definition: inspawgfile.c:67
#define EPOCH
Definition: inspawgfile.c:59
void I8ToLIGOTimeGPS(LIGOTimeGPS *output, INT8 input)
Definition: inspawgfile.c:637
#define INSPAWGFILEC_MSGEINPUT
Definition: inspawgfile.c:55
#define FSTART
Definition: inspawgfile.c:73
#define M2
Definition: inspawgfile.c:62
int main(int argc, char **argv)
Definition: inspawgfile.c:142
#define SUB(func, statusptr)
Definition: inspawgfile.c:114
#define FSTOP
Definition: inspawgfile.c:74
#define USAGE
Definition: inspawgfile.c:78
#define MSGLEN
Definition: inspawgfile.c:72
#define INSPAWGFILEC_MSGEFILE
Definition: inspawgfile.c:54
#define ERROR(code, msg, statement)
Definition: inspawgfile.c:83
#define INSPAWGFILEC_MSGEARG
Definition: inspawgfile.c:52
#define INSPAWGFILEC_EMEM
Definition: inspawgfile.c:48
#define INSPAWGFILEC_ENORM
Definition: inspawgfile.c:42
#define INFO(statement)
Definition: inspawgfile.c:94
#define SEC
Definition: inspawgfile.c:65
#define DT
Definition: inspawgfile.c:68
#define CHECKVAL(val, lower, upper)
Definition: inspawgfile.c:124
#define NSEC
Definition: inspawgfile.c:66
#define INSPAWGFILEC_MSGENORM
Definition: inspawgfile.c:50
#define SIGMA
Definition: inspawgfile.c:69
#define DIST
Definition: inspawgfile.c:60
#define INSPAWGFILEC_EFILE
Definition: inspawgfile.c:46
#define M1
Definition: inspawgfile.c:61
#define INSPAWGFILEC_EINPUT
Definition: inspawgfile.c:47
#define WARNING(statement)
Definition: inspawgfile.c:104
#define INSPAWGFILEC_MSGEMEM
Definition: inspawgfile.c:56
#define INSPAWGFILEC_EARG
Definition: inspawgfile.c:44
#define INC
Definition: inspawgfile.c:63
#define PHIC
Definition: inspawgfile.c:64
int i
Definition: inspinj.c:596
REAL8 dist
Definition: inspinj.c:564
message
m2
m1
waveform
fseries
seed
time
stat
COMPLEX8 * data
INT4 gpsNanoSeconds
REAL4Vector * ppn
const CHAR * termDescription
LIGOTimeGPS epoch
SkyPosition position
LIGOTimeGPS epoch
REAL8 longitude
REAL8 latitude
CoordinateSystem system
FILE * fp
enum @1 epoch
int output(const char *outfile, int outtype, REAL4TimeSeries *series)
Definition: view.c:603