[1478] | 1 | /* Test de processeurs ds simtoipr.cc - Reza Avril 2001
|
---|
| 2 |
|
---|
| 3 | ---------------- Exemple d'appel ---------------------
|
---|
[1484] | 4 | csh> simtst -start 104385384 -end 104399964 -range -500,500 \
|
---|
| 5 | -intoi boloMuV_26 -wtoi 8192 -wdegli 1024 \
|
---|
| 6 | inputbolo.fits filt.fits xx.ppf
|
---|
| 7 | # Avec Filtre de Fourier
|
---|
| 8 | csh> simtst -start 104385384 -end 104399964 -range -500,500 \
|
---|
| 9 | -intoi boloMuV_26 -wtoi 8192 -wdegli 1024 \
|
---|
| 10 | -wfft 4096 -keepfft 5 -killfreq 15,4,2.5 \
|
---|
| 11 | inputbolo.fits filtfft.fits spectre.ppf
|
---|
| 12 | # Autre exemple b545k02
|
---|
| 13 | cool> ./simtst -start 104389122 -end 104649122 -range -1000.,1000. -intoi boloMu
|
---|
| 14 | V_23 -wtoi 8192 -wdegli 1024 -wfft 4096 -keepfft 5 -killfreq 15,4,2.5 Cmv/b545k02
|
---|
| 15 | 2_16.00_16.49.fits b545.fits b545.ppf
|
---|
| 16 |
|
---|
[1478] | 17 | */
|
---|
| 18 |
|
---|
| 19 |
|
---|
| 20 |
|
---|
[1462] | 21 | #include "machdefs.h"
|
---|
[1468] | 22 | #include <math.h>
|
---|
[1462] | 23 | #include "array.h"
|
---|
[1442] | 24 | #include <unistd.h>
|
---|
| 25 | #include <stdexcept>
|
---|
| 26 | #include "toi.h"
|
---|
| 27 | #include "toiprocessor.h"
|
---|
| 28 | #include "fitstoirdr.h"
|
---|
| 29 | #include "fitstoiwtr.h"
|
---|
| 30 | #include "toisqfilter.h"
|
---|
| 31 | #include "toimanager.h"
|
---|
| 32 | #include "simtoipr.h"
|
---|
[1500] | 33 | #include "nooppr.h"
|
---|
[1442] | 34 | #include "toiseqbuff.h"
|
---|
| 35 | #include "timing.h"
|
---|
| 36 | #include "sambainit.h"
|
---|
| 37 |
|
---|
| 38 | void Usage(bool fgerr)
|
---|
| 39 | {
|
---|
| 40 | cout << endl;
|
---|
| 41 | if (fgerr) {
|
---|
[1484] | 42 | cout << " simtst : Argument Error ! simtst -h for usage " << endl;
|
---|
[1442] | 43 | exit(1);
|
---|
| 44 | }
|
---|
| 45 | else {
|
---|
[1484] | 46 | cout << "\n Usage : simtst [-intoi toiname] [-start snb] [-end sne] \n"
|
---|
| 47 | << " [-dbg] [-wtoi sz] [-wdegli sz] [-range min,max] \n"
|
---|
[1500] | 48 | << " [-degli ns,ns2,mxpt,mnpt,wrec] [-gfilt wsz,sigma] \n"
|
---|
| 49 | << " [-wfft sz] [-keepfft n] [-killfreq bf,nharm,sigf] \n"
|
---|
| 50 | << " [-nooutflg] [-nowrtms] [-nowrticd] \n"
|
---|
[1483] | 51 | << " inFitsName outFitsName outPPFName \n"
|
---|
[1442] | 52 | << " -dbg : sets TOISeqBuffered debug level to 1 \n"
|
---|
| 53 | << " -start snb : sets the start sample num \n"
|
---|
| 54 | << " -end sne : sets the end sample num \n"
|
---|
[1454] | 55 | << " -range min,max : sets the acceptable range for intoi \n"
|
---|
| 56 | << " default= -16000,16000\n"
|
---|
[1467] | 57 | << " -intoi toiName : select input TOI name (def boloMuV_27)\n"
|
---|
| 58 | << " -wtoi sz : sets TOISeqBuff buffer size (def= 8192)\n"
|
---|
| 59 | << " -wdegli sz : sets deglitcher window size (def= 512) \n"
|
---|
[1500] | 60 | << " -degli ns,ns2,maxnpt,minnpt,wrec : sets deglitcher parameters\n"
|
---|
| 61 | << " -gfilt wsz,sigma : Gaussian filter window size and sigma\n"
|
---|
[1479] | 62 | << " -wfft sz : Activate Fourier filter and sets its width \n"
|
---|
| 63 | << " -keepfft n : Keeps n spectra (if Fourier filter activated) \n"
|
---|
[1484] | 64 | << " -killfreq bf,nharm,sigf : kills nharm frequency, basefreq=bf \n"
|
---|
[1500] | 65 | << " with a gaussian with width=sigf \n"
|
---|
| 66 | << " -nooutflg : Don't write flags to output FITS \n"
|
---|
| 67 | << " -nowrtms : Don't write mean/sigma TOI's \n"
|
---|
| 68 | << " -nowrticd : Don't write incopie,degli,deglioffset TOI's \n"
|
---|
[1442] | 69 | << endl;
|
---|
| 70 | }
|
---|
| 71 | }
|
---|
| 72 |
|
---|
| 73 | int main(int narg, char** arg) {
|
---|
| 74 |
|
---|
| 75 | if ((narg > 1) && (strcmp(arg[1],"-h") == 0) ) Usage(false);
|
---|
| 76 |
|
---|
| 77 | cout << "simtst starting - Decoding arguments " << " narg=" << narg << endl;
|
---|
| 78 |
|
---|
| 79 | bool fgdbg = false;
|
---|
[1483] | 80 | bool fgsetstart = false;
|
---|
[1479] | 81 | int wtoi = 8192;
|
---|
| 82 | int wdegli = 512;
|
---|
[1500] | 83 |
|
---|
[1479] | 84 | int wfft = 4096;
|
---|
| 85 | int keepfft = 0;
|
---|
[1442] | 86 | int nmax = 10;
|
---|
[1483] | 87 | int istart = 0;
|
---|
[1442] | 88 | int iend = 0;
|
---|
[1501] | 89 |
|
---|
[1454] | 90 | double range_min = -16000;
|
---|
| 91 | double range_max = 16000.;
|
---|
[1500] | 92 |
|
---|
| 93 | // Deglitcher parameters
|
---|
| 94 | double degli_ns1 = 3.;
|
---|
| 95 | double degli_ns2 = 1.5;
|
---|
| 96 | int degli_minnpt = 2;
|
---|
| 97 | int degli_maxnpt = 4;
|
---|
| 98 | int degli_wrec = 10;
|
---|
| 99 |
|
---|
| 100 | // Gaussian filter parameters
|
---|
| 101 | int gfilt_wsz = 16;
|
---|
| 102 | double gfilt_sigma = 2.;
|
---|
| 103 |
|
---|
| 104 | // File names
|
---|
[1442] | 105 | string infile;
|
---|
| 106 | string outfile;
|
---|
[1483] | 107 | string outppfname;
|
---|
[1467] | 108 | string intoi = "boloMuV_27";
|
---|
[1500] | 109 |
|
---|
| 110 | bool fg_wrtflag = true;
|
---|
| 111 | bool fg_nowrtms = false;
|
---|
| 112 | bool fg_nowrticd = false;
|
---|
| 113 |
|
---|
| 114 |
|
---|
[1479] | 115 | bool fg_f_filt = false;
|
---|
[1484] | 116 | bool fg_killfreq = false;
|
---|
| 117 | int bf_killfreq = 1;
|
---|
| 118 | int nharm_killfreq = 1;
|
---|
| 119 | double sigf_killfreq = 1.;
|
---|
[1442] | 120 |
|
---|
| 121 | if (narg < 4) Usage(true);
|
---|
| 122 | int ko=1;
|
---|
| 123 | // decoding arguments
|
---|
| 124 | for(int ia=1; ia<narg; ia++) {
|
---|
| 125 | if (strcmp(arg[ia],"-start") == 0) {
|
---|
| 126 | if (ia == narg-1) Usage(true); // -start est suivi d'un argument
|
---|
| 127 | istart = atoi(arg[ia+1]); ia++;
|
---|
[1483] | 128 | fgsetstart = true;
|
---|
[1442] | 129 | }
|
---|
| 130 | else if (strcmp(arg[ia],"-end") == 0) {
|
---|
| 131 | if (ia == narg-1) Usage(true);
|
---|
| 132 | iend = atoi(arg[ia+1]); ia++;
|
---|
| 133 | }
|
---|
[1467] | 134 | else if (strcmp(arg[ia],"-wtoi") == 0) {
|
---|
[1442] | 135 | if (ia == narg-1) Usage(true);
|
---|
[1479] | 136 | wtoi = atoi(arg[ia+1]); ia++;
|
---|
[1442] | 137 | }
|
---|
[1467] | 138 | else if (strcmp(arg[ia],"-wdegli") == 0) {
|
---|
[1442] | 139 | if (ia == narg-1) Usage(true);
|
---|
[1479] | 140 | wdegli = atoi(arg[ia+1]); ia++;
|
---|
[1442] | 141 | }
|
---|
[1500] | 142 | else if (strcmp(arg[ia],"-degli") == 0) {
|
---|
| 143 | if (ia == narg-1) Usage(true);
|
---|
| 144 | sscanf(arg[ia+1],"%lf,%lf,%d,%d,%d", °li_ns1, °li_ns2,
|
---|
| 145 | °li_maxnpt, °li_minnpt, °li_wrec);
|
---|
| 146 | ia++;
|
---|
| 147 | }
|
---|
| 148 | else if (strcmp(arg[ia],"-gfilt") == 0) {
|
---|
| 149 | if (ia == narg-1) Usage(true);
|
---|
| 150 | sscanf(arg[ia+1],"%d,%lf", &gfilt_wsz, &gfilt_sigma);
|
---|
| 151 | ia++;
|
---|
| 152 | }
|
---|
[1479] | 153 | else if (strcmp(arg[ia],"-wfft") == 0) {
|
---|
| 154 | if (ia == narg-1) Usage(true);
|
---|
| 155 | wfft = atoi(arg[ia+1]); ia++;
|
---|
| 156 | fg_f_filt = true;
|
---|
| 157 | }
|
---|
| 158 | else if (strcmp(arg[ia],"-keepfft") == 0) {
|
---|
| 159 | if (ia == narg-1) Usage(true);
|
---|
| 160 | keepfft = atoi(arg[ia+1]); ia++;
|
---|
| 161 | }
|
---|
[1484] | 162 | else if (strcmp(arg[ia],"-killfreq") == 0) {
|
---|
| 163 | if (ia == narg-1) Usage(true);
|
---|
| 164 | sscanf(arg[ia+1],"%d,%d,%lf",&bf_killfreq, &nharm_killfreq, &sigf_killfreq);
|
---|
| 165 | fg_killfreq = true;
|
---|
| 166 | ia++;
|
---|
| 167 | }
|
---|
[1454] | 168 | else if (strcmp(arg[ia],"-range") == 0) {
|
---|
| 169 | if (ia == narg-1) Usage(true);
|
---|
| 170 | sscanf(arg[ia+1],"%lf,%lf",&range_min, &range_max);
|
---|
| 171 | ia++;
|
---|
| 172 | }
|
---|
| 173 | else if (strcmp(arg[ia],"-intoi") == 0) {
|
---|
| 174 | if (ia == narg-1) Usage(true);
|
---|
| 175 | intoi = arg[ia+1]; ia++;
|
---|
| 176 | }
|
---|
[1442] | 177 | else if (strcmp(arg[ia],"-dbg") == 0) fgdbg = true;
|
---|
[1500] | 178 | else if (strcmp(arg[ia],"-nooutflg") == 0) fg_wrtflag = false;
|
---|
| 179 | else if (strcmp(arg[ia],"-nowrtms") == 0) fg_nowrtms = true;
|
---|
| 180 | else if (strcmp(arg[ia],"-nowrticd") == 0) fg_nowrticd = true;
|
---|
[1442] | 181 |
|
---|
| 182 | else { ko = ia; break; } // Debut des noms
|
---|
| 183 | }
|
---|
| 184 |
|
---|
[1479] | 185 | if (iend < istart) iend = istart+wtoi*(nmax+5);
|
---|
[1483] | 186 | if ((narg-ko) < 3) Usage(true);
|
---|
[1442] | 187 | infile = arg[ko];
|
---|
| 188 | outfile = arg[ko+1];
|
---|
[1483] | 189 | outppfname = arg[ko+2];
|
---|
[1442] | 190 |
|
---|
| 191 | cout << " Initializing SOPHYA ... " << endl;
|
---|
| 192 | SophyaInit();
|
---|
| 193 | InitTim();
|
---|
| 194 |
|
---|
[1484] | 195 | cout << ">>>> simtst: Infile= " << infile << " outFile="
|
---|
[1479] | 196 | << outfile << endl;
|
---|
| 197 | cout << ">>>> Window Size WTOI= " << wtoi << " WDEGLI= " << wdegli
|
---|
[1442] | 198 | << " iStart= " << istart << " iEnd= " << iend << endl;
|
---|
[1454] | 199 | cout << ">>>> InTOIName= " << intoi << endl;
|
---|
[1479] | 200 |
|
---|
[1442] | 201 | try {
|
---|
| 202 | TOIManager* mgr = TOIManager::getManager();
|
---|
| 203 |
|
---|
| 204 | // mgr->setRequestedSample(11680920,11710584);
|
---|
| 205 | // mgr->setRequestedSample(104121000, 104946120);
|
---|
[1629] | 206 | if (fgsetstart)
|
---|
[1483] | 207 | mgr->setRequestedSample(istart, iend);
|
---|
[1629] | 208 |
|
---|
[1442] | 209 | // FITSTOIReader r("/data/Archeops/bolo11.fits);
|
---|
| 210 | FITSTOIReader r(infile);
|
---|
| 211 | cout << "reader created" << endl;
|
---|
| 212 | // FITSTOIWriter w("/data/Archeops/rz.fits");
|
---|
| 213 | FITSTOIWriter w(outfile);
|
---|
| 214 | cout << "fits writer created" << endl;
|
---|
| 215 |
|
---|
| 216 |
|
---|
[1479] | 217 | int w1 = wtoi;
|
---|
[1491] | 218 | int w2 = (fg_f_filt) ? wfft+3*w1 : w1;
|
---|
[1479] | 219 |
|
---|
[1454] | 220 | // char * colname[5] = {"MJD", "UTC","boloMuV_11","magnFlux","pivot"};
|
---|
[1442] | 221 | TOISeqBuffered * toiin = new TOISeqBuffered("f2in", w1);
|
---|
| 222 | if (fgdbg) toiin->setDebugLevel(1);
|
---|
[1467] | 223 | TOISeqBuffered * toidegli = new TOISeqBuffered("degli", w1);
|
---|
| 224 | if (fgdbg) toidegli->setDebugLevel(1);
|
---|
[1442] | 225 | TOISeqBuffered * toimean = new TOISeqBuffered("mean", w1);
|
---|
| 226 | if (fgdbg) toimean->setDebugLevel(1);
|
---|
[1479] | 227 | TOISeqBuffered * toisig = new TOISeqBuffered("sigma", w2);
|
---|
[1442] | 228 | if (fgdbg) toisig->setDebugLevel(1);
|
---|
[1483] | 229 | TOISeqBuffered * toiincopie = new TOISeqBuffered("incopie", w2);
|
---|
[1443] | 230 | if (fgdbg) toiincopie->setDebugLevel(1);
|
---|
[1442] | 231 |
|
---|
| 232 |
|
---|
| 233 |
|
---|
| 234 | // Connecting TOI to FITSTOIReader Processor
|
---|
| 235 | // for(kk=0; kk<5; kk++) {
|
---|
| 236 | // r.addOutput(colname[kk], toitab[kk]);
|
---|
| 237 | // }
|
---|
| 238 |
|
---|
[1454] | 239 | // int kk = 2;
|
---|
| 240 | r.addOutput(intoi, toiin);
|
---|
[1442] | 241 | // toi->dbg=true;
|
---|
| 242 | // r.addOutput("boloMuV_11", toi);
|
---|
| 243 | cout << " connecting in/out to RzTOIProcessor ... " << endl;
|
---|
| 244 |
|
---|
| 245 | // TOIProcessor * filt = NULL;
|
---|
| 246 |
|
---|
| 247 | cout << " Creating SimpleDeglitcher() " << endl;
|
---|
[1479] | 248 | SimpleDeglitcher degl(wdegli);
|
---|
[1500] | 249 | degl.SetDetectionParam(degli_ns1, degli_ns2, degli_maxnpt,
|
---|
| 250 | degli_minnpt, degli_wrec);
|
---|
| 251 |
|
---|
[1454] | 252 | cout << " Setting Range for deglitcher: " << range_min
|
---|
| 253 | << " - " << range_max << endl;
|
---|
[1479] | 254 |
|
---|
[1454] | 255 | degl.SetRange(range_min, range_max);
|
---|
[1442] | 256 | degl.addInput("in", toiin);
|
---|
[1467] | 257 | degl.addOutput("out", toidegli);
|
---|
[1442] | 258 | degl.addOutput("mean", toimean);
|
---|
| 259 | degl.addOutput("sigma", toisig);
|
---|
[1443] | 260 | degl.addOutput("incopie", toiincopie);
|
---|
[1467] | 261 |
|
---|
| 262 | cout << " Creating a FanOut SimpleFanOut Object " << endl;
|
---|
| 263 | SimpleFanOut fanout(2,2);
|
---|
| 264 | TOISeqBuffered * toidegli0 = new TOISeqBuffered("degli0", w1);
|
---|
| 265 | if (fgdbg) toidegli0->setDebugLevel(1);
|
---|
[1479] | 266 | TOISeqBuffered * toidegli1 = new TOISeqBuffered("degli1", w2);
|
---|
[1442] | 267 |
|
---|
[1467] | 268 | TOISeqBuffered * toimean0 = new TOISeqBuffered("mean0", w1);
|
---|
| 269 | if (fgdbg) toimean0->setDebugLevel(1);
|
---|
[1479] | 270 | TOISeqBuffered * toimean1 = new TOISeqBuffered("mean1", w2);
|
---|
[1467] | 271 | if (fgdbg) toimean1->setDebugLevel(1);
|
---|
| 272 |
|
---|
| 273 | fanout.addInput("in0", toidegli);
|
---|
| 274 | fanout.addOutput("out0_0", toidegli0);
|
---|
| 275 | fanout.addOutput("out0_1", toidegli1);
|
---|
| 276 | fanout.addInput("in1", toimean);
|
---|
| 277 | fanout.addOutput("out1_0", toimean0);
|
---|
| 278 | fanout.addOutput("out1_1", toimean1);
|
---|
| 279 |
|
---|
| 280 | cout << " Creating an Adder SimpleAdder Object " << endl;
|
---|
| 281 | SimpleAdder adder(2);
|
---|
| 282 | adder.addInput("in0", toidegli0);
|
---|
| 283 | adder.addInput("in1", toimean0);
|
---|
| 284 | adder.SetGain(0, 1.);
|
---|
| 285 | adder.SetGain(1, -1.);
|
---|
| 286 | TOISeqBuffered * toideglioff = new TOISeqBuffered("deglioff", w1);
|
---|
| 287 | if (fgdbg) toideglioff->setDebugLevel(1);
|
---|
| 288 | adder.addOutput("out", toideglioff);
|
---|
| 289 |
|
---|
| 290 | cout << " Creating a GaussianFilter SimpleFilter Object " << endl;
|
---|
[1531] | 291 | double G_sigma = gfilt_sigma;
|
---|
[1468] | 292 | double G_a = 1./(G_sigma*sqrt(M_PI*2.));
|
---|
[1531] | 293 | SimpleFilter filt(gfilt_wsz, SimpleFilter::GaussFilter, G_a, G_sigma);
|
---|
[1467] | 294 |
|
---|
| 295 | filt.addInput("in", toideglioff);
|
---|
| 296 | TOISeqBuffered * toiout = new TOISeqBuffered("out", w1);
|
---|
| 297 | if (fgdbg) toiout->setDebugLevel(1);
|
---|
[1479] | 298 | TOISeqBuffered * toideglioffcopie = new TOISeqBuffered("deglioffcopie", w2);
|
---|
[1467] | 299 | if (fgdbg) toideglioffcopie->setDebugLevel(1);
|
---|
| 300 | filt.addOutput("out", toiout);
|
---|
| 301 | filt.addOutput("incopie", toideglioffcopie);
|
---|
| 302 |
|
---|
[1484] | 303 | Vector fcoef(wfft/2+1);
|
---|
| 304 | // fcoef = RegularSequence(1., -2./wfft);
|
---|
| 305 | fcoef = 1.;
|
---|
| 306 | for(int kfk=0; kfk<nharm_killfreq; kfk++) {
|
---|
| 307 | double cfreq = bf_killfreq*(kfk+1);
|
---|
| 308 | double xfreq = 0.;
|
---|
| 309 | for(int kfj=cfreq-3.*sigf_killfreq; kfj<= cfreq+3.*sigf_killfreq; kfj++) {
|
---|
| 310 | if ( (kfj < 0) || (kfj >= fcoef.Size() ) ) continue;
|
---|
| 311 | xfreq = (cfreq-kfj)/sigf_killfreq;
|
---|
[1531] | 312 | fcoef(kfj) -= exp(-xfreq*xfreq/2.0);
|
---|
[1484] | 313 | }
|
---|
| 314 | }
|
---|
[1479] | 315 | cout << " Creating Fourier Filter ... " << endl;
|
---|
| 316 | SimpleFourierFilter sfft(fcoef);
|
---|
[1483] | 317 | sfft.KeepSpectra(outppfname, keepfft);
|
---|
[1484] | 318 | sfft.ComputeMeanSpectra(true);
|
---|
[1479] | 319 | TOISeqBuffered * toifft = NULL;
|
---|
| 320 | TOISeqBuffered * toifiltcopie = NULL;
|
---|
| 321 |
|
---|
| 322 | if (fg_f_filt) {
|
---|
| 323 | cout << " Connecting Fourier Filter ... " << endl;
|
---|
| 324 | toifft = new TOISeqBuffered("fftout", w1);
|
---|
| 325 | toifiltcopie = new TOISeqBuffered("filtcopie", w1);
|
---|
| 326 | sfft.addInput("in",toiout);
|
---|
| 327 | sfft.addOutput("out", toifft);
|
---|
| 328 | sfft.addOutput("incopie", toifiltcopie);
|
---|
| 329 | }
|
---|
| 330 |
|
---|
[1467] | 331 | cout << " Connecting to output (FitsWriter) " << endl;
|
---|
| 332 |
|
---|
[1500] | 333 |
|
---|
| 334 | // Pour connecter les lignes non connectees au FitsWriter
|
---|
| 335 | NoOpProcessor noop[3];
|
---|
| 336 |
|
---|
| 337 | if (fg_nowrticd) noop[0].addInput("in", toiincopie);
|
---|
| 338 | else w.addInput("in", toiincopie);
|
---|
| 339 |
|
---|
[1479] | 340 | if (fg_f_filt) {
|
---|
[1541] | 341 | w.addInput("filtout", toifiltcopie, fg_wrtflag);
|
---|
| 342 | w.addInput("fftout", toifft, fg_wrtflag);
|
---|
[1479] | 343 | }
|
---|
[1541] | 344 | else w.addInput("filtout", toiout, fg_wrtflag);
|
---|
[1442] | 345 |
|
---|
[1500] | 346 | if (fg_nowrticd) {
|
---|
| 347 | noop[1].addInput("in", toidegli1);
|
---|
| 348 | noop[1].addInput("in2", toideglioffcopie);
|
---|
| 349 | }
|
---|
| 350 | else {
|
---|
| 351 | w.addInput("degli", toidegli1);
|
---|
| 352 | w.addInput("deglioff", toideglioffcopie);
|
---|
| 353 | }
|
---|
| 354 | if (fg_nowrtms) {
|
---|
| 355 | noop[2].addInput("in", toimean1);
|
---|
| 356 | noop[2].addInput("in2", toisig);
|
---|
| 357 | }
|
---|
| 358 | else {
|
---|
| 359 | w.addInput("mean", toimean1);
|
---|
| 360 | w.addInput("sigma", toisig);
|
---|
| 361 | }
|
---|
| 362 |
|
---|
[1442] | 363 | cout << " ------ FITSReaderTOI::PrintStatus() : ----- " << endl;
|
---|
| 364 | r.PrintStatus(cout);
|
---|
[1467] | 365 | cout << " ------ FanOut::PrintStatus() : ----- " << endl;
|
---|
| 366 | fanout.PrintStatus(cout);
|
---|
| 367 | cout << " ------ Adder::PrintStatus() : ----- " << endl;
|
---|
| 368 | adder.PrintStatus(cout);
|
---|
| 369 | cout << " ------ Filter::PrintStatus() : ----- " << endl;
|
---|
| 370 | filt.PrintStatus(cout);
|
---|
[1442] | 371 | cout << "----- FITSWriterTOI::PrintStatus() : ----- " << endl;
|
---|
| 372 | w.PrintStatus(cout);
|
---|
| 373 |
|
---|
[1501] | 374 |
|
---|
| 375 |
|
---|
[1442] | 376 | PrtTim("starting threads");
|
---|
| 377 | r.start();
|
---|
| 378 | degl.start();
|
---|
[1467] | 379 | fanout.start();
|
---|
| 380 | adder.start();
|
---|
| 381 | filt.start();
|
---|
[1479] | 382 | if (fg_f_filt) sfft.start();
|
---|
[1442] | 383 | w.start();
|
---|
[1500] | 384 | if (fg_nowrticd) {
|
---|
| 385 | noop[0].start();
|
---|
| 386 | noop[1].start();
|
---|
| 387 | }
|
---|
| 388 | if (fg_nowrtms)
|
---|
| 389 | noop[2].start();
|
---|
[1442] | 390 |
|
---|
[1501] | 391 |
|
---|
| 392 | // ------------------- Impression continu de stat ------------------------
|
---|
[1629] | 393 | ProcSampleCounter<SimpleFilter> stats(filt);
|
---|
| 394 | stats.InfoMessage() = "simtst/Info";
|
---|
| 395 | stats.PrintStats();
|
---|
[1501] | 396 | // -----------------------------------------------------------------------
|
---|
| 397 |
|
---|
[1467] | 398 | /*
|
---|
[1454] | 399 | for(int jj=0; jj<3; jj++) {
|
---|
| 400 | cout << *toiin;
|
---|
[1467] | 401 | cout << *toimean;
|
---|
| 402 | cout << *toimean1;
|
---|
[1454] | 403 | cout << *toiout;
|
---|
| 404 | sleep(1);
|
---|
| 405 | }
|
---|
| 406 | */
|
---|
| 407 |
|
---|
[1442] | 408 | mgr->joinAll();
|
---|
| 409 | PrtTim("End threads");
|
---|
| 410 |
|
---|
| 411 | // cout << " ------ FITSReaderTOI::PrintStatus() : ----- " << endl;
|
---|
| 412 | // r.PrintStatus(cout);
|
---|
| 413 | // cout << "----- FITSWriterTOI::PrintStatus() : ----- " << endl;
|
---|
| 414 | // w.PrintStatus(cout);
|
---|
| 415 |
|
---|
[1467] | 416 | cout << " ------ toiin, toidegli and toiout Status information ------- " << endl;
|
---|
[1442] | 417 | cout << *toiin;
|
---|
[1467] | 418 | cout << *toidegli;
|
---|
[1442] | 419 | cout << *toiout;
|
---|
[1491] | 420 | if (fg_f_filt) {
|
---|
| 421 | cout << *toisig;
|
---|
| 422 | cout << *toimean1;
|
---|
| 423 | }
|
---|
[1467] | 424 | cout << degl;
|
---|
| 425 | cout << filt;
|
---|
| 426 | cout << adder;
|
---|
[1479] | 427 | if (fg_f_filt) cout << sfft ;
|
---|
[1467] | 428 |
|
---|
[1442] | 429 | }
|
---|
| 430 | catch (PThrowable & exc) {
|
---|
[1500] | 431 | cerr << "\n simtst: Catched Exception \n" << (string)typeid(exc).name()
|
---|
[1442] | 432 | << " - Msg= " << exc.Msg() << endl;
|
---|
| 433 | }
|
---|
| 434 | catch (const std::exception & sex) {
|
---|
[1500] | 435 | cerr << "\n simtst: Catched std::exception \n"
|
---|
[1442] | 436 | << (string)typeid(sex).name() << endl;
|
---|
| 437 | }
|
---|
| 438 | catch (...) {
|
---|
[1500] | 439 | cerr << "\n simtst: some other exception was caught ! " << endl;
|
---|
[1442] | 440 | }
|
---|
| 441 |
|
---|
| 442 | return(0);
|
---|
| 443 | }
|
---|