Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DrawInspiral.C
Go to the documentation of this file.
1 //#define READ_SETUP_FROM_XML_FILE
2 
3 {
4  //
5  // Show how to use mdc class to get & draw LAL inpiral waveforms
6  // Author : Gabriele Vedovato
7 
8  #include <vector>
9 
10  CWB::mdc MDC;
11 
12 #ifndef READ_SETUP_FROM_XML_FILE
13  // ---------------------------------
14  // set inspiral parms
15  // ---------------------------------
17  inspOptions = "--time-step 60.0 --time-interval 3 ";
18  inspOptions+= "--l-distr random ";
19  inspOptions+= "--gps-start-time 931072130 --gps-end-time 933491330 ";
20  inspOptions+= "--d-distr volume --m-distr totalMassRatio --i-distr uniform ";
21  inspOptions+= "--f-lower 10.000000 ";
22  inspOptions+= "--min-mass1 25.000000 --max-mass1 225.000000 ";
23  inspOptions+= "--min-mass2 25.000000 --max-mass2 225.000000 ";
24  inspOptions+= "--min-mtotal 50.000000 --max-mtotal 250.000000 ";
25  inspOptions+= "--min-mratio 0.25 --max-mratio 1.000000 ";
26  inspOptions+= "--min-distance 1000000.0 --max-distance 1500000.0 ";
27  inspOptions+= "--approximant EOBNRv2pseudoFourPN --disable-spin ";
28  inspOptions+= "--taper-injection start --seed 123456789 ";
29  inspOptions+= "--dir ./ ";
30  inspOptions+= "--output inspirals.xml "; // set output xml file
31 
32  // set and write xml file
33  MDC.SetInspiral("EOBNRv2",inspOptions);
34 
35 #else
36  // set inspiral using xml file (speedup GetInspiral method)
37  TString inspOptions="--xml inspirals.xml ";
38  inspOptions+= "--dir ./ ";
39  MDC.SetInspiral("EOBNRv2",inspOptions);
40 #endif
41 
42  // Get the first waveform hp,hx components starting from gps = 931072130
43  wavearray<double> hp = MDC.GetInspiral("hp",931072130,931072230);
44  wavearray<double> hx = MDC.GetInspiral("hx",931072130,931072230);
45  cout << "size : " << hp.size() << " rate : " << hp.rate() << " start : " << (int)hp.start() << endl;
46  hp.start(0); // set start to 0 (needed by draw Method)
47  hx.start(0);
48  MDC.Draw(hp,MDC_TIME);
49  MDC.Draw(hx,MDC_TIME,"same",kRed);
50 
51  //MDC.Draw(hp,MDC_FFT); // draw hp in frequency domain
52  //MDC.Draw(hp,MDC_TF); // draw hp in time-frequency domain;
53 
54 }
virtual size_t size() const
Definition: wavearray.hh:127
Definition: mdc.hh:172
watplot * Draw(TString name, int id=0, TString polarization="hp", MDC_DRAW type=MDC_TIME, TString options="ALP", Color_t color=kBlack)
Definition: mdc.cc:2288
virtual void rate(double r)
Definition: wavearray.hh:123
TString inspOptions
Definition: DrawInspiral.C:16
TString("c")
CWB::mdc * MDC
wavearray< double > hp
Definition: DrawInspiral.C:43
virtual void start(double s)
Definition: wavearray.hh:119
Definition: mdc.hh:216
wavearray< double > hx
Definition: DrawInspiral.C:44
i() int(T_cor *100))