Changeset 562


Ignore:
Timestamp:
Oct 10, 2011, 9:13:32 AM (13 years ago)
Author:
campagne
Message:

continue w/wo calibration stuff (jec)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BAORadio/AmasNancay/trunk/mergeAnaFiles.cc

    r561 r562  
    11// Utilisation de SOPHYA pour faciliter les tests ...
    2 #include <regex.h>
    3 //#include <regexp.h>
    4 #include <stdio.h>
    5 
    62#include "sopnamsp.h"
    73#include "machdefs.h"
    8 
    9 #include <stdlib.h>
    104#include <dirent.h>
    115#include <matharr.h>
    126
    137// include standard c/c++
     8#include <regex.h>
     9#include <stdio.h>
     10#include <stdlib.h>
     11#include <limits>
    1412#include <iostream>
    1513#include <fstream>
     
    4038const sa_size_t NUMBER_OF_CHANNELS = 2;
    4139const sa_size_t NUMBER_OF_FREQ     = 8192;
    42 const sa_size_t TOTAL_NUM_CYCLES   = 500;
    4340const r_4    LOWER_FREQUENCY       = 1250.0; //MHz
    4441const r_4    TOTAL_BANDWIDTH       = 250.0;  //MHz
     
    5249  string ppfFile_;    //generic name of the input files
    5350  int nSliceInFreq_;  //used by reduceSpectra() fnc
    54   string typeOfCalib_;//type of calibration to be done
    5551  string calibFreq_;  //freq. value used for calibration
     52  r_4 rcalibFreq_;    //float version
     53  string calibBandFreq_;  //band of freq. used for calibration
     54  r_4 rcalibBandFreq_;    //float version
     55  int maxNumberCycles_;//maximum number of cycles to be treated
    5656} para;
    5757//--------------------------------------------------------------
    5858//Utility functions
    5959
    60 sa_size_t freqTochan(r_4 f){
     60sa_size_t freqToChan(r_4 f){
    6161  return (sa_size_t)((f-LOWER_FREQUENCY)/TOTAL_BANDWIDTH*NUMBER_OF_FREQ);
     62}
     63//--------
     64//COMPUTE the mean value on a freq. range for all channels
     65//--------
     66void meanInRange(const TMatrix<r_4> mtx,
     67                 sa_size_t chLow,
     68                 sa_size_t chHigh,
     69                 TVector<r_4>& vec){
     70  sa_size_t nr = mtx.NRows();
     71  for (sa_size_t ir=0; ir<nr; ir++){
     72    TVector<r_4> tmp(mtx(Range(ir),Range(chLow,chHigh)),false);
     73    double mean, sigma;
     74    MeanSigma(tmp,mean,sigma);
     75    vec(ir) = mean;
     76  }
    6277}
    6378//---------
     
    244259//   //Loop on files
    245260//   uint_4 nRuns=0;
    246 //   TArray<r_4> tableOfSpectra(NUMBER_OF_FREQ,NUMBER_OF_CHANNELS,TOTAL_NUM_CYCLES); //TOTAL_NUM_CYCLES should be large enough...
     261//   TArray<r_4> tableOfSpectra(NUMBER_OF_FREQ,NUMBER_OF_CHANNELS,para.maxNumberCycles_); //para.maxNumberCycles_ should be large enough...
    247262
    248263
     
    358373  iFileEnd = listOfFiles.end();
    359374
     375  //mean ON-OFF over the list of cycles
     376  TMatrix<r_4> meanDiffONOFF_noCalib(NUMBER_OF_CHANNELS,NUMBER_OF_FREQ);          //set to 0
     377  TMatrix<r_4> meanDiffONOFF_perRunCalib(NUMBER_OF_CHANNELS,NUMBER_OF_FREQ);      //set to 0
     378  TMatrix<r_4> meanDiffONOFF_perCycleCalib(NUMBER_OF_CHANNELS,NUMBER_OF_FREQ);    //set to 0
     379  char* onffTupleName[7]={"cycle",
     380                          "onoffRaw0","onoffRun0","onoffCycle0",
     381                          "onoffRaw1","onoffRun1","onoffCycle1"};
     382  NTuple onoffevolution(7,onffTupleName);
     383  r_4 xnt[7];
     384
     385  //Lower and Higher freq. bin to perform mean follow up
     386  sa_size_t chLow = freqToChan(para.rcalibFreq_ - (para.rcalibBandFreq_*0.5));
     387  sa_size_t chHigh = freqToChan(para.rcalibFreq_ + (para.rcalibBandFreq_*0.5));
     388 
    360389  //Loop on files/run
    361   uint_4 totalNumberCycles=0; //total number of cycles for normalisation
     390
     391  int totalNumberCycles=0; //total number of cycles for normalisation
    362392  for (iFile = listOfFiles.begin(); iFile != iFileEnd; ++iFile) {
    363393    if (para.debuglev_>90){
     
    462492      cout << "(nr,nc): "<< nr << "," << nc << endl;
    463493      calibBAOfactors_Off_Cycle_Ch0.Print(cout);
     494      cout << endl;
    464495    }
    465496
     
    476507      cout << "Fill calib. with mean value " << endl;
    477508      calibBAOfactors_Off_Run_Ch0.Print(cout);
     509      cout << endl;
    478510    }
    479511    ifs.close();
     
    493525      cout << "(nr,nc): "<< nr << "," << nc << endl;
    494526      calibBAOfactors_Off_Cycle_Ch1.Print(cout);
     527      cout << endl;
    495528    }
    496529    TMatrix<r_4> calibBAOfactors_Off_Run_Ch1(nr,nc);
     
    506539      cout << "Fill calib. with mean value " << endl;
    507540      calibBAOfactors_Off_Run_Ch1.Print(cout);
     541      cout << endl;
    508542    }
    509543    ifs.close();
     
    523557      cout << "(nr,nc): "<< nr << "," << nc << endl;
    524558      calibBAOfactors_On_Cycle_Ch0.Print(cout);
    525        
     559      cout << endl;     
    526560    }
    527561
     
    538572      cout << "Fill calib. with mean value " << endl;
    539573      calibBAOfactors_On_Run_Ch0.Print(cout);
     574      cout << endl;
    540575    }
    541576    ifs.close();
     
    554589      cout << "(nr,nc): "<< nr << "," << nc << endl;
    555590      calibBAOfactors_On_Cycle_Ch1.Print(cout);
     591      cout << endl;
    556592    }
    557593    TMatrix<r_4> calibBAOfactors_On_Run_Ch1(nr,nc);
     
    567603      cout << "Fill calib. with mean value " << endl;
    568604      calibBAOfactors_On_Run_Ch1.Print(cout);
     605      cout << endl;
    569606    }
    570607
     
    572609   
    573610    //link <cycle> - <calibration coefficient>
    574     map<int,r_4> calibBAO_Off_Ch0;
    575     map<int,r_4> calibBAO_Off_Ch1;
    576     map<int,r_4> calibBAO_On_Ch0;
    577     map<int,r_4> calibBAO_On_Ch1;
    578     if (para.typeOfCalib_ == "perRun") {
    579       sa_size_t nr = calibBAOfactors_Off_Run_Ch0.NRows();
    580       for (sa_size_t ir=0; ir<nr; ++ir){
    581         calibBAO_Off_Ch0[(int)calibBAOfactors_Off_Run_Ch0(0,ir)]
    582           = calibBAOfactors_Off_Run_Ch0(1,ir);
    583       }
    584       nr = calibBAOfactors_Off_Run_Ch1.NRows();
    585       for (sa_size_t ir=0; ir<nr; ++ir){
    586         calibBAO_Off_Ch1[(int)calibBAOfactors_Off_Run_Ch1(0,ir)]
    587           = calibBAOfactors_Off_Run_Ch1(1,ir);
    588       }
    589 
    590       nr = calibBAOfactors_On_Run_Ch0.NRows();
    591       for (sa_size_t ir=0; ir<nr; ++ir){
    592         calibBAO_On_Ch0[(int)calibBAOfactors_On_Run_Ch0(0,ir)]
    593           = calibBAOfactors_On_Run_Ch0(1,ir);
    594       }
    595       nr = calibBAOfactors_On_Run_Ch1.NRows();
    596       for (sa_size_t ir=0; ir<nr; ++ir){
    597         calibBAO_On_Ch1[(int)calibBAOfactors_On_Run_Ch1(0,ir)]
    598           = calibBAOfactors_On_Run_Ch1(1,ir);
    599       }
     611    //We cannot rely on identical cycle list of the OFF and ON calibration
     612    map<int,r_4> calibBAO_Off_Run_Ch0;
     613    map<int,r_4> calibBAO_Off_Run_Ch1;
     614    map<int,r_4> calibBAO_On_Run_Ch0;
     615    map<int,r_4> calibBAO_On_Run_Ch1;
     616
     617    map<int,r_4> calibBAO_Off_Cycle_Ch0;
     618    map<int,r_4> calibBAO_Off_Cycle_Ch1;
     619    map<int,r_4> calibBAO_On_Cycle_Ch0;
     620    map<int,r_4> calibBAO_On_Cycle_Ch1;
     621
     622    //per Run based BAO coefficients
     623    nr = calibBAOfactors_Off_Run_Ch0.NRows();
     624    for (sa_size_t ir=0; ir<nr; ++ir){
     625      calibBAO_Off_Run_Ch0[(int)calibBAOfactors_Off_Run_Ch0(ir,0)]
     626        = calibBAOfactors_Off_Run_Ch0(ir,1);
     627      calibBAO_Off_Cycle_Ch0[(int)calibBAOfactors_Off_Cycle_Ch0(ir,0)]
     628        = calibBAOfactors_Off_Cycle_Ch0(ir,1);
     629      calibBAO_Off_Run_Ch1[(int)calibBAOfactors_Off_Run_Ch1(ir,0)]
     630        = calibBAOfactors_Off_Run_Ch1(ir,1);
     631      calibBAO_Off_Cycle_Ch1[(int)calibBAOfactors_Off_Cycle_Ch1(ir,0)]
     632        = calibBAOfactors_Off_Cycle_Ch1(ir,1);
     633    }
     634   
     635    nr = calibBAOfactors_On_Run_Ch0.NRows();
     636    for (sa_size_t ir=0; ir<nr; ++ir){
     637      calibBAO_On_Run_Ch0[(int)calibBAOfactors_On_Run_Ch0(ir,0)]
     638        = calibBAOfactors_On_Run_Ch0(ir,1);
     639      calibBAO_On_Cycle_Ch0[(int)calibBAOfactors_On_Cycle_Ch0(ir,0)]
     640        = calibBAOfactors_On_Cycle_Ch0(ir,1);
     641      calibBAO_On_Run_Ch1[(int)calibBAOfactors_On_Run_Ch1(ir,0)]
     642        = calibBAOfactors_On_Run_Ch1(ir,1);
     643      calibBAO_On_Cycle_Ch1[(int)calibBAOfactors_On_Cycle_Ch1(ir,0)]
     644        = calibBAOfactors_On_Cycle_Ch1(ir,1);
     645    }
    600646     
    601     } else if (para.typeOfCalib_ == "perCycle") {
    602 
    603       sa_size_t nr = calibBAOfactors_Off_Cycle_Ch0.NRows();
    604       for (sa_size_t ir=0; ir<nr; ++ir){
    605         calibBAO_Off_Ch0[(int)calibBAOfactors_Off_Cycle_Ch0(0,ir)]
    606           = calibBAOfactors_Off_Cycle_Ch0(1,ir);
    607       }
    608       nr = calibBAOfactors_Off_Cycle_Ch1.NRows();
    609       for (sa_size_t ir=0; ir<nr; ++ir){
    610         calibBAO_Off_Ch1[(int)calibBAOfactors_Off_Cycle_Ch1(0,ir)]
    611           = calibBAOfactors_Off_Cycle_Ch1(1,ir);
    612       }
    613 
    614       nr = calibBAOfactors_On_Cycle_Ch0.NRows();
    615       for (sa_size_t ir=0; ir<nr; ++ir){
    616         calibBAO_On_Ch0[(int)calibBAOfactors_On_Cycle_Ch0(0,ir)]
    617           = calibBAOfactors_On_Cycle_Ch0(1,ir);
    618       }
    619       nr = calibBAOfactors_On_Cycle_Ch1.NRows();
    620       for (sa_size_t ir=0; ir<nr; ++ir){
    621         calibBAO_On_Ch1[(int)calibBAOfactors_On_Cycle_Ch1(0,ir)]
    622           = calibBAOfactors_On_Cycle_Ch1(1,ir);
    623       }
    624 
    625     } else {
    626       throw "Unknow calibration type: " + para.typeOfCalib_;
    627     }
    628 
    629647
    630648   
     
    635653    //Loop on cyles
    636654    for (list<int>::iterator ic=commonCycles.begin(); ic!=commonCycles.end(); ++ic){
     655
     656      if(para.debuglev_>9){
     657        cout << "Calibration coefficients for cycle "<<*ic << endl;
     658        cout << "Off Run Ch0 " << calibBAO_Off_Run_Ch0[*ic] << " "
     659             << "Ch1 " << calibBAO_Off_Run_Ch1[*ic] << "\n"
     660             << "On Run Ch0 " << calibBAO_On_Run_Ch0[*ic] << " "
     661             << "Ch1 " << calibBAO_On_Run_Ch1[*ic] << "\n"
     662             << "Off Cycle Ch0 " << calibBAO_Off_Cycle_Ch0[*ic] << " "
     663             << "Ch1 " << calibBAO_Off_Cycle_Ch1[*ic] << "\n"
     664             << "On Cycle Ch0 " << calibBAO_On_Cycle_Ch0[*ic] << " "
     665             << "Ch1 " << calibBAO_On_Cycle_Ch1[*ic] << endl;
     666      }
     667     
    637668      string ppftag;
    638669      //load ON phase
     
    641672     
    642673      ppftag = "specRawOn"+cycle.str();
    643       TMatrix<r_4> aSpecON(NUMBER_OF_CHANNELS,NUMBER_OF_FREQ);
    644       fin.GetObject(aSpecON,ppftag);
    645 
     674      TMatrix<r_4> aSpecOn(NUMBER_OF_CHANNELS,NUMBER_OF_FREQ);
     675      fin.GetObject(aSpecOn,ppftag);
     676
     677      TMatrix<r_4> aSpecOn_BAOCalibRun(aSpecOn,false);
     678      aSpecOn_BAOCalibRun(Range(0),Range::all()) /= calibBAO_On_Run_Ch0[*ic];
     679      aSpecOn_BAOCalibRun(Range(1),Range::all()) /= calibBAO_On_Run_Ch1[*ic];
     680
     681      TMatrix<r_4> aSpecOn_BAOCalibCycle(aSpecOn,false);
     682      aSpecOn_BAOCalibCycle(Range(0),Range::all()) /= calibBAO_On_Cycle_Ch0[*ic];
     683      aSpecOn_BAOCalibCycle(Range(1),Range::all()) /= calibBAO_On_Cycle_Ch1[*ic];
    646684     
    647 
    648 
    649 
    650685      ppftag = "specRawOff"+cycle.str();
    651       TMatrix<r_4> aSpecOFF(NUMBER_OF_CHANNELS,NUMBER_OF_FREQ);
    652       fin.GetObject(aSpecOFF,ppftag);
     686      TMatrix<r_4> aSpecOff(NUMBER_OF_CHANNELS,NUMBER_OF_FREQ);
     687      fin.GetObject(aSpecOff,ppftag);
     688
     689      TMatrix<r_4> aSpecOff_BAOCalibRun(aSpecOff,false);
     690      aSpecOff_BAOCalibRun(Range(0),Range::all()) /= calibBAO_Off_Run_Ch0[*ic];
     691      aSpecOff_BAOCalibRun(Range(1),Range::all()) /= calibBAO_Off_Run_Ch1[*ic];
     692
     693      TMatrix<r_4> aSpecOff_BAOCalibCycle(aSpecOff,false);
     694      aSpecOff_BAOCalibCycle(Range(0),Range::all()) /= calibBAO_Off_Cycle_Ch0[*ic];
     695      aSpecOff_BAOCalibCycle(Range(1),Range::all()) /= calibBAO_Off_Cycle_Ch1[*ic];
     696
     697
     698      //Perform the difference ON-OFF with the different calibration options
     699      TMatrix<r_4> diffOnOff_noCalib = aSpecOn - aSpecOff;
     700      meanDiffONOFF_noCalib += diffOnOff_noCalib;
    653701     
     702      TMatrix<r_4> diffOnOff_perRunCalib = aSpecOn_BAOCalibRun - aSpecOff_BAOCalibRun;
     703      meanDiffONOFF_perRunCalib += diffOnOff_perRunCalib;
     704
     705      TMatrix<r_4> diffOnOff_perCycleCalib = aSpecOn_BAOCalibCycle - aSpecOff_BAOCalibCycle;
     706      meanDiffONOFF_perCycleCalib += diffOnOff_perCycleCalib;
     707
     708      //Fill NTuple
     709      xnt[0] = *ic;
     710     
     711      TVector<r_4> meanInRange_noCalib(NUMBER_OF_CHANNELS);
     712      meanInRange(diffOnOff_noCalib,chLow,chHigh,meanInRange_noCalib);
     713      xnt[1] = meanInRange_noCalib(0);
     714      xnt[2] = meanInRange_noCalib(1);
     715
     716      TVector<r_4> meanInRange_perRunCalib(NUMBER_OF_CHANNELS);
     717      meanInRange(diffOnOff_perRunCalib,chLow,chHigh,meanInRange_perRunCalib);
     718      xnt[3] = meanInRange_perRunCalib(0);
     719      xnt[4] = meanInRange_perRunCalib(1);
     720
     721      TVector<r_4> meanInRange_perCycleCalib(NUMBER_OF_CHANNELS);
     722      meanInRange(diffOnOff_perCycleCalib,chLow,chHigh,meanInRange_perCycleCalib);
     723      xnt[3] = meanInRange_perCycleCalib(0);
     724      xnt[4] = meanInRange_perCycleCalib(1);
     725     
     726      onoffevolution.Fill(xnt);
     727
    654728      totalNumberCycles++;
    655        
     729      if (totalNumberCycles >= para.maxNumberCycles_) break;   
     730
    656731    }//eo loop on cycles
    657 
     732    if (totalNumberCycles >= para.maxNumberCycles_) break;         
     733 
    658734  }//eo loop on spectra in a file
     735  cout << "End of jobs: we have treated " << totalNumberCycles << " cycles" << endl;
     736  //Normalisation
     737  if(totalNumberCycles>0){
     738    meanDiffONOFF_noCalib       /= (r_4)totalNumberCycles;
     739    meanDiffONOFF_perRunCalib   /= (r_4)totalNumberCycles;
     740    meanDiffONOFF_perCycleCalib /= (r_4)totalNumberCycles;
     741  } 
     742 
     743  //Compute the reduced version of the mean and sigma
     744  TMatrix<r_4> meanRedMtx_noCalib(NUMBER_OF_CHANNELS,para.nSliceInFreq_);
     745  TMatrix<r_4> sigmaRedMtx_noCalib(NUMBER_OF_CHANNELS,para.nSliceInFreq_);
     746  reduceSpectra(meanDiffONOFF_noCalib,meanRedMtx_noCalib,sigmaRedMtx_noCalib);
     747
     748  TMatrix<r_4> meanRedMtx_perRunCalib(NUMBER_OF_CHANNELS,para.nSliceInFreq_);
     749  TMatrix<r_4> sigmaRedMtx_perRunCalib(NUMBER_OF_CHANNELS,para.nSliceInFreq_);
     750  reduceSpectra(meanDiffONOFF_perRunCalib,meanRedMtx_perRunCalib,sigmaRedMtx_perRunCalib);
     751
     752  TMatrix<r_4> meanRedMtx_perCycleCalib(NUMBER_OF_CHANNELS,para.nSliceInFreq_);
     753  TMatrix<r_4> sigmaRedMtx_perCycleCalib(NUMBER_OF_CHANNELS,para.nSliceInFreq_);
     754  reduceSpectra(meanDiffONOFF_perCycleCalib,meanRedMtx_perCycleCalib,sigmaRedMtx_perCycleCalib);
     755
     756  {//save the results
     757    stringstream tmp;
     758    tmp << totalNumberCycles;
     759    string fileName = para.outPath_+"/onoffsurvey_"+StringToLower(para.sourceName_)+"-"+tmp.str()+"Cycles.ppf";
     760    POutPersist fos(fileName);
     761
     762    string tag = "meanNoCalib";
     763    fos << PPFNameTag(tag) << meanDiffONOFF_noCalib;
     764    tag = "meanPerRunCalib";
     765    fos << PPFNameTag(tag) << meanDiffONOFF_perRunCalib;
     766    tag = "meanPerCycleCalib";
     767    fos << PPFNameTag(tag) << meanDiffONOFF_perCycleCalib;
     768
     769    tag = "redmeanNoCalib";
     770    fos << PPFNameTag(tag) << meanRedMtx_noCalib;
     771    tag = "redsigmaNoCalib";
     772    fos << PPFNameTag(tag) << sigmaRedMtx_noCalib;
     773
     774    tag = "redmeanPerRunCalib";
     775    fos << PPFNameTag(tag) << meanRedMtx_perRunCalib;
     776    tag = "redsigmaPerRunCalib";
     777    fos << PPFNameTag(tag) << sigmaRedMtx_perRunCalib;
     778
     779    tag = "redmeanPerCycleCalib";
     780    fos << PPFNameTag(tag) << meanRedMtx_perCycleCalib;
     781    tag = "redsigmaPerCycleCalib";
     782    fos << PPFNameTag(tag) << sigmaRedMtx_perCycleCalib;
     783   
     784    tag = "onoffevol";
     785    fos << PPFNameTag(tag) << onoffevolution;   
     786  }//end of save
    659787}
    660788//-------------------------------------------------------
     
    744872 
    745873
    746   TArray<r_4> tableOfSpectra(NUMBER_OF_FREQ,NUMBER_OF_CHANNELS,TOTAL_NUM_CYCLES); //TOTAL_NUM_CYCLES should be large enough...
     874  TArray<r_4> tableOfSpectra(NUMBER_OF_FREQ,NUMBER_OF_CHANNELS,para.maxNumberCycles_); //para.maxNumberCycles_ should be large enough...
    747875
    748876  StringMatch match("specONOFFRaw[0-9]+"); //Tag of the PPF objects
     
    765893    iSpecEnd = listOfSpectra.end();
    766894    //Loop of spectra matrix
    767     for (iSpec = listOfSpectra.begin(); iSpec !=iSpecEnd && (sa_size_t)nSpectra < TOTAL_NUM_CYCLES ;  ++iSpec){
     895    for (iSpec = listOfSpectra.begin(); iSpec !=iSpecEnd && (sa_size_t)nSpectra < para.maxNumberCycles_ ;  ++iSpec){
    768896      if (para.debuglev_>90){
    769897        cout << " spactra <" << *iSpec << ">" << endl;
     
    798926
    799927
    800   sa_size_t f1320=freqTochan(1320.);
    801   sa_size_t f1345=freqTochan(1345.);
    802   sa_size_t f1355=freqTochan(1355.);
    803   sa_size_t f1380=freqTochan(1380.);
     928  sa_size_t f1320=freqToChan(1320.);
     929  sa_size_t f1345=freqToChan(1345.);
     930  sa_size_t f1355=freqToChan(1355.);
     931  sa_size_t f1380=freqToChan(1380.);
    804932  //Compute baseline arround 1350Mhz on [1320-1345] U [1355-1380]
    805933  if (para.debuglev_>9){
     
    821949  } 
    822950  meanMed.Print(cout);
     951  cout << endl;
     952
    823953 
    824954  //Compute the sigma in the range 1320MHz-1380MHz
     
    840970  }
    841971  sigmaMed.Print(cout);
     972  cout << endl;
     973
    842974 
    843975 
     
    8961028  string typeOfCalib="perRun";
    8971029  string calibFreq = "1346";
    898  
     1030  string calibBandFreq="6.25";
     1031  string mxcycles;
     1032
    8991033  //  bool okarg=false;
    9001034  int ka=1;
     
    9021036    if (strcmp(arg[ka],"-h")==0) {
    9031037      cout << "Usage:  -act [meanRawDiffOnOff]|medianRawDiffOnOff|meanCalibBAODiffOnOff\n"
    904            << " -calibopt [perRun]|perCcyle (cf. in case of calibration to be done)\n"
     1038           << " -mxcycles <number> (max. number of cycles to be treated)\n"
    9051039           << " -calibfreq <number> (cf. freq. used by calibration operation)\n"
     1040           << " -calibbandfreq <number> (cf. band of freq. used by calibration operation)\n"
    9061041           << " -src [Abell85]\n -inPath [.]|<top_root_dir of the ppf file>\n"
    9071042           << " (ex. /sps/baoradio/AmasNancay/JEC/\n "
     
    9211056      ka+=2;
    9221057    }
    923     else if (strcmp(arg[ka],"-calibopt")==0) {
    924       typeOfCalib=arg[ka+1];
     1058    else if (strcmp(arg[ka],"-calibfreq")==0) {
     1059      calibFreq=arg[ka+1];
    9251060      ka+=2;
    9261061    }   
    927     else if (strcmp(arg[ka],"-calibfreq")==0) {
    928       calibFreq=arg[ka+1];
     1062    else if (strcmp(arg[ka],"-calibbandfreq")==0) {
     1063      calibBandFreq=arg[ka+1];
     1064      ka+=2;
     1065    }   
     1066    else if (strcmp(arg[ka],"-mxcycles")==0) {
     1067      mxcycles=arg[ka+1];
    9291068      ka+=2;
    9301069    }   
     
    9581097  para.ppfFile_    = ppfFile;
    9591098  para.nSliceInFreq_ = atoi(nSliceInFreq.c_str());
    960   para.typeOfCalib_ = typeOfCalib;
    9611099  para.calibFreq_   = calibFreq;
     1100  para.calibBandFreq_ = calibBandFreq;
     1101  para.rcalibFreq_   = atof(calibFreq.c_str());
     1102  para.rcalibBandFreq_ = atof(calibBandFreq.c_str());
     1103  if (mxcycles != "") {
     1104    para.maxNumberCycles_ = atoi(mxcycles.c_str());
     1105  } else {
     1106    para.maxNumberCycles_ = std::numeric_limits<int>::max();
     1107  }
    9621108
    9631109  cout << "Dump Initial parameters ............" << endl;
    9641110  cout << " action = " << action << "\n"
     1111       << " maxNumberCycles = " << para.maxNumberCycles_ << "\n"
    9651112       << " inputPath = " << para.inPath_  << "\n"
    9661113       << " outputPath = " <<  para.outPath_ << "\n"
     
    9681115       << " ppfFile = " <<  para.ppfFile_ << "\n"
    9691116       << " nSliceInFreq = " << para.nSliceInFreq_  << "\n"
    970        << " typeOfCalib = " << para.typeOfCalib_ << "\n"
    9711117       << " calibFreq = " <<  para.calibFreq_ << "\n"
     1118       << " calibBandFreq = " <<  para.calibBandFreq_ << "\n"
    9721119       << " debuglev = "  << para.debuglev_   << "\n";
    9731120  cout << "...................................." << endl;
Note: See TracChangeset for help on using the changeset viewer.