Changeset 595 for BAORadio/AmasNancay/trunk
- Timestamp:
- Nov 7, 2011, 10:47:08 AM (13 years ago)
- Location:
- BAORadio/AmasNancay/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
BAORadio/AmasNancay/trunk/analyse.cc
r593 r595 52 52 //---------------------------------------------------------- 53 53 //Utility fonctions 54 class 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 }; 60 template<class RandAccessIter> 61 double 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 54 81 // Function for deleting pointers in map. 55 82 template<class A, class B> … … 789 816 //Process to get sucessively 790 817 //Raw Spectra, 791 //The p ocesses are separated to allow intermediate save of results818 //The processes are separated to allow intermediate save of results 792 819 793 820 map< pair<string, sa_size_t>, TMatrix<r_4> > spectreCollect; … … 884 911 if(nCycles>0) diffMeanOnOff/=nCycles; 885 912 886 //ex ctract channels and do the mean913 //extract channels and do the mean 887 914 TVector<r_4> meanOfChan(NUMBER_OF_FREQ); //implicitly init to 0 888 915 for (sa_size_t iCh=0; iCh<NUMBER_OF_CHANNELS; ++iCh) { … … 935 962 MeanSigma(reducedRow,mean,sigma); 936 963 if (debuglev_>9) { 937 cout << "mean/sig na " << mean << "/" << sigma << endl;964 cout << "mean/sigma " << mean << "/" << sigma << endl; 938 965 } 939 966 reducedMeanDiffOnOff(iCh,iSlice) = mean; … … 1712 1739 for (int i=0;i<2;i++) { 1713 1740 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()); 1718 1746 nval++; 1719 1747 } -
BAORadio/AmasNancay/trunk/anarawonoffmaker.sh
r579 r595 253 253 $RM -f ${tmppublicpath}/getscafiles.finished 254 254 ${scriptpath}/getscafiles.sh ${sourceRadio} ${dateDAQ} > ${OUT1} 2>&1 255 while [ ! -f "${tmppublicpath}/getscafiles.finished" ]; do256 $ECHO "INFO (${scriptName}): waiting for ${tmppublicpath}/getscafiles.finished"257 date +%T258 sleep 30259 done255 # while [ ! -f "${tmppublicpath}/getscafiles.finished" ]; do 256 # $ECHO "INFO (${scriptName}): waiting for ${tmppublicpath}/getscafiles.finished" 257 # date +%T 258 # sleep 30 259 # done 260 260 $RM ${tmppublicpath}/getscafiles.finished 261 261 $ECHO "DEBUG (${scriptName}): END" -
BAORadio/AmasNancay/trunk/etude_gain.pic
r547 r595 1 set toppath "/sps/baoradio/AmasNancay/JEC" 1 set user "AST" 2 set toppath "/sps/baoradio/AmasNancay/${user}" 2 3 set source "Abell85" 3 4 set srclower "abell85" 4 set date "20110507" 5 set date "20110812" 6 set saveplot "1" 5 7 6 8 #################################################### … … 18 20 settitle "Gain $source ${date} Ch 0 (blue) Ch 1 (red)" 19 21 setaxelabels "Freq. (MHz)" "I (a.u)" 22 if ( $saveplot == "1" ) then 23 echo "saving plot" 24 w2eps ${toppath}/${source}/eps/gain/gain_${date}_${srclower}.eps 25 endif 20 26 21 27 #################################################### … … 24 30 newwin 1 1 25 31 graphicatt "xylimits=0,25,0,0.006" 32 del gainmoni gainmoni0 gainmoni1 26 33 27 34 openppf ${toppath}/${source}/${date}${srclower}/gain_monitor_${date}_${srclower}.ppf 28 35 #attention les "monitor" ont ete utilise a une epoque ou il n'y avait pas de 29 36 #reordering... 30 plot2d monitor n val n>0 "black cpts nsta notit" 37 ls 38 #plot2d monitor n val n>0 "black cpts nsta notit" 31 39 plot2d gainmoni n val n>0 "black cpts nsta notit" 32 40 plot2d gainmoni0 n val n>0 "same blue cpts nsta notit" 33 41 plot2d gainmoni1 n val n>0 "same red cpts nsta notit" 42 settitle "Gain monitor $source ${date} Ch 0 (blue) Ch 1 (red)" 43 if ( $saveplot == "1" ) then 44 # w2eps ${toppath}/${source}/eps/gain/gain_monitor_${date}_${srclower}.eps 45 endif 46 47 del g0 g1 gainmoni gainmoni0 gainmoni1 48 del gain_${date}_${srclower} 49 ls -
BAORadio/AmasNancay/trunk/makefile
r559 r595 7 7 PKGOLIST = 8 8 9 EXELIST = $(EXE)analyse $(EXE)mergeAnaFiles 9 EXELIST = $(EXE)analyse $(EXE)mergeAnaFiles $(EXE)anaTools 10 10 11 EXEOLIST = $(EXE)analyse.o $(EXE)mergeAnaFiles.o 11 EXEOLIST = $(EXE)analyse.o $(EXE)mergeAnaFiles.o $(EXE)anaTools.o 12 12 13 13 14 all : analyse mergeAnaFiles 14 all : analyse mergeAnaFiles anaTools 15 15 16 16 clean : … … 37 37 $(OBJ)mergeAnaFiles.o : mergeAnaFiles.cc 38 38 $(CXXCOMPILE) -c -o $(OBJ)mergeAnaFiles.o mergeAnaFiles.cc 39 39 40 anaTools : $(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 90 90 "The median of an empty list is undefined."; 91 91 } 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 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 } 111 111 112 112 //------------- -
BAORadio/AmasNancay/trunk/proc_specmfib.sh
r594 r595 347 347 $ECHO "process signal files for CALIBRATION ON phases" 348 348 ingain="-gain gain_${dateSelected}_${srclower}.fits" 349 freqfilter=" "349 freqfilter="-freqfilter -" 350 350 nwinmean="1" 351 351 tspwin="1024" … … 361 361 $ECHO "process signal files for CALIBRATION OFF phases" 362 362 ingain="-gain gain_${dateSelected}_${srclower}.fits" 363 freqfilter=" "363 freqfilter="-freqfilter -" 364 364 nwinmean="1" 365 365 tspwin="1024" -
BAORadio/AmasNancay/trunk/statuscalib.sh
r579 r595 86 86 done 87 87 else 88 $ECHO "${sourceDate} : No Calibration done for Off Di ectory"88 $ECHO "${sourceDate} : No Calibration done for Off Directory" 89 89 fi 90 90 #end of Off exist 91 91 else 92 $ECHO "${sourceDate} : No Off Di ectory"92 $ECHO "${sourceDate} : No Off Directory" 93 93 fi 94 94 # … … 120 120 done 121 121 else 122 $ECHO "${sourceDate} : No Calibration done for On Di ectory"122 $ECHO "${sourceDate} : No Calibration done for On Directory" 123 123 fi 124 124 #end of On exist 125 125 else 126 $ECHO "${sourceDate} : No On Di ectory"126 $ECHO "${sourceDate} : No On Directory" 127 127 fi 128 128 #end of loop on dates -
BAORadio/AmasNancay/trunk/submit2ge-anarawonoffmaker.sh
r580 r595 20 20 -h) 21 21 echo >&2 \ 22 "usage: $0 -src sou ce -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]" 23 23 exit 1;; 24 24 *) break;; # terminate while loop -
BAORadio/AmasNancay/trunk/submit2ge-procspecmfib.sh
r580 r595 52 52 -h) 53 53 echo >&2 \ 54 "usage: $0 -src sou ce -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]" 55 55 exit 1;; 56 56 *) break;; # terminate while loop
Note: See TracChangeset
for help on using the changeset viewer.