Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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,"hchannel");
36  r.mask(0);
37  r.unmask(0,F1,F2);
38 
39  r.add(h,"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("alp logy", 1, START, START+LENGHT, true, F1, F2, true, 50);
50  h >> plot;
51  r.getClean() >> plot;
52  plot >> "Regression_LPE_H1.png";
53 
54  wavearray<double> freq=r.vfreq;
56  for (int i=0; i<freq.size(); i++) cout << freq.data[i] << " " << rank.data[i] << endl;
57 }
virtual size_t size() const
Definition: wavearray.hh:127
void setMatrix(double edge=0., double f=1.)
Definition: regression.cc:407
#define LENGHT
Definition: ced.hh:24
watplot plot
#define F1
float * rank
size_t add(WSeries< double > &target, char *name, double fL=0., double fH=0.)
Definition: regression.cc:73
virtual void start(double s)
Definition: wavearray.hh:119
Meyer< double > B(1024)
i drho i
#define START
#define HCHANNEL
WSeries< double > tfmap
#define F2
void apply(double threshold=0., char c='a')
Definition: regression.cc:691
regression r
wavearray< double > getRank(int n)
Definition: regression.hh:134
int getLayer(wavearray< DataType_t > &w, double n)
param: n - layer number
Definition: wseries.cc:175
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:1202
void solve(double th, int nE=0, char c='s')
Definition: regression.cc:592
wavearray< double > h
wavearray< double > vfreq
Definition: regression.hh:171
size_t setFilter(size_t)
Definition: regression.cc:258
wavearray< double > getClean()
Definition: regression.hh:117
WDM< double > wdtf(lev, 2 *lev, 6, 10)
Definition: Meyer.hh:18
#define FRLIST_NAME
virtual void stop(double s)
Definition: wavearray.hh:121
void Forward(int n=-1)
param: wavelet - n is number of steps (-1 means full decomposition)
Definition: wseries.cc:228
void unmask(int n, double flow=0., double fhigh=0.)
Definition: regression.cc:321
void mask(int n, double flow=0., double fhigh=0.)
Definition: regression.cc:303
frame frt(FRLIST_NAME, HCHANNEL)
WSeries< double > ww
DataType_t * data
Definition: wavearray.hh:301
int totalscratch