Logo coherent WaveBurst  
Library Reference Guide
Logo
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CWB_Plugin_MakeSpectrum.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 "Toolbox.hh"
32 
33 void
35 //!DISPLAY_SPECTRA
36 // Plugin to produce spectrum of input/whitened data
37 
38  cout << endl;
39  cout << "-----> CWB_Plugin_MakeSpectrum.C" << endl;
40  cout << "ifo " << ifo.Data() << endl;
41  cout << "type " << type << endl;
42  cout << endl;
43 /*
44  if(type==CWB_PLUGIN_DATA) {
45  CWB::Toolbox TB;
46  char file[1024];
47  sprintf(file,"%s/sensitivity_%s_%d_%s_job%lu.txt",cfg->dump_dir,ifo.Data(),int(x->start()),cfg->data_label,net->nRun);
48  //sprintf(file,"%s/sensitivity_%s_%d_%s_job%lu.txt",".",ifo.Data(),int(x->start()),"prova",net->nRun);
49  cout << endl << "Dump Sensitivity : " << file << endl << endl;
50  TB.makeSpectrum(file, *x, 8, cfg->segEdge);
51 
52  int nIFO=net->ifoListSize();
53  if(TString(ifo).CompareTo(net->ifoName[nIFO-1])==0) gSystem->Exit(0); // last ifo
54  }
55 */
56  if(type==CWB_PLUGIN_WHITE) {
58  int level=-1;
59  if(TString(cfg->analysis)=="1G") {
60  level=x->getLevel();
61  x->Inverse(-1);
62  }
63  // dump spectrum
64  char file[1024];
65  sprintf(file,"%s/sensitivity_white_%s_%d_%s_job%lu.txt",cfg->dump_dir,ifo.Data(),int(x->start()),cfg->data_label,net->nRun);
66  cout << endl << "Dump Sensitivity : " << file << endl << endl;
67  TB.makeSpectrum(file, *x, 8, cfg->segEdge);
68  int nIFO=net->ifoListSize();
69  if(TString(ifo).CompareTo(net->ifoName[nIFO-1])==0) gSystem->Exit(0); // last ifo
70  if(TString(cfg->analysis)=="1G") x->Forward(level);
71  }
72 
73  return;
74 }
std::vector< char * > ifoName
Definition: network.hh:609
CWB::config * cfg
char analysis[8]
Definition: config.hh:117
TString("c")
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
CWB::Toolbox TB
virtual void start(double s)
Definition: wavearray.hh:137
char ifo[NIFO_MAX][8]
network ** net
NOISE_MDC_SIMULATION.
size_t ifoListSize()
Definition: network.hh:431
double segEdge
Definition: config.hh:164
#define nIFO
int getLevel()
Definition: wseries.hh:109
jfile
Definition: cwb_job_obj.C:43
i() int(T_cor *100))
char dump_dir[1024]
Definition: config.hh:328
void Forward(int n=-1)
param: wavelet - n is number of steps (-1 means full decomposition)
Definition: wseries.cc:246
static void makeSpectrum(wavearray< double > &psd, wavearray< double > x, double chuncklen=8, double scratchlen=0, bool oneside=true)
Definition: Toolbox.cc:5489
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
char data_label[1024]
Definition: config.hh:332
void Inverse(int n=-1)
param: n - number of steps (-1 means full reconstruction)
Definition: wseries.cc:291
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
COHERENCE.