Changeset 595


Ignore:
Timestamp:
Nov 7, 2011, 10:47:08 AM (13 years ago)
Author:
torrento
Message:

Comment sleep in while loop

Location:
BAORadio/AmasNancay/trunk
Files:
9 edited

Legend:

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

    r593 r595  
    5252//----------------------------------------------------------
    5353//Utility fonctions
     54class median_of_empty_list_exception:public std::exception{
     55    virtual const char* what() const throw() {
     56    return "Attempt to take the median of an empty list of numbers.  "
     57      "The median of an empty list is undefined.";
     58  }
     59};
     60template<class RandAccessIter>
     61double median(RandAccessIter begin, RandAccessIter end)
     62  throw(median_of_empty_list_exception){
     63  if(begin == end){ throw median_of_empty_list_exception(); }
     64  std::size_t size = end - begin;
     65  std::size_t middleIdx = size/2;
     66  RandAccessIter target = begin + middleIdx;
     67  std::nth_element(begin, target, end);
     68   
     69  if(size % 2 != 0){ //Odd number of elements
     70    return *target;
     71  }else{            //Even number of elements
     72    double a = *target;
     73    RandAccessIter targetNeighbor= target-1;
     74    std::nth_element(begin, targetNeighbor, end);
     75    return (a+*targetNeighbor)/2.0;
     76  }
     77}
     78
     79//-------------
     80
    5481// Function for deleting pointers in map.
    5582template<class A, class B>
     
    789816  //Process to get sucessively
    790817  //Raw Spectra,
    791   //The pocesses are separated to allow intermediate save of results
     818  //The processes are separated to allow intermediate save of results
    792819
    793820  map< pair<string, sa_size_t>, TMatrix<r_4> > spectreCollect;
     
    884911  if(nCycles>0) diffMeanOnOff/=nCycles;
    885912
    886   //exctract channels and do the mean
     913  //extract channels and do the mean
    887914  TVector<r_4> meanOfChan(NUMBER_OF_FREQ); //implicitly init to 0
    888915  for (sa_size_t iCh=0; iCh<NUMBER_OF_CHANNELS; ++iCh) {
     
    935962          MeanSigma(reducedRow,mean,sigma);
    936963          if (debuglev_>9) {
    937             cout << "mean/signa " << mean << "/" << sigma << endl;
     964            cout << "mean/sigma " << mean << "/" << sigma << endl;
    938965          }
    939966          reducedMeanDiffOnOff(iCh,iSlice) = mean;
     
    17121739        for (int i=0;i<2;i++) {
    17131740          if (!upIntState[i].empty()) {
    1714             std::nth_element(upIntState[i].begin(),
    1715                              upIntState[i].begin()+upIntState[i].size()/2,
    1716                              upIntState[i].end());
    1717             meanUpper += *(upIntState[i].begin()+upIntState[i].size()/2);
     1741//          std::nth_element(upIntState[i].begin(),
     1742//                           upIntState[i].begin()+upIntState[i].size()/2,
     1743//                           upIntState[i].end());
     1744//          meanUpper += *(upIntState[i].begin()+upIntState[i].size()/2);
     1745            meanUpper += median(upIntState[i].begin(),upIntState[i].end());
    17181746            nval++;
    17191747          }
  • BAORadio/AmasNancay/trunk/anarawonoffmaker.sh

    r579 r595  
    253253  $RM -f ${tmppublicpath}/getscafiles.finished
    254254  ${scriptpath}/getscafiles.sh ${sourceRadio} ${dateDAQ} > ${OUT1} 2>&1
    255   while [ ! -f "${tmppublicpath}/getscafiles.finished" ]; do
    256       $ECHO "INFO (${scriptName}): waiting for ${tmppublicpath}/getscafiles.finished"
    257       date +%T
    258       sleep 30
    259   done
     255#  while [ ! -f "${tmppublicpath}/getscafiles.finished" ]; do
     256#      $ECHO "INFO (${scriptName}): waiting for ${tmppublicpath}/getscafiles.finished"
     257#      date +%T
     258#      sleep 30
     259#  done
    260260  $RM ${tmppublicpath}/getscafiles.finished
    261261  $ECHO "DEBUG (${scriptName}): END"
  • BAORadio/AmasNancay/trunk/etude_gain.pic

    r547 r595  
    1 set toppath "/sps/baoradio/AmasNancay/JEC"
     1set user "AST"
     2set toppath "/sps/baoradio/AmasNancay/${user}"
    23set source "Abell85"
    34set srclower "abell85"
    4 set date   "20110507"
     5set date   "20110812"
     6set saveplot "1"
    57
    68####################################################
     
    1820settitle "Gain $source ${date} Ch 0 (blue) Ch 1 (red)"
    1921setaxelabels "Freq. (MHz)" "I (a.u)"
     22if ( $saveplot == "1" ) then
     23  echo "saving plot"
     24  w2eps ${toppath}/${source}/eps/gain/gain_${date}_${srclower}.eps
     25endif
    2026
    2127####################################################
     
    2430newwin 1 1
    2531graphicatt "xylimits=0,25,0,0.006"
     32del gainmoni gainmoni0 gainmoni1
    2633
    2734openppf ${toppath}/${source}/${date}${srclower}/gain_monitor_${date}_${srclower}.ppf
    2835#attention les "monitor" ont ete utilise a une epoque ou il n'y avait pas de
    2936#reordering...
    30 plot2d monitor n val n>0 "black cpts nsta notit"
     37ls
     38#plot2d monitor n val n>0 "black cpts nsta notit"
    3139plot2d gainmoni n val n>0 "black cpts nsta notit"
    3240plot2d gainmoni0 n val n>0 "same blue cpts nsta notit"
    3341plot2d gainmoni1 n val n>0 "same red cpts nsta notit"
     42settitle "Gain monitor $source ${date} Ch 0 (blue) Ch 1 (red)"
     43if ( $saveplot == "1" ) then
     44#  w2eps ${toppath}/${source}/eps/gain/gain_monitor_${date}_${srclower}.eps
     45endif
     46
     47del g0 g1 gainmoni gainmoni0 gainmoni1
     48del gain_${date}_${srclower}
     49ls
  • BAORadio/AmasNancay/trunk/makefile

    r559 r595  
    77PKGOLIST =
    88
    9 EXELIST = $(EXE)analyse $(EXE)mergeAnaFiles
     9EXELIST = $(EXE)analyse $(EXE)mergeAnaFiles $(EXE)anaTools
    1010
    11 EXEOLIST = $(EXE)analyse.o $(EXE)mergeAnaFiles.o
     11EXEOLIST = $(EXE)analyse.o $(EXE)mergeAnaFiles.o $(EXE)anaTools.o
    1212
    1313
    14 all : analyse mergeAnaFiles
     14all : analyse mergeAnaFiles anaTools
    1515
    1616clean :
     
    3737$(OBJ)mergeAnaFiles.o : mergeAnaFiles.cc
    3838        $(CXXCOMPILE) -c  -o $(OBJ)mergeAnaFiles.o mergeAnaFiles.cc
    39  
     39
     40anaTools : $(EXE)anaTools
     41        echo '---anaTools made'
     42
     43$(EXE)anaTools : $(OBJ)anaTools.o
     44        $(CXXLINK) -o $(EXE)anaTools $(OBJ)anaTools.o  $(SOPHYAALLSLBLIST)
     45
     46$(OBJ)anaTools.o : anaTools.cc
     47        $(CXXCOMPILE) -c  -o $(OBJ)anaTools.o anaTools.cc
     48
  • BAORadio/AmasNancay/trunk/mergeAnaFiles.cc

    r591 r595  
    9090      "The median of an empty list is undefined.";
    9191  }
    92   };
    93   template<class RandAccessIter>
    94     double median(RandAccessIter begin, RandAccessIter end)
    95     throw(median_of_empty_list_exception){
    96     if(begin == end){ throw median_of_empty_list_exception(); }
    97     std::size_t size = end - begin;
    98     std::size_t middleIdx = size/2;
    99     RandAccessIter target = begin + middleIdx;
    100     std::nth_element(begin, target, end);
    101    
    102     if(size % 2 != 0){ //Odd number of elements
    103       return *target;
    104     }else{            //Even number of elements
    105       double a = *target;
    106       RandAccessIter targetNeighbor= target-1;
    107       std::nth_element(begin, targetNeighbor, end);
    108       return (a+*targetNeighbor)/2.0;
    109     }
    110   }
     92};
     93template<class RandAccessIter>
     94double median(RandAccessIter begin, RandAccessIter end)
     95  throw(median_of_empty_list_exception){
     96  if(begin == end){ throw median_of_empty_list_exception(); }
     97  std::size_t size = end - begin;
     98  std::size_t middleIdx = size/2;
     99  RandAccessIter target = begin + middleIdx;
     100  std::nth_element(begin, target, end);
     101   
     102  if(size % 2 != 0){ //Odd number of elements
     103    return *target;
     104  }else{            //Even number of elements
     105    double a = *target;
     106    RandAccessIter targetNeighbor= target-1;
     107    std::nth_element(begin, targetNeighbor, end);
     108    return (a+*targetNeighbor)/2.0;
     109  }
     110}
    111111
    112112//-------------
  • BAORadio/AmasNancay/trunk/proc_specmfib.sh

    r594 r595  
    347347      $ECHO "process signal files for CALIBRATION ON phases"
    348348      ingain="-gain gain_${dateSelected}_${srclower}.fits"
    349       freqfilter=""
     349      freqfilter="-freqfilter -"
    350350      nwinmean="1"
    351351      tspwin="1024"
     
    361361      $ECHO "process signal files for CALIBRATION OFF phases"
    362362      ingain="-gain gain_${dateSelected}_${srclower}.fits"
    363       freqfilter=""
     363      freqfilter="-freqfilter -"
    364364      nwinmean="1"
    365365      tspwin="1024"
  • BAORadio/AmasNancay/trunk/statuscalib.sh

    r579 r595  
    8686           done
    8787        else
    88             $ECHO "${sourceDate} : No Calibration done for Off Diectory"
     88            $ECHO "${sourceDate} : No Calibration done for Off Directory"
    8989        fi
    9090#end of Off exist
    9191    else
    92         $ECHO "${sourceDate} : No Off Diectory"
     92        $ECHO "${sourceDate} : No Off Directory"
    9393    fi
    9494#
     
    120120           done
    121121        else
    122             $ECHO "${sourceDate} : No Calibration done for On Diectory"
     122            $ECHO "${sourceDate} : No Calibration done for On Directory"
    123123        fi
    124124#end of On exist
    125125    else
    126         $ECHO "${sourceDate} : No On Diectory"
     126        $ECHO "${sourceDate} : No On Directory"
    127127    fi
    128128#end of loop on dates
  • BAORadio/AmasNancay/trunk/submit2ge-anarawonoffmaker.sh

    r580 r595  
    2020      -h)
    2121        echo >&2 \
    22             "usage: $0 -src souce -date YYYYMMDD [-freq freq in MHz (default ${freqBAOCalib})] [-sim to trig simulation mode]"
     22            "usage: $0 -src source -date YYYYMMDD [-freq freq in MHz (default ${freqBAOCalib})] [-sim to trig simulation mode]"
    2323        exit 1;;
    2424        *)  break;;     # terminate while loop
  • BAORadio/AmasNancay/trunk/submit2ge-procspecmfib.sh

    r580 r595  
    5252        -h)
    5353        echo >&2 \
    54             "usage: $0 -src souce -date YYYYMMDD -type type [-fcycle firstCycle] [-lcycle lastCycle] [-sim to trig simulation mode]"
     54            "usage: $0 -src source -date YYYYMMDD -type type [-fcycle firstCycle] [-lcycle lastCycle] [-sim to trig simulation mode]"
    5555        exit 1;;
    5656        *)  break;;     # terminate while loop
Note: See TracChangeset for help on using the changeset viewer.