00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef _LALNOISEMODELS_H
00047 #define _LALNOISEMODELS_H
00048
00049 #include <math.h>
00050 #include <stdio.h>
00051 #include <stdlib.h>
00052 #include <lal/LALStdlib.h>
00053 #include <lal/LALConstants.h>
00054 #include <lal/LALInspiral.h>
00055 #include <lal/RealFFT.h>
00056
00057 #ifdef __cplusplus
00058 extern "C" {
00059 #endif
00060
00061 NRCSID( LALNOISEMODELSH, "$Id: LALNoiseModels.h,v 1.30 2008/05/27 10:54:02 thomas Exp $" );
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 #define LALNOISEMODELSH_ENULL 1
00072 #define LALNOISEMODELSH_EMEM 2
00073 #define LALNOISEMODELSH_ECHOICE 4
00074 #define LALNOISEMODELSH_EDIV0 8
00075 #define LALNOISEMODELSH_ESIZE 16
00076 #define LALNOISEMODELSH_MSGENULL "Arguments contained an unexpected null pointer"
00077 #define LALNOISEMODELSH_MSGEMEM "Memory allocation error"
00078 #define LALNOISEMODELSH_MSGECHOICE "Invalid choice for an input parameter"
00079 #define LALNOISEMODELSH_MSGEDIV0 "Division by zero"
00080 #define LALNOISEMODELSH_MSGESIZE "Invalid input size"
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 typedef enum
00093 {
00094 geo,
00095 ligo,
00096 tama,
00097 virgo
00098 }
00099 Detector;
00100
00101
00102
00103
00104
00105
00106
00107
00108 typedef struct
00109 tagInspiralWaveCorrelateIn
00110 {
00111 REAL8 df;
00112 REAL8 fCutoff;
00113 REAL8 samplingRate;
00114 REAL4Vector signal1;
00115 REAL4Vector signal2;
00116 REAL8Vector psd;
00117 RealFFTPlan *revp;
00118 }
00119 InspiralWaveCorrelateIn;
00120
00121
00122
00123
00124
00125
00126
00127 typedef struct
00128 tagAddVectorsIn
00129 {
00130 REAL4Vector *v1;
00131 REAL4Vector *v2;
00132 REAL8 a1;
00133 REAL8 a2;
00134 }
00135 AddVectorsIn;
00136
00137
00138
00139
00140
00141
00142
00143
00144 typedef struct tagDiscoverInspiralEventsIn
00145 {
00146 UINT4 currentGPSTime;
00147 INT4 nBegin, nEnd;
00148 INT4 chisqBins;
00149 REAL8 Threshold, ClusterThreshold;
00150 REAL8 dynRangeScalingFac;
00151 REAL4Vector signal;
00152 REAL8Vector psd;
00153 InspiralTemplate param;
00154 RealFFTPlan *fwdp;
00155 RealFFTPlan *revp;
00156 UINT2 displayCorrelationStats;
00157 UINT2 displayCorrelation;
00158 }
00159 DiscoverInspiralEventsIn;
00160
00161 typedef struct tagDiscoverInspiralEventsList
00162 {
00163 UINT4 bin;
00164 INT4 endTime, endTimeNS, impulseTime, impulseTimeNS, chisqDOF;
00165 REAL8 amplitude, effDistance, effD8, phase, snr;
00166 REAL8 cmax1, cmax2, sigmasq;
00167 REAL8 chisq, chisq1, chisq2;
00168 REAL8 t0, t3, m1, m2;
00169 }
00170 DiscoverInspiralEventsList;
00171
00172 typedef struct tagInspiralChisqInput
00173 {
00174
00175 INT4 chisqBins;
00176 REAL4Vector filter1, filter2;
00177 REAL4Vector rho1, rho2;
00178 REAL8 flso;
00179 DiscoverInspiralEventsIn *findEventsIn;
00180 }
00181 InspiralChisqInput;
00182
00183 typedef struct tagInspiralChisqOutput
00184 {
00185 REAL8 *chisqZERO;
00186 REAL8 *chisqPIbyTWO;
00187 REAL8 *chisq;
00188 }
00189 InspiralChisqOutput;
00190
00191 typedef struct tagInvSpecTruncationParams
00192 {
00193 INT4 n;
00194 REAL8 df;
00195 RealFFTPlan *fwdp;
00196 RealFFTPlan *revp;
00197 REAL8 psdTruncTime;
00198 UINT2 ifDebug;
00199 }
00200 InvSpecTruncationParams;
00201
00202
00203
00204
00205 typedef struct
00206 tagRandomInspiralSignalIn
00207 {
00208 INT4 useed;
00209 INT4 type;
00210
00211 REAL8 mMin;
00212 REAL8 mMax;
00213
00214 REAL8 MMax;
00215 REAL8 MMin;
00216 REAL8 SignalAmp;
00217 REAL8 NoiseAmp;
00218 REAL8 etaMin;
00219 InspiralTemplate
00220 param;
00221 REAL8Vector psd;
00222 RealFFTPlan *fwdp;
00223
00224
00225 REAL8 t0Min;
00226 REAL8 t0Max;
00227 REAL8 tnMin;
00228 REAL8 tnMax;
00229
00230 REAL8 psi0Min;
00231 REAL8 psi0Max;
00232 REAL8 psi3Min;
00233 REAL8 psi3Max;
00234
00235 INT4 coalescenceTime ;
00236
00237
00238 REAL8 minDistance, maxDistance;
00239 REAL8 spin1min, spin1max, spin2min, spin2max;
00240 REAL8 theta0min, theta0max, phi0min, phi0max;
00241 REAL8 polarisationAngleMin, polarisationAngleMax;
00242 REAL8 sourceThetaMin, sourceThetaMax, sourcePhiMin, sourcePhiMax;
00243 REAL8 inclinationMin, inclinationMax;
00244 }
00245 RandomInspiralSignalIn;
00246
00247
00248
00249
00250
00251
00252
00253 typedef struct
00254 tagInspiralWaveOverlapIn
00255 {
00256 INT4 nBegin;
00257 INT4 nEnd;
00258 REAL4Vector signal;
00259 REAL8Vector psd;
00260 InspiralTemplate param;
00261 RealFFTPlan *fwdp;
00262 RealFFTPlan *revp;
00263 UINT2 ifExtOutput;
00264
00265
00266
00267
00268 UINT2 ifCorrelationOutput;
00269 }
00270 InspiralWaveOverlapIn;
00271
00272
00273
00274
00275
00276
00277
00278 typedef struct
00279 tagInspiralWaveOverlapOut
00280 {
00281 REAL8 max, phase, alpha;
00282 INT4 bin;
00283 REAL4Vector *filter1, *filter2;
00284 REAL4Vector *xcorr1, *xcorr2;
00285 }
00286 InspiralWaveOverlapOut;
00287
00288
00289
00290
00291
00292
00293
00294
00295 typedef struct
00296 tagInspiralFindEventsIn
00297 {
00298 UINT4 currentGPSTime;
00299 INT4 nBegin;
00300 INT4 nEnd;
00301 REAL8 Threshold;
00302 REAL8 ClusterThreshold;
00303 REAL4Vector signal;
00304 REAL8Vector psd;
00305 InspiralTemplate param;
00306 RealFFTPlan *fwdp;
00307 RealFFTPlan *revp;
00308 UINT2 displayData;
00309 UINT2 displayPSD;
00310 UINT2 displayTemplates;
00311 UINT2 displayCorrelation;
00312 UINT2 displayCorrelationStats;
00313 }
00314 InspiralFindEventsIn;
00315
00316
00317
00318
00319
00320
00321
00322 typedef struct
00323 tagInspiralEventsList
00324 {
00325 UINT4 bin;
00326
00327 INT4 endTime;
00328 INT4 endTimeNS;
00329 INT4 impulseTime;
00330 INT4 impulseTimeNS;
00331 INT4 chisqDOF;
00332
00333 REAL8 amplitude;
00334 REAL8 effDistance;
00335 REAL8 phase;
00336 REAL8 snr;
00337 REAL8 sigmasq;
00338 REAL8 chisq;
00339
00340 InspiralTemplate param;
00341 }
00342 InspiralEventsList;
00343
00344
00345
00346
00347
00348
00349
00350
00351 typedef struct
00352 tagInspiralWaveNormaliseIn
00353 {
00354 REAL8 df;
00355 REAL8 fCutoff;
00356 REAL8 samplingRate;
00357 REAL8Vector *psd;
00358 }
00359 InspiralWaveNormaliseIn;
00360
00361
00362
00363 typedef struct
00364 tagStatsREAL4VectorOut
00365 {
00366 REAL8 mean;
00367 REAL8 var;
00368 REAL8 stddev;
00369 REAL8 min;
00370 REAL8 max;
00371 }
00372 StatsREAL4VectorOut;
00373
00374
00375
00376
00377
00378 typedef struct
00379 tagInspiralChisqDataVec
00380 {
00381 REAL4Vector *SNRIntegrand;
00382 REAL8Vector *psd;
00383 }
00384 InspiralChisqDataVec;
00385
00386
00387
00388 typedef struct
00389 tagInspiralChisqParams
00390 {
00391 INT4 nBins;
00392
00393 REAL8 totalMass;
00394 REAL8 fLower;
00395 REAL8 deltaT;
00396 }
00397 InspiralChisqParams;
00398
00399
00400
00401
00402 typedef struct
00403 tagInspiralSNRIntegrandParams
00404 {
00405 INT4 lag;
00406
00407 REAL8 phase;
00408 REAL8 deltaT;
00409 }
00410 InspiralSNRIntegrandParams;
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429 void
00430 LALNoiseSpectralDensity
00431 (
00432 LALStatus *status,
00433 REAL8Vector *psd,
00434 void (*NoisePsd)(LALStatus *status, REAL8 *shf, REAL8 f),
00435 REAL8 f
00436 );
00437
00438
00439
00440
00441
00442 void
00443 LALInspiralWaveCorrelate
00444 (
00445 LALStatus *status,
00446 REAL4Vector *output,
00447 InspiralWaveCorrelateIn in
00448 );
00449
00450
00451
00452
00453
00454 void
00455 LALInspiralWaveNormalise
00456 (
00457 LALStatus *status,
00458 REAL4Vector *dh,
00459 REAL8 *norm,
00460 REAL8Vector psd
00461 );
00462
00463
00464
00465
00466
00467 void
00468 LALInspiralWaveNormaliseLSO
00469 (
00470 LALStatus *status,
00471 REAL4Vector *filter,
00472 REAL8 *norm,
00473 InspiralWaveNormaliseIn *in
00474 );
00475
00476
00477
00478
00479
00480 void
00481 LALEGOPsd
00482 (
00483 LALStatus *status,
00484 REAL8 *shf,
00485 REAL8 x
00486 );
00487
00488
00489
00490
00491
00492
00493 void
00494 LALGEOPsd
00495 (
00496 LALStatus *status,
00497 REAL8 *shf,
00498 REAL8 x
00499 );
00500
00501
00502
00503
00504
00505 void
00506 LALAdvLIGOPsd
00507 (
00508 LALStatus *status,
00509 REAL8 *shf,
00510 REAL8 x
00511 );
00512
00513
00514
00515
00516
00517 void
00518 LALLIGOIPsd
00519 (
00520 LALStatus *status,
00521 REAL8 *shf,
00522 REAL8 x
00523 );
00524
00525
00526
00527
00528
00529 void
00530 LALTAMAPsd
00531 (
00532 LALStatus *status,
00533 REAL8 *shf,
00534 REAL8 x
00535 );
00536
00537
00538
00539
00540
00541 void
00542 LALVIRGOPsd
00543 (
00544 LALStatus *status,
00545 REAL8 *shf,
00546 REAL8 x
00547 );
00548
00549
00550
00551
00552
00553
00554 void
00555 LALRandomInspiralSignal
00556 (
00557 LALStatus *status,
00558 REAL4Vector *signalvec,
00559 RandomInspiralSignalIn *randIn
00560 );
00561
00562
00563
00564
00565
00566 void
00567 LALColoredNoise
00568 (
00569 LALStatus *status,
00570 REAL4Vector *noisy,
00571 REAL8Vector psd
00572 );
00573
00574
00575
00576
00577
00578 void
00579 LALAddVectors
00580 (
00581 LALStatus *status,
00582 REAL4Vector *vector,
00583 AddVectorsIn in);
00584
00585
00586
00587
00588
00589 void
00590 LALInspiralWaveOverlap
00591 (
00592 LALStatus *status,
00593 REAL4Vector *output,
00594 InspiralWaveOverlapOut *overlapout,
00595 InspiralWaveOverlapIn *overlapin
00596 );
00597
00598 void LALInspiralGetOrthoNormalFilter(REAL4Vector *filter2, REAL4Vector *filter1);
00599
00600
00601
00602
00603
00604 void
00605 LALInspiralFindEvents
00606 (
00607 LALStatus *status,
00608 INT4 *nEvents,
00609 InspiralEventsList **findeventsout,
00610 InspiralFindEventsIn *findeventsin
00611 );
00612
00613
00614
00615
00616
00617
00618 void
00619 LALInspiralFindLoudestEvent
00620 (
00621 LALStatus *status,
00622 INT4 *nEvents,
00623 InspiralEventsList *eventlist,
00624 InspiralFindEventsIn *findeventsin
00625 );
00626
00627
00628
00629
00630
00631 void
00632 LALInspiralFindEventsCluster
00633 (
00634 LALStatus *status,
00635 INT4 *nEvents,
00636 InspiralEventsList **findeventsout,
00637 InspiralFindEventsIn *findeventsin
00638 );
00639
00640
00641
00642
00643
00644 void
00645 LALStatsREAL4Vector
00646 (
00647 LALStatus *status,
00648 StatsREAL4VectorOut *out,
00649 REAL4Vector *vector
00650 );
00651
00652
00653
00654
00655
00656
00657 void
00658 LALInspiralComputeChisq
00659 (
00660 LALStatus *status,
00661 REAL4 *chisq,
00662 InspiralChisqDataVec *input,
00663 InspiralChisqParams *params
00664 );
00665
00666
00667
00668
00669
00670
00671 void
00672 LALInspiralComputeSNRIntegrand
00673 (
00674 LALStatus *status,
00675 REAL4Vector *output,
00676 InspiralWaveCorrelateIn corrin,
00677 InspiralSNRIntegrandParams *params
00678 );
00679
00680
00681
00682 void LALDiscoverInspiralEvents
00683 (
00684 LALStatus *status,
00685 INT4 *nEvents,
00686 DiscoverInspiralEventsList **eventlist,
00687 DiscoverInspiralEventsIn *findeventsin
00688 );
00689
00690 void LALEstimateEffectiveDistance
00691 (
00692 LALStatus *status,
00693 InspiralTemplate param,
00694 REAL8 df,
00695 REAL8Vector *psd,
00696 REAL8 snr,
00697 REAL8 *effDistance
00698 );
00699
00700 void LALEvaluateInspiralChisqTest
00701 (
00702 LALStatus *status,
00703 InspiralChisqOutput *chisqOut,
00704 InspiralChisqInput *chisqIn
00705 );
00706
00707 void LALTruncateInvSpectrum
00708 (
00709 LALStatus *status,
00710 REAL8Vector *inputVec,
00711 InvSpecTruncationParams *params
00712 );
00713
00714
00715 void GenerateTimeDomainWaveformForInjection (
00716 LALStatus *status,
00717 REAL4Vector *buff,
00718 InspiralTemplate *params
00719 );
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733 #ifdef __cplusplus
00734 }
00735 #endif
00736
00737 #endif