Logo coherent WaveBurst  
Library Reference Guide
Logo
CWB_Plugin_Linear_Bilinear_Regression.C
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 #define XIFO 4
20 
21 #pragma GCC system_header
22 
23 #include "cwb.hh"
24 #include "config.hh"
25 #include "network.hh"
26 #include "wavearray.hh"
27 #include "TString.h"
28 #include "TObjArray.h"
29 #include "TObjString.h"
30 #include "TRandom.h"
31 #include "TComplex.h"
32 #include "TMath.h"
33 #include "TSystem.h"
34 #include "mdc.hh"
35 #include "WDM.hh"
36 #include "regression.hh"
37 #include "frame.hh"
38 #include "watplot.hh"
39 #include "Biorthogonal.hh"
40 #include <fstream>
41 #include <vector>
42 
43 
44 using namespace CWB;
45 
46 void
48 //!REGRESSION
49 // Plugin for linear/bilinear regression analysis for one detector
50 
51  cout << endl;
52  cout << "-----> CWB_Plugin_Linear_Bilinear_Regression.C : " << ifo.Data() << endl;
53  cout << endl;
54 
55  char cmd[128];
56  sprintf(cmd,"int type = %d;",type);
57  gROOT->ProcessLine(cmd);
58  sprintf(cmd,"network* net = (network*)%p;",net);
59  gROOT->ProcessLine(cmd);
60 
61  //---------------------------------------------------------------------
62  // MAIN REGRESSION
63  //---------------------------------------------------------------------
64 
65  bool EXIT_AFTER_REGRESSION = true; // if true cwb terminate after the regression analysis
66  bool APPLY_LINEAR_REGRESSION = true; // if true then linear regression is applied
67  bool APPLY_BILINEAR_REGRESSION = true; // if true then blinear regression is applied;
68  bool SAVE_INFRAME = false; // if true the input data are saved to frame files
69  bool SAVE_OUTFRAME = true; // if true the cleaned data are saved to frame files
70  bool SAVE_PSD_PLOT = false; // if true psd cleaned vs noisy data are saved to png
71  bool SAVE_EIGEN_PLOT = false; // if true the regression filter eigenvaules are saved to png
72  int CUT_LOW_FREQ = 32; // if > 0 the data in [0:CUT_LOW_FREQ] are set to 0
73 
74  TString OFRDIR = "oframes"; // output frame files directory
75  TString FRNAME = ""; // frame name
76  TString FRLABEL = ""; // name used to label the output frames
77 
78  bool DISABLE_MDC_FROM_FRAMES = true; // if true then disable read mdc from frames
79  bool DISABLE_MDC_FROM_PLUGIN = false; // if true then disable read mdc from plugin
80 
81  //---------------------------------------------------------------------
82  // REGRESSION PARAMETERS
83  //---------------------------------------------------------------------
84 
85  TString FRLIST_WITNESS = ""; // list of witness frame files
86  TString CHLIST_LINEAR = ""; // list of channel names used for linear regression
87  TString CHLIST_BILINEAR = ""; // list of channel names used for bilinear regression
88 
89  TString CHNAME_LINEAR = ""; // channel name used to made the bilinear channels
90 
91  int RESAMPLING_INDEX = 11; // resample target/witness channels to pow(2,RESAMPLING_INDEX)
92 
93  double WFLOW = 0; // lower frequency used to made the bilinear channels
94  double WFHIGH = 10; // high frequency used to made the bilinear channels
95 
96  //---------------------------------------------------------------------
97  // REGRESSION PARAMETERS
98  //---------------------------------------------------------------------
99 
100  double LAYER_WIDTH = 1.0; // frequency layer resolution used in the regression analysis
101  double fPOWERLINE = 60.0; // powerline frequency (Hz)
102  int lPOWERLINE = 1; // low power line harmonic (lPOWERLINE*fPOWERLINE)
103  int hPOWERLINE = 3; // high power line harmonic (hPOWERLINE*fPOWERLINE)
104  double FWIDTH = 5; // frequency width used by regression
105 
106  // PARAMETERS FOR LINEAR REGRESSION
107 
108  int L_NFILTER = 5; // half-size length of a unit filter (setFilter)
109  double L_APPLY_THRESHOLD = 0.2; // threshold used in apply
110  double L_SOLVE_THRESHOLD = 0.0; // eigenvalue threshold (solve)
111  double L_SOLVE_NEIGEN_PER_LAYER = 0; // number of selected eigenvalues (solve)
112  char L_SOLVE_REGULATOR = 'h'; // regulator (solve)
113 
114  // PARAMETERS FOR BILINEAR REGRESSION
115 
116  int B_NFILTER = 5; // half-size length of a unit filter (setFilter)
117  double B_APPLY_THRESHOLD = 0.2; // threshold used in apply
118  double B_SOLVE_THRESHOLD = 0.0; // eigenvalue threshold (solve)
119  double B_SOLVE_NEIGEN_PER_LAYER = 0; // number of selected eigenvalues (solve)
120  char B_SOLVE_REGULATOR = 'h'; // regulator (solve)
121 
122  // ---------------------------------
123  // read plugin config
124  // ---------------------------------
125 
126  cfg->configPlugin.Exec();
127 
128  IMPORT(bool,EXIT_AFTER_REGRESSION)
129  IMPORT(bool,APPLY_LINEAR_REGRESSION)
130  IMPORT(bool,APPLY_BILINEAR_REGRESSION)
131  IMPORT(bool,SAVE_INFRAME)
132  IMPORT(bool,SAVE_OUTFRAME)
133  IMPORT(bool,SAVE_PSD_PLOT)
134  IMPORT(bool,SAVE_EIGEN_PLOT)
135  IMPORT(int,CUT_LOW_FREQ)
136  IMPORT(bool,DISABLE_MDC_FROM_FRAMES)
137  IMPORT(bool,DISABLE_MDC_FROM_PLUGIN)
138  IMPORT(int,RESAMPLING_INDEX)
139  IMPORT(double,WFLOW)
140  IMPORT(double,WFHIGH)
141 
142  IMPORT(TString,OFRDIR)
143  IMPORT(TString,FRNAME)
144  IMPORT(TString,FRLABEL)
145  IMPORT(TString,FRLIST_WITNESS)
146  IMPORT(TString,CHLIST_LINEAR)
147  IMPORT(TString,CHLIST_BILINEAR)
148  IMPORT(TString,CHNAME_LINEAR)
149 
150  if(FRLIST_WITNESS=="") {cout << "Error : witness frames list not defined" << endl;gSystem->Exit(1);}
151  if(CHLIST_LINEAR=="") {cout << "Error : linear witness channels list not defined" << endl;gSystem->Exit(1);}
152  if(CHLIST_BILINEAR=="") {cout << "Error : bilinear witness channels list not defined" << endl;gSystem->Exit(1);}
153  if(CHNAME_LINEAR=="") {cout << "Error : main linear witness channel list not defined" << endl;gSystem->Exit(1);}
154  if(FRNAME=="") {cout << "Error : frame name not defined" << endl;gSystem->Exit(1);}
155  if(FRLABEL=="") {cout << "Error : frame label not defined" << endl;gSystem->Exit(1);}
156 
157  IMPORT(double,LAYER_WIDTH)
158  IMPORT(double,fPOWERLINE)
159  IMPORT(int,lPOWERLINE)
160  IMPORT(int,hPOWERLINE)
161  IMPORT(double,FWIDTH)
162 
163  IMPORT(int,L_NFILTER)
164  IMPORT(double,L_APPLY_THRESHOLD)
165  IMPORT(double,L_SOLVE_THRESHOLD)
166  IMPORT(double,L_SOLVE_NEIGEN_PER_LAYER)
167  IMPORT(char,L_SOLVE_REGULATOR)
168 
169  IMPORT(int,B_NFILTER)
170  IMPORT(double,B_APPLY_THRESHOLD)
171  IMPORT(double,B_SOLVE_THRESHOLD)
172  IMPORT(double,B_SOLVE_NEIGEN_PER_LAYER)
173  IMPORT(char,B_SOLVE_REGULATOR)
174 
175  if(!APPLY_LINEAR_REGRESSION && !APPLY_BILINEAR_REGRESSION) {
176  cout << "Error : regression type [linear/bilinear] is not defined" << endl;
177  gSystem->Exit(1);
178  }
179 
180  if(type==CWB_PLUGIN_CONFIG) {
181  cfg->dataPlugin=false; // disable read data from frames
182  cfg->mdcPlugin=DISABLE_MDC_FROM_FRAMES; // disable read mdc from frames
183  }
184 
185  if(type==CWB_PLUGIN_MDC) {
186 
187  if(DISABLE_MDC_FROM_PLUGIN) {*x=0.;return;}
188 
189  CWB::mdc MDC(net);
190 
191  // ---------------------------------
192  // read plugin config
193  // ---------------------------------
194 
195  cfg->configPlugin.Exec();
196 
197  // ---------------------------------
198  // set list of mdc waveforms
199  // ---------------------------------
200 
201  IMPORT(CWB::mdc,MDC)
202  MDC.Print();
203 
204  // ---------------------------------
205  // get mdc data
206  // ---------------------------------
207 
208  MDC.Get(*x,ifo);
209 
210  // ---------------------------------
211  // set mdc list in the network class
212  // ---------------------------------
213 
214  if(ifo.CompareTo(net->ifoName[0])==0) {
215  net->mdcList.clear();
216  net->mdcType.clear();
217  net->mdcTime.clear();
218  net->mdcList=MDC.mdcList;
219  net->mdcType=MDC.mdcType;
220  net->mdcTime=MDC.mdcTime;
221  }
222 
223  cout.precision(14);
224  for(int k=0;k<(int)net->mdcList.size();k++) cout << k << " mdcList " << MDC.mdcList[k] << endl;
225  for(int k=0;k<(int)net->mdcTime.size();k++) cout << k << " mdcTime " << MDC.mdcTime[k] << endl;
226  for(int k=0;k<(int)net->mdcType.size();k++) cout << k << " mdcType " << MDC.mdcType[k] << endl;
227  }
228 
229 
230  if(type==CWB_PLUGIN_DATA_MDC) {
231 
232  // create output regression report dirs
233  gSystem->Exec(TString("mkdir -p ")+TString(OFRDIR));
234 
235  // get ifo index
236  int xIFO =0;
237  for(int n=0;n<cfg->nIFO;n++) if(ifo==cfg->ifo[n]) {xIFO=n;break;}
238 
239  int runID = net->nRun;
240  char flabel[512];
241  int Tb=x->start();
242  int dT=x->size()/x->rate();
243  sprintf(flabel,"%d_%d_%s_job%d",int(Tb),int(dT),cfg->data_label,runID);
244 
245  Biorthogonal<double> Bio(512);
246  WSeries<double> wB(Bio);
247  WSeries<double> wT;
248  int size=0;
249 
250  // target channel
251  int level=x->getLevel(); // save the input decomposition level
252  x->Inverse(-1);
253  wavearray<double> xx(x->size());
254  xx.start(x->start());
255  xx.rate(x->rate());
256  for(int i=0;i<x->size();i++) xx.data[i]=x->data[i];
257 
258  if(CUT_LOW_FREQ>0) {
259  // set range [0-CUT_LOW_FREQ]Hz to 0 (remove large dynamics at low frequency)
260  int SR = int(xx.rate());
261  int mm = 0;
262  while (((SR % 2) == 0) && SR > 2*CUT_LOW_FREQ) {SR /= 2;mm++;}
263  wB.Forward(xx,mm);
264  for(int i=0;i<1;i++) {wB.getLayer(xx,i);xx=0;wB.putLayer(xx,i);}
265  wB.Inverse();
266  wB.getLayer(xx,0);
267  cout << "Set Frequency Range [0:" << SR/2 << "] = 0" << endl;
268  }
269 
270  // resample target to pow(2,RESAMPLING_INDEX) Hz
271  int sr = int(xx.rate());
272  int nn = 0;
273  while (((sr % 2) == 0) && sr > (1<<RESAMPLING_INDEX)) {sr /= 2;nn++;}
274  wB.Forward(xx,nn);
275  wB.getLayer(xx,0);
276 
277  int rrlevel=xx.rate()/(2*LAYER_WIDTH);
278  WDM<double> WD(rrlevel, 2*rrlevel, 6, 12);
279  double scratch = WD.m_H/xx.rate();
280  if(scratch>cfg->segEdge+0.001) {
281  cout << endl;
282  cout << "Regression Plugin : Error - filter scratch must be <= cwb scratch!!!" << endl;
283  cout << "filter scratch : " << scratch << " sec" << endl;
284  cout << "cwb scratch : " << cfg->segEdge << " sec" << endl;
285  gSystem->Exit(1);
286  }
287 
288  regression rr;
289 
290  // --------------------------------------------------------------
291  // LINEAR CLEANING
292  // --------------------------------------------------------------
293 
294  if(APPLY_LINEAR_REGRESSION) {
295 
296  cout << "CWB_PLUGIN_DATA_MDC : Apply Linear Regression ..." << endl;
297 
298  frame frl(FRLIST_WITNESS,"","README",true);
300  wl.start(x->start()); wl.stop(x->stop());
301  wT.Forward(xx,WD);
302  size = rr.add(wT,"target");
303  if(size==0) {cout << "Regression Plugin - empty target channel" << endl;gSystem->Exit(1);}
304  rr.mask(0,0.,xx.rate()/2.);
305  for(int n=lPOWERLINE;n<=hPOWERLINE;n++) {double f=n*fPOWERLINE;rr.unmask(0,f-FWIDTH,f+FWIDTH);}
306 
307  // open linear channel list
308  ifstream ifl;
309  ifl.open(CHLIST_LINEAR.Data(),ios::in);
310  if (!ifl.good()) {cout << "Error Opening File : " << CHLIST_LINEAR.Data() << endl;gSystem->Exit(1);}
311 
312  char linear[1024];
313  cout << endl;
314  while(true) {
315  ifl >> linear;
316  if (!ifl.good()) break;
317  if(linear[0]=='#') continue;
318  cout << "read linear channel : \t" << linear << endl;
319  frl.setChName(linear);
320  frl.setSRIndex(RESAMPLING_INDEX);
321  frl >> wl;
322  rr.add(wl,linear);
323  }
324  cout << endl;
325  ifl.close();
326  rr.setFilter(L_NFILTER);
327  rr.setMatrix(cfg->segEdge,1.);
328  rr.solve(L_SOLVE_THRESHOLD,L_SOLVE_NEIGEN_PER_LAYER,L_SOLVE_REGULATOR);
329  rr.apply(L_APPLY_THRESHOLD);
330  wl.resize(0);
331  if(SAVE_EIGEN_PLOT) {
332  gROOT->SetBatch(true);
333  char ofName[256];
334  char gtitle[256];
335 
336  wavearray<double> eigen = rr.getVEIGEN(0);
337  watplot eplot(const_cast<char*>("eplot"),200,20,800,500);
338  sprintf(gtitle,"Linear Regression Filter eigenvalues");
339  eplot.gtitle(gtitle,"filter index","eigenvalue");
340  eplot.goptions("alp", 1, 0., 0.);
341 
342  sprintf(ofName,"%s/eigen_linear_regression_%s_%s.png",cfg->dump_dir,ifo.Data(),flabel);
343  cout << "write results to " << ofName << endl;
344 
346  eigen >> eplot; eplot >> gfile;
347  }
348  }
349 
350  // --------------------------------------------------------------
351  // BILINEAR CLEANING
352  // --------------------------------------------------------------
353 
354  if(APPLY_BILINEAR_REGRESSION) {
355 
356  cout << "CWB_PLUGIN_DATA_MDC : Apply Bilinear Regression ..." << endl;
357 
359  wT.Forward(yy,WD);
360  rr.clear();
361  size=rr.add(wT,"target");
362  if(size==0) {cout << "Regression Plugin - empty target channel" << endl;gSystem->Exit(1);}
363  rr.mask(0,0.,yy.rate()/2.);
364  for(int n=lPOWERLINE;n<=hPOWERLINE;n++) {double f=n*fPOWERLINE;rr.unmask(0,f-FWIDTH,f+FWIDTH);}
365 
366  // add main linear channel for bicoherence removal
367  cout << endl;
368  cout << "read main linear channel : \t" << CHNAME_LINEAR.Data() << endl << endl;
370  ml.start(x->start()); ml.stop(x->stop());
371  frame frb(FRLIST_WITNESS,"","README",true);
372  frb.setChName(CHNAME_LINEAR);
373  frb.setSRIndex(RESAMPLING_INDEX);
374  frb >> ml;
375  size=rr.add(ml,const_cast<char*>(CHNAME_LINEAR.Data()));
376  if(size==0) {cout << "Regression Plugin - empty main linear channel" << endl;gSystem->Exit(1);}
377 
378  // open bilinear channel list
379  ifstream iwb;
380  iwb.open(CHLIST_BILINEAR.Data(),ios::in);
381  if (!iwb.good()) {cout << "Error Opening File : " << CHLIST_BILINEAR.Data() << endl;gSystem->Exit(2);}
382 
383  char bilinear[1024];
385  wb.start(x->start()); wb.stop(x->stop());
386  int nBILINEAR=0;
387  cout << endl;
388  while(true) {
389  iwb >> bilinear;
390  if (!iwb.good()) break;
391  if(bilinear[0]=='#') continue;
392  cout << "read bilinear channel : \t" << bilinear << endl;
393  frb.setChName(bilinear);
394  frb.setSRIndex(RESAMPLING_INDEX);
395  frb >> wb;
396  if(!rr.add(wb,bilinear,WFLOW,WFHIGH)) continue;
397  nBILINEAR++;
398  }
399  iwb.close();
400  cout << endl;
401  for(int n=2;n<=nBILINEAR+1;n++) rr.add(1,n,"bilinear");
402  for(int n=1;n<=nBILINEAR+1;n++) rr.mask(n);
403 
404  rr.setFilter(B_NFILTER);
405  rr.setMatrix(cfg->segEdge,1.);
406  rr.solve(B_SOLVE_THRESHOLD,B_SOLVE_NEIGEN_PER_LAYER,B_SOLVE_REGULATOR);
407  rr.apply(B_APPLY_THRESHOLD);
408  ml.resize(0);
409  wb.resize(0);
410  if(SAVE_EIGEN_PLOT) {
411  gROOT->SetBatch(true);
412  char ofName[256];
413  char gtitle[256];
414 
415  wavearray<double> eigen = rr.getVEIGEN(0);
416  watplot eplot(const_cast<char*>("eplot"),200,20,800,500);
417  sprintf(gtitle,"Linear Regression Filter eigenvalues");
418  eplot.gtitle(gtitle,"filter index","eigenvalue");
419  eplot.goptions("alp", 1, 0., 0.);
420 
421  sprintf(ofName,"%s/eigen_bilinear_regression_%s_%s.png",cfg->dump_dir,ifo.Data(),flabel);
422  cout << "write results to " << ofName << endl;
423 
425  eigen >> eplot; eplot >> gfile;
426  }
427  }
428 
429  // get cleaned data
430  wavearray<double> cc = rr.getClean();
431 
432  if(SAVE_PSD_PLOT) {
433  gROOT->SetBatch(true);
434 
435  char ofName[512];
436  char gtitle[256];
437  TString gfile;
438  watplot plot(const_cast<char*>("plot"),200,20,800,500);
439 
440  double tstart = xx.start()+cfg->segEdge;
441  double tstop = xx.stop()-cfg->segEdge;
442 
443  // save psd cleaned/dirty data
444  for(int n=lPOWERLINE;n<=hPOWERLINE;n++) {
445  double flow=n*fPOWERLINE-FWIDTH;
446  double fhigh=n*fPOWERLINE+FWIDTH;
447  sprintf(gtitle,"Dirty/Cleaned Data %s - %3.0f-%3.0f Hz",
448  cfg->channelNamesRaw[xIFO],flow,fhigh);
449  plot.gtitle(gtitle,"frequency (Hz)","strain/#sqrt{Hz}");
450  plot.goptions("alp logy", 1, tstart, tstop, true, flow,fhigh, true, 32);
451 
452  sprintf(ofName,"%s/psd_regression_%s_%s_F%2.0f_F%2.0f.png",cfg->dump_dir,ifo.Data(),flabel,flow,fhigh);
453  cout << "write results to " << ofName << endl;
454 
455  gfile=ofName;
456  xx >> plot; cc >> plot; plot >> gfile;
457  }
458  }
459 
460  if (SAVE_INFRAME) {
461  double OS=0;
462  char frName[512];
463  char chName[512];
464  char ofName[512];
465 
466  // save noisy data into frame
467  wavearray<double> XX = xx;
468 /*
469  // restore original rate
470  wB.Forward(cc,nn);
471  wB.putLayer(xx,0);
472  wB.Inverse();
473  wB.getLayer(XX,0);
474 */
475  // remove scratch
476  OS = cfg->segEdge*cc.rate();
477  XX.start(xx.start()+cfg->segEdge);
478  XX.stop(xx.stop()-cfg->segEdge);
479  XX.resize(xx.size()-2*OS);
480  for(int i=0;i<XX.size()-2*OS;i++) XX[i]=XX[i+OS];
481 
482  sprintf(chName,cfg->channelNamesRaw[xIFO]);
483  sprintf(frName,FRNAME.Data());
484  sprintf(ofName,"%s/I-%s-%lu-%lu.gwf",
485  OFRDIR.Data(),FRLABEL.Data(),(int)XX.start(),(int)XX.stop()-(int)XX.start());
486  cout << "write frame file " << ofName << endl;
487  frame xfr(ofName,chName,"WRITE");
488  xfr.setFrName(frName);
489  XX >> xfr;
490  xfr.close();
491  XX.resize(0);
492  }
493 
494  if (SAVE_OUTFRAME) {
495  double OS=0;
496  char frName[512];
497  char chName[512];
498  char ofName[512];
499 
500  // save cleaned data into frame
501  wavearray<double> CC = cc;
502 /*
503  // restore original rate
504  wB.putLayer(cc,0);
505  wB.Inverse();
506  wB.getLayer(CC,0);
507 */
508  // remove scratch
509  OS = cfg->segEdge*cc.rate();
510  CC.start(cc.start()+cfg->segEdge);
511  CC.stop(cc.stop()-cfg->segEdge);
512  CC.resize(cc.size()-2*OS);
513  for(int i=0;i<CC.size()-2*OS;i++) CC[i]=CC[i+OS];
514 
515  sprintf(chName,cfg->channelNamesRaw[xIFO]);
516  sprintf(frName,FRNAME.Data());
517  sprintf(ofName,"%s/R-%s-%lu-%lu.gwf",
518  OFRDIR.Data(),FRLABEL.Data(),(int)CC.start(),(int)CC.stop()-(int)CC.start());
519  cout << "write frame file " << ofName << endl;
520  frame cfr(ofName,chName,"WRITE");
521  cfr.setFrName(frName);
522  CC >> cfr;
523  cfr.close();
524  CC.resize(0);
525  }
526 
527  if(EXIT_AFTER_REGRESSION) {
528  // end job - clean temporary files
529  if(ifo==cfg->ifo[xIFO]) {
530  cout << "remove temporary file ..." << endl;
531  TString jname = jfile->GetPath();
532  jname.ReplaceAll(":/","");
533  cout << jname.Data() << endl;
534  gSystem->Exec(TString("rm "+jname).Data());
535  cout << "end job" << endl;
536  gSystem->Exit(0);
537  }
538  } else {
539  // restore original rate
540  wB.putLayer(cc,0);
541  wB.Inverse();
542  wB.getLayer(cc,0);
543  // return the cleaned data
544  for(int i=0;i<x->size();i++) x->data[i]=cc.data[i];
545  // restore original decomposition level
546  x->Forward(level);
547  }
548  }
549 
550  return;
551 }
std::vector< char * > ifoName
Definition: network.hh:609
CWB::config * cfg
void gtitle(TString title="", TString xtitle="", TString ytitle="")
Definition: watplot.cc:1256
TString ofName
void setMatrix(double edge=0., double f=1.)
Definition: regression.cc:425
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
COHERENCE.
TMacro configPlugin
Definition: config.hh:362
TString Get(wavearray< double > &x, TString ifo)
Definition: mdc.cc:1529
bool mdcPlugin
Definition: config.hh:365
Definition: ced.hh:42
std::vector< std::string > mdcList
Definition: mdc.hh:389
virtual void rate(double r)
Definition: wavearray.hh:141
void setFrName(TString frName)
Definition: frame.hh:126
bool dataPlugin
Definition: config.hh:364
int n
Definition: cwb_net.C:28
TString("c")
std::vector< std::string > mdcType
Definition: mdc.hh:390
size_t nRun
Definition: network.hh:572
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1) *itime+ifreq;double time=itime *dT;double freq=(ifreq >0) ? ifreq *dF :dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
void close()
Definition: frame.cc:296
plot gtitle(gtitle,"frequency (Hz)","strain/#sqrt{Hz}")
std::vector< std::string > mdcType
Definition: network.hh:613
CWB::mdc * MDC
Long_t size
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
i drho i
std::vector< double > mdcTime
Definition: network.hh:614
cout<< "SNR "<< xsnr<< endl;wavearray< double > f
Definition: ComputeSNR.C:75
void Print(int level=0)
Definition: mdc.cc:2736
char ifo[NIFO_MAX][8]
network ** net
NOISE_MDC_SIMULATION.
void setChName(TString chName)
Definition: frame.hh:120
double segEdge
Definition: config.hh:164
double tstart
virtual size_t size() const
Definition: wavearray.hh:145
int getLevel()
Definition: wseries.hh:109
TString chName[NIFO_MAX]
x plot
jfile
Definition: cwb_job_obj.C:43
wavearray< double > xx
Definition: TestFrame1.C:11
Definition: mdc.hh:248
#define IMPORT(TYPE, VAR)
Definition: cwb.hh:69
i() int(T_cor *100))
std::vector< std::string > mdcList
Definition: network.hh:612
double fhigh
void apply(double threshold=0., char c='a')
Definition: regression.cc:709
int getLayer(wavearray< DataType_t > &w, double n)
param: n - layer number
Definition: wseries.cc:193
char channelNamesRaw[NIFO_MAX][50]
Definition: config.hh:310
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
int k
void solve(double th, int nE=0, char c='s')
Definition: regression.cc:610
double tstop
size_t setFilter(size_t)
Definition: regression.cc:276
void setSRIndex(int srIndex)
Definition: frame.hh:114
wavearray< double > getVEIGEN(int n=-1)
Definition: regression.cc:357
wavearray< double > getClean()
Definition: regression.hh:135
wavearray< double > yy
Definition: TestFrame5.C:12
void clear()
Definition: regression.hh:160
double flow
TString frName[NIFO_MAX]
double Tb
ifstream in
virtual void stop(double s)
Definition: wavearray.hh:139
char ifo[NIFO_MAX][8]
Definition: config.hh:124
char dump_dir[1024]
Definition: config.hh:328
char cmd[1024]
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
TString OS
Definition: cwb_rootlogon.C:25
#define FRLIST_WITNESS
Definition: RegressionL1.C:2
void mask(int n, double flow=0., double fhigh=0.)
Definition: regression.cc:321
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
TString gfile
int nIFO
Definition: config.hh:120
DataType_t * data
Definition: wavearray.hh:319
TString jname
double dT
Definition: testWDM_5.C:12
std::vector< double > mdcTime
Definition: mdc.hh:392
char data_label[1024]
Definition: config.hh:332
virtual void resize(unsigned int)
Definition: wavearray.cc:463
void Inverse(int n=-1)
param: n - number of steps (-1 means full reconstruction)
Definition: wseries.cc:291
void putLayer(wavearray< DataType_t > &, double n)
param: n - layer number
Definition: wseries.cc:219
int m_H
Definition: Wavelet.hh:121