Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ReadDisplayFrame.C
Go to the documentation of this file.
1 //
2 // Read data from frame and display content
3 // Author : Gabriele Vedovato
4 
5 {
6  #define FRLIST "oframes.frl"
7  #define CHNAME "H1:FAKE-STRAIN_INJ"
8  #define GPS 931072138
9  #define LENGTH 64
10 
11  //#define SAVE_PLOTS
12  #define DISPLAY_FFT
13 
14  char gtitle[256];
15  TString gfile;
16 
17  // read target data
19  x.start(GPS); x.stop(GPS+LENGTH);
20 
22  frt >> x;
23 
24  cout << "start " << x.start() << endl;
25 
26  x.start(0);
27  watplot tplot(const_cast<char*>("tplot"),200,20,800,500);
28  sprintf(gtitle,"Reconstructed Signal");
29  tplot.gtitle(gtitle,"time(sec)","amplitude");
30  tplot.goptions(const_cast<char*>("alp"), 1, 0., 0.);
31  // draw signal
32  x >> tplot;
33 
34 #ifdef SAVE_PLOTS
35  // save plot to file
36  gfile="hp_time.png";
37  tplot >> gfile;
38  gfile="hp_time.root";
39  tplot >> gfile;
40 #endif
41 
42 #ifdef DISPLAY_FFT
43  watplot fplot(const_cast<char*>("fplot"),200,20,800,500);
44  fplot.gtitle(gtitle,"frequency (Hz)","strain/#sqrt{Hz}");
45  fplot.goptions(const_cast<char*>("alp logy"), 1, 0., 0., true, 0,0);
46  x >> fplot;
47 
48 #ifdef SAVE_PLOTS
49  // save plot to file
50  gfile="hp_freq.png";
51  fplot >> gfile;
52  gfile="hp_freq.root";
53  fplot >> gfile;
54 #endif
55 #endif
56 
57 }
cout<< "start "<< x.start()<< endl;x.start(0);watplot tplot(const_cast< char * >"tplot"), 200, 20, 800, 500);sprintf(gtitle,"Reconstructed Signal");tplot.gtitle(gtitle,"time(sec)","amplitude");tplot.goptions(const_cast< char * >"alp"), 1, 0., 0.);x > tplot
void gtitle(TString title="", TString xtitle="", TString ytitle="")
Definition: watplot.cc:1237
CWB::frame frt(FRLIST, CHNAME)
#define LENGTH
cout<< "skymap size : "<< L<< endl;for(int l=0;l< L;l++) sm.set(l, l);sm > const_cast< char * >("skymap.dat")
TString("c")
fplot gtitle(gtitle,"frequency (Hz)","strain/#sqrt{Hz}")
watplot fplot(const_cast< char * >("fplot"), 200, 20, 800, 500)
virtual void start(double s)
Definition: wavearray.hh:119
#define FRLIST
#define CHNAME
void goptions(char *opt=NULL, int col=1, double t1=0., double t2=0., bool fft=false, float f1=0., float f2=0., bool psd=false, float t3=0., bool oneside=false)
Definition: watplot.cc:1202
wavearray< double > x
virtual void stop(double s)
Definition: wavearray.hh:121
#define GPS
TString gfile
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)