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