Logo coherent WaveBurst  
Library Reference Guide
Logo
Regression_LPE_H1.C
Go to the documentation of this file.
1 #define HCHANNEL "H1:LSC-STRAIN"
2 #define FRLIST_NAME "S5_H1_RDS_C03_L2.frl"
3 #define FRLIST_NAME2 "H-R-8159.frl"
4 #define START 815974300
5 #define LENGHT 1200
6 #define F1 32
7 #define F2 2048
8 
9 {
10 
11  using namespace CWB;
12  int totalscratch=32;
13 
14  //GetHchannel
16  h.start(START-totalscratch);
17  h.stop(LENGHT+START+totalscratch);
19  frt >> h;
20 
21  //Resample to 2048 Hz
22  Meyer<double> B(1024); // set wavelet for resampling
24  ww.Forward(h,B,2);
25  ww.getLayer(h,0);
26 
27  //Make WDM transform, resolution= 1Hz
28  int lev=h.rate()/2;
29  WDM<double> wdtf(lev, 2*lev, 6, 10);
31  tfmap.Forward(h, wdtf);
32 
33  //Adding target channel
35  r.add(tfmap,const_cast<char*>("hchannel"));
36  r.mask(0);
37  r.unmask(0,F1,F2);
38 
39  r.add(h,const_cast<char*>("hchannel"));
40 
41  //Calculate prediction
42  r.setFilter(10);
43  r.setMatrix(totalscratch,.95);
44  r.solve(0.2, 0, 'h');
45  r.apply(0.2);
46 
47  //Draw plot
49  plot.goptions(const_cast<char*>("alp logy"), 1, START, START+LENGHT, true, F1, F2, true, 50);
50  h >> plot;
52  hh >> plot;
53  TString ofile = "Regression_LPE_H1.png";
54  plot >> ofile;
55 
58  for (int i=0; i<freq.size(); i++) cout << freq.data[i] << " " << rank.data[i] << endl;
59 }
wavearray< double > hh
void setMatrix(double edge=0., double f=1.)
Definition: regression.cc:425
#define LENGHT
Definition: ced.hh:42
#define F1
TString("c")
size_t add(WSeries< double > &target, char *name, double fL=0., double fH=0.)
Definition: regression.cc:91
virtual void start(double s)
Definition: wavearray.hh:137
TString ofile
Meyer< double > B(1024)
i drho i
#define START
#define HCHANNEL
virtual size_t size() const
Definition: wavearray.hh:145
WSeries< double > tfmap
wavearray< double > freq
#define F2
void apply(double threshold=0., char c='a')
Definition: regression.cc:709
regression r
wavearray< double > getRank(int n)
Definition: regression.hh:152
int getLayer(wavearray< DataType_t > &w, double n)
param: n - layer number
Definition: wseries.cc:193
int lev
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:1221
wavearray< double > rank
void solve(double th, int nE=0, char c='s')
Definition: regression.cc:610
wavearray< double > h
wavearray< double > vfreq
Definition: regression.hh:189
size_t setFilter(size_t)
Definition: regression.cc:276
wavearray< double > getClean()
Definition: regression.hh:135
WDM< double > wdtf(lev, 2 *lev, 6, 10)
Definition: Meyer.hh:36
#define FRLIST_NAME
virtual void stop(double s)
Definition: wavearray.hh:139
void Forward(int n=-1)
param: wavelet - n is number of steps (-1 means full decomposition)
Definition: wseries.cc:246
void unmask(int n, double flow=0., double fhigh=0.)
Definition: regression.cc:339
void mask(int n, double flow=0., double fhigh=0.)
Definition: regression.cc:321
frame frt(FRLIST_NAME, HCHANNEL)
WSeries< double > ww
DataType_t * data
Definition: wavearray.hh:319
int totalscratch
watplot plot