Changeset 1467 in Sophya for trunk/ArchTOIPipe/TestPipes


Ignore:
Timestamp:
Apr 12, 2001, 3:14:22 PM (24 years ago)
Author:
ansari
Message:

Debug de SimpleDeglitcher, ajout de SimpleFanOut , Reza 12/4/2001

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/TestPipes/simtst.cc

    r1462 r1467  
    2222  }
    2323  else {
    24     cout << "\n Usage : simtst [-sproc] [-rwtoi] [-dbg] [-start snb] [-end sne] \n"
    25          << "         [-w1 sz] [-w2 sz] inFitsName outFitsName ppfFileName \n"
    26          << "   -sproc : Run RzSimpleTOIProc (default RzTOIProc) \n"
    27          << "   -rwtoi : Use Regular Window TOI (default TOISeqBuffered) \n"
     24    cout << "\n Usage : simtst [-dbg] [-start snb] [-end sne] \n"
     25         << "         [-wtoi sz] [-w2 sz] inFitsName outFitsName ppfFileName \n"
    2826         << "   -dbg : sets TOISeqBuffered debug level to 1 \n"
    2927         << "   -start snb : sets the start sample num \n"
     
    3129         << "   -range min,max : sets the acceptable range for intoi \n"
    3230         << "              default= -16000,16000\n"
    33          << "   -intoi toiName : select input TOI name (def boloMuV_11)\n"
    34          << "   -w1 sz : sets main data window size (def= 8192)\n"
    35          << "   -w2 sz : sets secondary window size (def= 512) \n"
     31         << "   -intoi toiName : select input TOI name (def boloMuV_27)\n"
     32         << "   -wtoi sz : sets TOISeqBuff buffer size (def= 8192)\n"
     33         << "   -wdegli sz : sets deglitcher window size (def= 512) \n"
    3634         << endl;
    3735    exit(0);
     
    4543  cout << "simtst starting - Decoding arguments " << " narg=" << narg << endl;
    4644
    47   bool fgsimple = false;
    48   bool fgrwtoi = false;
    4945  bool fgdbg = false;
    5046  int w1 = 8192;
    51   int w2 = 256;
     47  int w2 = 512;
    5248  int nmax = 10;
    5349  int istart = 104121000+w1*5;
     
    5854  string outfile;
    5955  string ppffile;
    60   string intoi = "boloMuV_11";
     56  string intoi = "boloMuV_27";
    6157
    6258  if (narg < 4) Usage(true);
     
    7268      iend = atoi(arg[ia+1]); ia++;
    7369    }   
    74     else if (strcmp(arg[ia],"-w1") == 0) {
     70    else if (strcmp(arg[ia],"-wtoi") == 0) {
    7571      if (ia == narg-1) Usage(true); 
    7672      w1 = atoi(arg[ia+1]); ia++;
    7773    }   
    78     else if (strcmp(arg[ia],"-w2") == 0) {
     74    else if (strcmp(arg[ia],"-wdegli") == 0) {
    7975      if (ia == narg-1) Usage(true); 
    8076      w2 = atoi(arg[ia+1]); ia++;
     
    8985      intoi = arg[ia+1]; ia++;
    9086    }   
    91     else if (strcmp(arg[ia],"-sproc") == 0)  fgsimple = true;
    92     else if (strcmp(arg[ia],"-rwtoi") == 0)  fgrwtoi = true;
    9387    else if (strcmp(arg[ia],"-dbg") == 0)  fgdbg = true;
    9488
     
    131125    TOISeqBuffered * toiin = new TOISeqBuffered("f2in", w1);
    132126    if (fgdbg) toiin->setDebugLevel(1);
    133     TOISeqBuffered * toiout = new TOISeqBuffered("out", w1);
    134     if (fgdbg) toiout->setDebugLevel(1);
     127    TOISeqBuffered * toidegli = new TOISeqBuffered("degli", w1);
     128    if (fgdbg) toidegli->setDebugLevel(1);
    135129    TOISeqBuffered * toimean = new TOISeqBuffered("mean", w1);
    136130    if (fgdbg) toimean->setDebugLevel(1);
     
    161155    degl.SetRange(range_min, range_max);
    162156    degl.addInput("in", toiin);
    163     degl.addOutput("out", toiout);
     157    degl.addOutput("out", toidegli);
    164158    degl.addOutput("mean", toimean);
    165159    degl.addOutput("sigma", toisig);
    166160    degl.addOutput("incopie", toiincopie);
    167  
    168     /*   
    169     cout << " Creating a GaussianFilter SimplFilterObject " << endl;
    170     SimpleFilter filt(..)
    171     TOISeqBuffered * toiincopie = new TOISeqBuffered("incopie", w1);
    172     if (fgdbg) toiincopie->setDebugLevel(1);
    173     */
    174 
     161   
     162    cout << " Creating a FanOut SimpleFanOut Object " << endl;
     163    SimpleFanOut fanout(2,2);
     164    TOISeqBuffered * toidegli0 = new TOISeqBuffered("degli0", w1);
     165    if (fgdbg) toidegli0->setDebugLevel(1);
     166    TOISeqBuffered * toidegli1 = new TOISeqBuffered("degli1", w1);
     167
     168    TOISeqBuffered * toimean0 = new TOISeqBuffered("mean0", w1);
     169    if (fgdbg) toimean0->setDebugLevel(1);
     170    TOISeqBuffered * toimean1 = new TOISeqBuffered("mean1", w1);
     171    if (fgdbg) toimean1->setDebugLevel(1);
     172   
     173    fanout.addInput("in0", toidegli);
     174    fanout.addOutput("out0_0", toidegli0);
     175    fanout.addOutput("out0_1", toidegli1);
     176    fanout.addInput("in1", toimean);
     177    fanout.addOutput("out1_0", toimean0);
     178    fanout.addOutput("out1_1", toimean1);
     179
     180    cout << " Creating an Adder SimpleAdder Object " << endl;
     181    SimpleAdder adder(2);
     182    adder.addInput("in0", toidegli0);
     183    adder.addInput("in1", toimean0);
     184    adder.SetGain(0, 1.);
     185    adder.SetGain(1, -1.);
     186    TOISeqBuffered * toideglioff = new TOISeqBuffered("deglioff", w1);
     187    if (fgdbg) toideglioff->setDebugLevel(1);
     188    adder.addOutput("out", toideglioff);
     189
     190    cout << " Creating a GaussianFilter SimpleFilter Object " << endl;
     191    SimpleFilter filt(8, SimpleFilter::GaussFilter, 1., 2.);
     192
     193    filt.addInput("in", toideglioff);
     194    TOISeqBuffered * toiout = new TOISeqBuffered("out", w1);
     195    if (fgdbg) toiout->setDebugLevel(1);
     196    TOISeqBuffered * toideglioffcopie = new TOISeqBuffered("deglioffcopie", w1);
     197    if (fgdbg) toideglioffcopie->setDebugLevel(1);
     198    filt.addOutput("out", toiout);
     199    filt.addOutput("incopie", toideglioffcopie);
     200   
     201
     202    cout << " Connecting to output (FitsWriter) " << endl;
     203   
    175204    w.setOutFlags(true);
    176205    w.addInput("in", toiincopie);
    177     w.addInput("degli", toiout);
    178     w.addInput("mean", toimean);
     206    w.addInput("out", toiout);
     207    w.addInput("degli", toidegli1);
     208    w.addInput("deglioff", toideglioffcopie);
     209    w.addInput("mean", toimean1);
    179210    w.addInput("sigma", toisig);
    180211
    181212    cout << " ------ FITSReaderTOI::PrintStatus() : ----- " << endl;
    182213    r.PrintStatus(cout); 
     214    cout << " ------ FanOut::PrintStatus() : ----- " << endl;
     215    fanout.PrintStatus(cout); 
     216    cout << " ------ Adder::PrintStatus() : ----- " << endl;
     217    adder.PrintStatus(cout); 
     218    cout << " ------ Filter::PrintStatus() : ----- " << endl;
     219    filt.PrintStatus(cout); 
    183220    cout << "----- FITSWriterTOI::PrintStatus() : ----- " << endl;
    184221    w.PrintStatus(cout); 
     
    187224    r.start();
    188225    degl.start();
     226    fanout.start();
     227    adder.start();
     228    filt.start();
    189229    w.start();
    190230
    191     /*   
     231    /*
    192232    for(int jj=0; jj<3; jj++) {
    193233      cout << *toiin;
     234      cout << *toimean;
     235      cout << *toimean1;
    194236      cout << *toiout;
    195237      sleep(1);
    196238    }
     239   
    197240    */
    198241
     
    205248    //    w.PrintStatus(cout); 
    206249
     250    cout << " ------ toiin, toidegli and toiout Status information ------- " << endl;
     251    cout << *toiin;
     252    cout << *toidegli;
     253    cout << *toiout;
     254
    207255    cout << degl;
    208     cout << " ------ toiin and toiout Status information ------- " << endl;
    209     cout << *toiin;
    210     cout << *toiout;
     256    cout << filt;
     257    cout << adder;
     258
    211259  }
    212260  catch (PThrowable & exc) {
Note: See TracChangeset for help on using the changeset viewer.