Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb_dump_lag.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 // list lag used in production : used by the cwb_dump command
20 
21 {
23 
24  TB.checkFile(gSystem->Getenv("CWB_ROOTLOGON_FILE"));
25  TB.checkFile(gSystem->Getenv("CWB_PARAMETERS_FILE"));
26  TB.checkFile(gSystem->Getenv("CWB_UPARAMETERS_FILE"));
27 
28  if(simulation) {
29  cout << "cwb_dump lag : simulation is !=0 -> only zero lag is defined!!!" << endl << endl;
30  exit(0);
31  }
32 
33  // check input user configuration
35  cfg.Import();
36  cfg.Check();
37 
38  // write lag list to file
39  if(lagMode[0]!='r') {
40  lagFile = new char[256];
41  sprintf(lagFile,"%s/%s.lag",dump_dir,data_label);
42  cout << "Write lag list : " << lagFile << endl;
43  }
44 
45  // define network
46  detector* pD[NIFO_MAX]; // pointers to detectors
47  for(int i=0; i<nIFO; i++) {
48  if(strlen(ifo[i])>0) pD[i] = new detector(ifo[i]); // built in detector
49  else pD[i] = new detector(detParms[i]); // user define detector
50  }
51 
52  network NET; // network
53  for(int i=0; i<nIFO; i++) NET.add(pD[i]); // add deetctors to network object
54 
55  wavearray<double> x(segLen*16384);
56  pD[0]->TFmap=x;
57 
58  // setup lags
60  cout<<"lag step: "<<lagStep<<endl;
61  cout<<"number of time lags: "<<lags<<endl;
62 
63 /*
64  // print selected lags
65  printf("%8s ","lag");
66  for(int n=0; n<nIFO; n++) printf("%12.12s%2s","ifo",NET.getifo(n)->Name);
67  printf("\n");
68  for(int m=0; m<NET.getifo(0)->lagShift.size(); m++) {
69  printf("%8d ",m);
70  for(int n=0; n<nIFO; n++) printf("%14.5f",NET.getifo(n)->lagShift.data[m]);
71  printf("\n");
72  }
73 */
74  exit(0);
75 }
double lagStep
Definition: test_config1.C:53
size_t add(detector *)
param: detector structure return number of detectors in the network
Definition: network.cc:2559
size_t * lagSite
Definition: test_config1.C:58
network NET
Definition: cwb_dump_lag.C:52
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 Check()
Definition: config.cc:1411
CWB::Toolbox TB
size_t lagOff
Definition: test_config1.C:54
i drho i
void Import(TString umacro="")
Definition: config.cc:352
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:4670
char ifo[NIFO_MAX][8]
#define nIFO
char data_label[512]
Definition: test_config1.C:160
char lagMode[2]
Definition: test_config1.C:57
const int NIFO_MAX
Definition: wat.hh:22
segLen
Definition: cwb_eced.C:24
WSeries< double > TFmap
Definition: detector.hh:354
char dump_dir[512]
Definition: test_config1.C:156
char * lagFile
Definition: test_config1.C:56
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
simulation
Definition: cwb_eced.C:26
detectorParams detParms[4]
int setTimeShifts(size_t=1, double=1., size_t=0, size_t=0, const char *=NULL, const char *="w", size_t *=NULL)
param number of time lags param time shift step in seconds param first lag ID param maximum lag ID pa...
Definition: network.cc:7321
CWB::config cfg
Definition: cwb_dump_lag.C:34
size_t lagMax
Definition: test_config1.C:55
exit(0)
detector * pD[NIFO_MAX]
Definition: cwb_dump_lag.C:46
size_t lagSize
Definition: test_config1.C:52