Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb_mkhtml_pe.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 // make the html pe report : used by the cwb_report command
20 {
21 
22  CWB::Toolbox::checkFile(gSystem->Getenv("CWB_ROOTLOGON_FILE"));
23  CWB::Toolbox::checkFile(gSystem->Getenv("CWB_PARAMETERS_FILE"));
24  CWB::Toolbox::checkFile(gSystem->Getenv("CWB_UPARAMETERS_FILE"));
25  CWB::Toolbox::checkFile(gSystem->Getenv("CWB_PPARAMETERS_FILE"));
26  CWB::Toolbox::checkFile(gSystem->Getenv("CWB_UPPARAMETERS_FILE"));
27  CWB::Toolbox::checkFile(gSystem->Getenv("CWB_EPPARAMETERS_FILE"));
28 
29  // create body.html file
30 
35 
36  // if CWB_DOC_URL is define then man infos are added to web pages
38  if(gSystem->Getenv("CWB_DOC_URL")!=NULL) {
39  cwb_doc_url=TString(gSystem->Getenv("CWB_DOC_URL"));
40  }
41 
42  ofstream out;
43  char fileout[256];
44 
45  // --------------------------------------------------------------------
46  // create prc html body
47  // --------------------------------------------------------------------
48 
49  sprintf(fileout,"%s/prc_body.html", pp_dir);
50  cout << fileout << endl;
51  out.open(fileout,ios::out);
52  if (!out.good()) {cout << "cwb_mkhtml_pe.C : Error Opening File : " << fileout << endl;exit(1);}
53 
54  MakePlotsHtmlTable(&out,"antenna pattern (same psd) : sensitivity & alignment",
55  "data/antpat_sensitivity.png","data/antpat_alignment.png");
56  MakePlotsHtmlTable(&out,"injected vs reconstructed locations of the detected events",
57  "data/inj_detected_antpat.png","data/rec_detected_antpat.png");
58  MakePlotsHtmlTable(&out,"injected vs detected events distributions : SNRnet & distance",
59  "data/inj_vs_rec_snr.png","data/inj_vs_rec_distance.png");
60  MakePlotsHtmlTable(&out,"search area & pp plot","data/search_area.png","data/pp_plot_prc.png");
61  MakePlotsHtmlTable(&out,"cos_theta distribution","data/cos_theta.png","580");
62  MakePlotsHtmlTable(&out,"Sky Localization Median vs Network SNR","data/median50_vs_snr.png","data/median90_vs_snr.png");
63 
64  out.close();
65 
66  // --------------------------------------------------------------------
67  // create wrc html body
68  // --------------------------------------------------------------------
69 
70  sprintf(fileout,"%s/wrc_body.html", pp_dir);
71  cout << fileout << endl;
72  out.open(fileout,ios::out);
73  if (!out.good()) {cout << "cwb_mkhtml_pe.C : Error Opening File : " << fileout << endl;exit(1);}
74 
75  MakePlotsHtmlTable(&out,"Reconstructed SNRnet vs Injected SNRnet","data/osnr_vs_isnr.png","580");
76  MakePlotsHtmlTable(&out,"Residual Energy (Distrbution/PP-plot)","data/nre_vs_isnr.png","data/pp_plot_nre.png");
77  MakePlotsHtmlTable(&out,"Overlap/Fitting Factors","data/of_vs_isnr.png","data/ff_vs_isnr.png");
78  MakePlotsHtmlTable(&out,"","data/of_vs_ff.png","data/of_vs_nre.png");
79  MakePlotsHtmlTable(&out,"Frequency Residual Energy (Distrbution/PP-plot)","data/pp_plot_fre.png","580");
80 
81  out.close();
82 
83  // --------------------------------------------------------------------
84  // create mchirp html body
85  // --------------------------------------------------------------------
86 
87  sprintf(fileout,"%s/mchirp_body.html", pp_dir);
88  cout << fileout << endl;
89  out.open(fileout,ios::out);
90  if (!out.good()) {cout << "cwb_mkhtml_pe.C : Error Opening File : " << fileout << endl;exit(1);}
91 
92  MakePlotsHtmlTable(&out,"Chirp Mass","data/omch_vs_imch.png","data/dmch_vs_isnr.png");
93  MakePlotsHtmlTable(&out,"Chirp Mass Error","data/emch_vs_imch.png","data/emch_vs_isnr.png");
94  MakePlotsHtmlTable(&out,"Chirp Ellipticity","data/elch_vs_imch.png","data/elch_vs_isnr.png");
95  MakePlotsHtmlTable(&out,"Chirp Pixel Fraction","data/pfch_vs_imch.png","data/pfch_vs_isnr.png");
96  MakePlotsHtmlTable(&out,"Chirp Energy Fraction","data/efch_vs_imch.png","data/efch_vs_isnr.png");
97  MakePlotsHtmlTable(&out,"PE Chirp Mass","data/opemch_vs_isnr.png","data/epemch_vs_isnr.png");
98 
99  out.close();
100 
101 
102  exit(0);
103 }
104 
void MakePlotsHtmlTable(ofstream *out, TString title, TString png1, TString png2="")
Definition: Toolfun.hh:875
TString cwb_doc_url
Definition: cwb_mkhtml_pe.C:37
TString("c")
sprintf(netdir,"%s/%s", pp_dir, pp_data_dir)
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:4670
ofstream out
Definition: cwb_mkhtml_pe.C:42
TString PP_DATA_PATH
Definition: cwb_mkhtml_pe.C:32
char netdir[1024]
TString PP_DATA_DIR
Definition: cwb_mkhtml_pe.C:34
char fileout[256]
Definition: cwb_mkhtml_pe.C:43
char pp_dir[512]
Definition: test_config1.C:155
char pp_data_dir[1024]
exit(0)