Changeset 542


Ignore:
Timestamp:
Oct 3, 2011, 6:53:43 PM (13 years ago)
Author:
campagne
Message:

forbid INTERACTIVE Mode

Location:
BAORadio/AmasNancay
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • BAORadio/AmasNancay/anarawonoffmaker.sh

    r540 r542  
    8282    iojobpath="/sps/baoradio/AmasNancay/JEC"
    8383    $MKDIR -p $iojobpath
     84    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
     85    exit 0;
    8486elif [ ${ENVIRONMENT} = "BATCH" ] ; then
    8587    iojobpath=${TMPBATCH}
  • BAORadio/AmasNancay/calibmaker.sh

    r540 r542  
    8484    iojobpath="/sps/baoradio/AmasNancay/JEC"
    8585    $MKDIR -p $iojobpath
     86    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
     87    exit 0;
    8688elif [ ${ENVIRONMENT} = "BATCH" ] ; then
    8789    iojobpath=${TMPBATCH}
     
    140142  cd ${topDir}
    141143  $LS | $XARGS -i $RM -rf {}
     144
    142145 
    143146  $ECHO "DEBUG: (${scriptName}) irods root dir $i"
  • BAORadio/AmasNancay/gainmaker.sh

    r540 r542  
    8282    iojobpath="/sps/baoradio/AmasNancay/JEC"
    8383    $MKDIR -p $iojobpath
     84    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
     85    exit 0;   
    8486elif [ ${ENVIRONMENT} = "BATCH" ] ; then
    8587    iojobpath=${TMPBATCH}
  • BAORadio/AmasNancay/mergeRawOnOff.cc

    r541 r542  
    3737#include "ppersist.h"
    3838
     39//-----------------------------------------------
     40const sa_size_t NUMBER_OF_CHANNELS = 2;
     41const sa_size_t  NUMBER_OF_FREQ = 8192;
     42const r_4    LOWER_FREQUENCY = 1250.0; //MHz
     43const r_4    TOTAL_BANDWIDTH = 250.0; //MHz
    3944//-----------------------------------------------
    4045char *regexp (const char *string, const char *patrn, int *begin, int *end) {   
     
    6166
    6267struct Param {
    63   string debuglev_;
     68  int debuglev_;
    6469  string inPath_;
    6570  string outPath_;
     
    154159  directoryName = para.inPath_ + "/" + para.sourceName_;
    155160
     161  //Make the listing of the directory
    156162  listOfFiles = ListOfFileInDir(directoryName,para.ppfFile_);
    157163 
     
    159165  iFileEnd = listOfFiles.end();
    160166 
    161   StringMatch match("specONOFFRaw[0-9]+");
     167  StringMatch match("specONOFFRaw[0-9]+"); //Tag of the PPF objects
     168  TMatrix<r_4> sumOfSpectra(NUMBER_OF_CHANNELS,NUMBER_OF_FREQ);
     169  uint_4 nSpectra=0;
     170  //Loop on files
    162171  for (iFile = listOfFiles.begin(); iFile != iFileEnd; ++iFile) {
    163     cout << "load file <" << *iFile << ">" << endl;
     172    if (para.debuglev_>90){
     173      cout << "load file <" << *iFile << ">" << endl;
     174    }
    164175    PInPersist fin(*iFile);
    165176    vector<string> vec = fin.GetNameTags();
    166177    list<string> listOfSpectra;
     178    //Keep only required PPF objects
    167179    std::remove_copy_if(
    168180                        vec.begin(), vec.end(), back_inserter(listOfSpectra),
     
    172184    iSpecEnd = listOfSpectra.end();
    173185    listOfSpectra.sort(stringCompare);
    174 
     186    //Loop of spectra matrix
    175187    for (iSpec = listOfSpectra.begin(); iSpec !=iSpecEnd;  ++iSpec){
    176       cout << " spactra <" << *iSpec << ">" << endl;
    177     }
    178 
    179   }
    180  
     188      if (para.debuglev_>90){
     189        cout << " spactra <" << *iSpec << ">" << endl;
     190      }
     191      TMatrix<r_4> aSpec(NUMBER_OF_CHANNELS,NUMBER_OF_FREQ);
     192      fin.GetObject(aSpec,*iSpec);
     193      //How to see if the GetObject is ok?? Ask Reza
     194      nSpectra++;
     195      sumOfSpectra+=aSpec;
     196    }//eo loop on spectra in a file
     197  }//eo loop on files
     198 
     199  //Normalisation
     200  if(nSpectra>0)sumOfSpectra/=(r_4)(nSpectra);
     201
     202  {//Save the result
     203    stringstream tmp;
     204    tmp << nSpectra;
     205    string fileName = para.outPath_+"/meanDiffOnOffRaw_"+StringToLower(para.sourceName_)+"-"+tmp.str()+"Cycles.ppf";
     206    cout << "Save mean based on " <<  nSpectra << " cycles " << endl;
     207    string tag = "mean";
     208    POutPersist fos(fileName);
     209    fos << PPFNameTag(tag) << sumOfSpectra;
     210  }
    181211}
    182212//-------------------------------------------------------
     
    226256  }//eo while
    227257
    228   para.debuglev_ = debuglev;
     258  para.debuglev_ = atoi(debuglev.c_str());
    229259  para.inPath_   = inputPath;
    230260  para.outPath_  = outputPath;
     
    250280  try {
    251281
    252     int b,e;
    253     char *match=regexp("truc0machin","[a-z]+[0-9]*",&b,&e);
    254     printf("->%s<-\n(b=%d e=%d)\n",match,b,e);
     282//     int b,e;
     283//     char *match=regexp("truc0machin","[a-z]+[0-9]*",&b,&e);
     284//     printf("->%s<-\n(b=%d e=%d)\n",match,b,e);
    255285
    256286    if ( action == "default" ) {
  • BAORadio/AmasNancay/onoffmaker.sh

    r540 r542  
    8484    iojobpath="/sps/baoradio/AmasNancay/JEC"
    8585    $MKDIR -p $iojobpath
     86    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
     87    exit 0;
    8688elif [ ${ENVIRONMENT} = "BATCH" ] ; then
    8789    iojobpath=${TMPBATCH}
  • BAORadio/AmasNancay/rawonoffmaker.sh

    r540 r542  
    8282    iojobpath="/sps/baoradio/AmasNancay/JEC"
    8383    $MKDIR -p $iojobpath
     84    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
     85    exit 0;
    8486elif [ ${ENVIRONMENT} = "BATCH" ] ; then
    8587    iojobpath=${TMPBATCH}
  • BAORadio/AmasNancay/submit2bqs-anarawonoffmaker.sh

    r540 r542  
    3434
    3535
    36 jobBatchName="rawonoff-${sourceRadio}${dateJob}"
     36jobBatchName="anarawonoff-${sourceRadio}${dateJob}"
    3737
    3838jobLogName="${jobBatchName}.log.$$"
Note: See TracChangeset for help on using the changeset viewer.