21 #pragma GCC system_header 28 #include "TObjArray.h" 29 #include "TObjString.h" 42 #define DATA_HANDLING // example of data handling 43 #define COPY_HANDLED_DATA // copy handled data to into the original x array 46 cout <<
"-----> CWB_Plugin_HandleWhiteDataWDM.C" << endl;
47 cout <<
"ifo " << ifo.Data() << endl;
48 cout <<
"type " << type << endl;
54 cout <<
"CWB_Plugin_HandleWhiteDataWDM.C : Error - analysis type must be 2G !!!" << endl;
62 for(
int level=cfg->
l_high; level>=cfg->
l_low; level--) {
64 int layers = level>0 ? 1<<level : 0;
65 cout <<
"level : " << level <<
" layers : " << layers << endl;
67 pwdm = net->
getwdm(layers+1);
69 cout <<
"CWB_Plugin_HandleWhiteDataWDM.C : Error - WDM not defined !!!" << endl;
82 cout <<
"WDM Decomposition Level : " << w.
getLevel()
83 <<
" dF : " << dF <<
" Hz " <<
" dT : " << 1000*dT <<
" ms " <<endl;
88 cout <<
"WDM Decomposition Level : " << M <<
" Layers " << L << endl;
91 int nTC = w.
size()/(M+1)/mF;
93 double* map00 = pwdm->
pWWS;
94 double* map90 = map00 + (mF-1)*(M+1)*nTC;
101 for(
int j=0;
j<M+1;
j++) {
110 for(
int i=0;
i<xx.
size();
i++) E00+=xx[
i]*xx[
i];
111 for(
int i=0;
i<XX.
size();
i++) E90+=XX[
i]*XX[
i];
113 cout <<
"E00 = " << E00 << endl;
114 cout <<
"E90 = " << E90 << endl;
125 WTS.
plot(&w, 2, start, stop,const_cast<char*>(
"COLZ"));
126 WTS.
hist2D->GetYaxis()->SetRangeUser(flow, fhigh);
130 cout << endl <<
"Dump WDM Scalogram : " << fname << endl << endl;
138 #ifdef DATA_COMPARISON 142 watplot plot(const_cast<char*>(
"plot"),200,20,800,500);
144 sprintf(gtitle,
"WDM : Original(black) - After WDM Forward/Inverse Tranform(Red)");
145 plot.
gtitle(gtitle,
"time(sec)",
"amplitude");
148 plot.
goptions(
"alp", 1, start, stop);
156 for(
int i=nEdge;
i<(
int)y.
size()-nEdge;
i++) ez+=y[
i]*y[
i];
159 cout <<
"Energy of Difference / Energy of Input Data " << ez/ex << endl;
void gtitle(TString title="", TString xtitle="", TString ytitle="")
virtual void rate(double r)
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
plot gtitle(gtitle,"frequency (Hz)","strain/#sqrt{Hz}")
virtual void start(double s)
#define COPY_HANDLED_DATA
void plot(wavearray< double > &, char *=NULL, int=1, double=0., double=0., bool=false, float=0., float=0., bool=false, float=0., bool=false)
network ** net
NOISE_MDC_SIMULATION.
WDM< double > * getwdm(size_t M)
param: number of wdm layers
virtual size_t size() const
int getLayer(wavearray< DataType_t > &w, double n)
param: n - layer number
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)
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
COHERENCE.
void Forward(int n=-1)
param: wavelet - n is number of steps (-1 means full decomposition)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
void Inverse(int n=-1)
param: n - number of steps (-1 means full reconstruction)