Index: ORadio/AmasNancay/etude_data.pic
===================================================================
--- /BAORadio/AmasNancay/etude_data.pic	(revision 548)
+++ 	(revision )
@@ -1,227 +1,0 @@
-echo ".... execute ON"
-exec analdata 20110416abell85 151300 On datacycle 1
-echo ".... execute OFF"
-exec analdata 20110416abell85 151300 Off datacycle 1
-
-echo ".... execute Merging"
-
-c++compile offset
-
-
-#
-#follow cycle to cycle variation of calibration coeff
-#
-vecfrascii calibOnCh0   20110416abell85-On-1346MHz-Ch0Cycles.txt
-vecfrascii calibOnCh1   20110416abell85-On-1346MHz-Ch1Cycles.txt
-vecfrascii calibOffCh0  20110416abell85-Off-1346MHz-Ch0Cycles.txt
-vecfrascii calibOffCh1  20110416abell85-Off-1346MHz-Ch1Cycles.txt
-
-del diff0
-del diff1
-
-set ncount 0
-set first 1
-
-for ic ${firstcycle}:${ncycles}
-  echo "...... cycle $ic"
-  ncount = $ncount + 1
-  k = ${ic} -1
-  del diffcycle${ic}v0 diffcycle${ic}v1
-  if ( $first == 1 ) then
-     set first 0
-     c++exec \
-        TVector<r_4> sigcalOnv0(sumc${ic}mOnv0,false); sigcalOnv0/=calibOnCh0[$k]; \
-        TVector<r_4> sigcalOnv1(sumc${ic}mOnv1,false); sigcalOnv1/=calibOnCh1[$k]; \
-        TVector<r_4> sigcalOffv0(sumc${ic}mOffv0,false); sigcalOffv0/=calibOffCh0[$k]; \
-        TVector<r_4> sigcalOffv1(sumc${ic}mOffv1,false); sigcalOffv1/=calibOffCh1[$k]; \
-        TVector<r_4> diffcycle${ic}v0 = sigcalOnv0-sigcalOffv0; \
-        TVector<r_4> diffcycle${ic}v1 = sigcalOnv1-sigcalOffv1; \
-	TVector<r_4> diff0(diffcycle${ic}v0,false); \
-	TVector<r_4> diff1(diffcycle${ic}v1,false); \
-        KeepObj(diff0);KeepObj(diff1); \
-	KeepObj(diffcycle${ic}v0); KeepObj(diffcycle${ic}v1);
-  else
-     c++exec \
-        TVector<r_4> sigcalOnv0(sumc${ic}mOnv0,false); sigcalOnv0/=calibOnCh0[$k]; \
-        TVector<r_4> sigcalOnv1(sumc${ic}mOnv1,false); sigcalOnv1/=calibOnCh1[$k]; \
-        TVector<r_4> sigcalOffv0(sumc${ic}mOffv0,false); sigcalOffv0/=calibOffCh0[$k]; \
-        TVector<r_4> sigcalOffv1(sumc${ic}mOffv1,false); sigcalOffv1/=calibOffCh1[$k]; \
-        TVector<r_4> diffcycle${ic}v0 = sigcalOnv0-sigcalOffv0; \
-        TVector<r_4> diffcycle${ic}v1 = sigcalOnv1-sigcalOffv1; \
-	diff0+=diffcycle${ic}v0; \
-	diff1+=diffcycle${ic}v1; \
-	KeepObj(diffcycle${ic}v0); KeepObj(diffcycle${ic}v1);
-  endif
-end
-
-
-newvec nmean 1 $ncount nodisp
-#coef RT @ 1346MHz Ouest - Est associees a Ch 0 et 1
-set xcal ( 27.724 22.543 )
-line2vec calib $xcal
-del difftot
-c++exec diff0/=nmean[0]; diff1/=nmean[0]; \
-        diff0*=calib[0];diff1*=calib[1]; \
-        TVector<r_4> difftot(diff0,false);difftot+=diff1;difftot/=2.; \
-        KeepObj(difftot);
-
-
-#
-#Calibrate and Offset Correction
-#
-for ic ${firstcycle}:${ncycles}
-  c++exec diffcycle${ic}v0*=calib[0];diffcycle${ic}v1*=calib[1]; 
-end
-
-del modiff0 moddiff1
-set first 1
-for ic ${firstcycle}:${ncycles}
-  echo "modif ...... cycle $ic"
-  
-  del inarr outarr  modiffc${ic}v0
-  cp  diffcycle${ic}v0 inarr
-  c++link offset.so meanoffset
-  call meanoffset 1285 1335 1355 1450
-  cp outarr modiffc${ic}v0
-
-  del inarr outarr modiffc${ic}v1
-  cp  diffcycle${ic}v1 inarr
-  c++link offset.so meanoffset
-  call meanoffset 1285 1335 1355 1450
-  cp outarr modiffc${ic}v1
-
-  if ( $first == 1 ) then
-     set first 0
-     c++exec \ 
-       TVector<r_4> modiff0(modiffc${ic}v0,false); \ 
-       TVector<r_4> modiff1(modiffc${ic}v1,false); \ 
-       KeepObj(modiff0);KeepObj(modiff1);
-  else
-     c++exec modiff0+=modiffc${ic}v0;  modiff1+=modiffc${ic}v1;
-  endif
-end  
-
-
-newwin 1 1
-setaxesatt $defatt
-graphicatt "$defatt xylimits=1250,1500,-1.,1."
-set first 1
-for ic ${firstcycle}:${ncycles}
-  echo "...... cycle $ic"
-  k = ${ic}-floor(${ic}/${#cols})*${#cols}
-  if ( $first == 1 ) then
-     set first 0
-     plot2d  diffcycle${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
-  else
-     plot2d  diffcycle${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
-  endif
-end
-settitle "Diff. On-Off No Corr. $source Ch 0 cycles [$firstcycle,$lastcycle]"
-setaxelabels "Freq. (MHz)" "I (Jy)"
-
-
-newwin 1 1
-setaxesatt $defatt
-graphicatt "$defatt xylimits=1250,1500,-1.,1."
-set first 1
-for ic ${firstcycle}:${ncycles}
-  echo "...... cycle $ic"
-  k = ${ic}-floor(${ic}/${#cols})*${#cols}
-  if ( $first == 1 ) then
-     set first 0
-     plot2d  diffcycle${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
-  else
-     plot2d  diffcycle${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
-  endif
-end
-settitle "Diff. On-Off No Corr. $source Ch 1 cycles [$firstcycle,$lastcycle]"
-setaxelabels "Freq. (MHz)" "I (Jy)"
-
-
-newwin 1 1
-setaxesatt $defatt
-graphicatt "$defatt xylimits=1250,1500,-50.,50."
-plot2d diff0  (n/8192)*250+1250 val*1000 n>0 "blue cpts nsta notit"
-plot2d diff1  (n/8192)*250+1250 val*1000 n>0 "red same cpts nsta notit"
-plot2d difftot  (n/8192)*250+1250 val*1000 n>0 "black same cpts nsta notit"
-settitle "Mean diff calib No Corr. per cycle ON-OFF Int.  $source cycles [$firstcycle,$lastcycle]"
-setaxelabels "Freq. (MHz)" "Int. (mJy)"
-
-newwin 1 1
-graphicatt "$defatt"
-n/plot difftot.val*1000 n>1090&&n<4000 ! ! "black  notit"
-n/plot diff0.val*1000 n>1090&&n<4000 ! ! "blue same notit"
-n/plot diff1.val*1000 n>1090&&n<4000 ! ! "red same notit"
-settitle "Diff ON-OFF No Corr. $source [$firstcycle,$lastcycle] 1280MHz - 1370MHz"
-setaxelabels "mJy" " "
-
-
-
-newwin 1 1
-setaxesatt $defatt
-graphicatt "$defatt xylimits=1250,1500,-1.,1."
-set first 1
-for ic ${firstcycle}:${ncycles}
-  echo "...... cycle $ic"
-  k = ${ic}-floor(${ic}/${#cols})*${#cols}
-  if ( $first == 1 ) then
-     set first 0
-     plot2d  modiffc${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
-  else
-     plot2d  modiffc${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
-  endif
-end
-settitle "Diff. On-Off With Corr. $source Ch 0 cycles [$firstcycle,$lastcycle]"
-setaxelabels "Freq. (MHz)" "I (Jy)"
-
-newwin 1 1
-setaxesatt $defatt
-graphicatt "$defatt xylimits=1250,1500,-1.,1."
-set first 1
-for ic ${firstcycle}:${ncycles}
-  echo "...... cycle $ic"
-  k = ${ic}-floor(${ic}/${#cols})*${#cols}
-  if ( $first == 1 ) then
-     set first 0
-     plot2d  modiffc${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
-  else
-     plot2d  modiffc${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
-  endif
-end
-settitle "Diff. On-Off With Corr. $source Ch 1 cycles [$firstcycle,$lastcycle]"
-setaxelabels "Freq. (MHz)" "I (Jy)"
-
-
-
-
-  
-del modifftot
-c++exec modiff0/=nmean[0]; modiff1/=nmean[0]; \
-        TVector<r_4> modifftot(modiff0,false);modifftot+=modiff1;modifftot/=2.; \
-        KeepObj(modifftot);
-
-newwin 1 1
-setaxesatt $defatt"
-graphicatt "$defatt xylimits=1250,1500,-50.,50."
-plot2d modiff0  (n/8192)*250+1250 val*1000 n>0 "blue cpts nsta notit"
-plot2d modiff1  (n/8192)*250+1250 val*1000 n>0 "red same cpts nsta notit"
-plot2d modifftot  (n/8192)*250+1250 val*1000 n>0 "black same cpts nsta notit"
-settitle "Mean diff ON-OFF With Corr.  $source cycles [$firstcycle,$lastcycle]"
-setaxelabels "Freq. (MHz)" "Int. (mJy)"
-
-newwin 1 1
-graphicatt "$defatt"
-n/plot modifftot.val*1000 n>1090&&n<4000 ! ! "black  notit"
-n/plot modiff0.val*1000 n>1090&&n<4000 ! ! "blue same notit"
-n/plot modiff1.val*1000 n>1090&&n<4000 ! ! "red same notit"
-settitle "Diff ON-OFF With Corr. $source [$firstcycle,$lastcycle] 1280MHz - 1370MHz"
-setaxelabels "mJy" " "
-
-
-newwin 1 1
-setaxesatt $defatt"
-graphicatt "$defatt xylimits=1250,1500,-50.,50."
-plot2d difftot  (n/8192)*250+1250 val*1000 n>0 "blue  cpts nsta notit"
-plot2d modifftot  (n/8192)*250+1250 val*1000 n>0 "red same  cpts nsta notit"
-settitle "Mean diff ON-OFF NO Corr (blue) With Corr (red)  $source cycles [$firstcycle,$lastcycle]"
-setaxelabels "Freq. (MHz)" "Int. (mJy)"
Index: ORadio/AmasNancay/statuscalib.sh
===================================================================
--- /BAORadio/AmasNancay/statuscalib.sh	(revision 548)
+++ 	(revision )
@@ -1,138 +1,0 @@
-#!/bin/sh
-#Status de l'etat de la production des fichiers INPUT de calibrations
-GREP=/bin/grep
-AWK=/bin/awk
-ECHO=/bin/echo
-MKDIR=/bin/mkdir
-CAT=/bin/cat
-PRINTF=/usr/bin/printf
-RM=/bin/rm
-SORT=/bin/sort
-XARGS=/usr/bin/xargs
-WC=/usr/bin/wc
-DefaultIFS=$' \t\n'
-IFS=$DefaultIFS
-
-# Irods environment settings
-. /usr/local/shared/bin/irods_env.sh -noverbose
-
-scriptName="`basename $0`"
-$ECHO "Processing script ${scriptName} at `date`"
-
-#Path to public backupable path
-publicpath="/afs/in2p3.fr/home/c/campagne/public"
-
-#Path where the job will do temporary IO
-if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} == "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
-cd ${iojobpath}
-
-
-OUT1=./baoils.$$
-ils /baoradio/data/AmasNancay/ > ${OUT1}
-OUT2=./baoawk1.$$
-$AWK '($1=="C-") {print $2}' ${OUT1} > ${OUT2}
-$RM $OUT1
-#Sequence 
-listeSources=( `$CAT $OUT2 | $AWK '{print $1}'` )
-IFS='
-'
-listeSources=( $( $PRINTF "%s\n" "${listeSources[@]}" | $AWK 'x[$0]++ == 0' ) )
-IFS=$DefaultIFS
-$RM $OUT2
-
-for i in ${listeSources[@]}
-do
-#nb: $i contains the full path
-  $ECHO "source ${i}"
-  sourceName=`basename ${i}`
-  listeDates=( `ils $i | $AWK '($1=="C-"){print $2}'`)
-  IFS='
-'
-  listeDates=( $( $PRINTF "%s\n" "${listeDates[@]}" | $AWK 'x[$0]++ == 0' ) )
-  IFS=$DefaultIFS
-
-  for j in ${listeDates[@]}
-  do
-#nb: $j contains the full path
-#  $ECHO "run ${j}"
-#
-#Off directory
-#
-    dateField=`basename ${j}`
-    sourceDate="${sourceName}-${dateField}"
-#look if final calibration files exist
-    calibOk=`ils ${j} | $GREP -i "calib_" | $WC -l`
-
-    offDirExist=`ils ${j} | $GREP -i "Off" | $WC -l`
-    if [ ${offDirExist} != 0 ]; then
-	listeCyclesOff=( `ils ${j}/Off | $GREP -i "calibcycle" | $AWK '($1=="C-"){print $2}' | $XARGS -i basename {} | $SORT -k1.11n` )
-	IFS='
-  '
-	listeCyclesOff=( $( $PRINTF "%s\n" "${listeCyclesOff[@]}" | $AWK 'x[$0]++ == 0' ) )
-	IFS=$DefaultIFS
-	
-	if [ ${#listeCyclesOff[*]} != 0 ]; then    
-           for c in ${listeCyclesOff[@]}
-	   do
-#nb: $c has the format of calibcycle<number>
-	     nFiles=`ils ${j}/Off/${c} | $GREP -i "medfiltmtx" | $WC -l`
-	     if [ ${nFiles} != 0 ]; then
-		 $ECHO "${sourceDate}/Off/${c}: ${nFiles} spectra (${calibOk} calib)"
-	     else
-		 $ECHO "${sourceDate}/Off/${c}: Calibration failed"
-	     fi
-#end of loop on cycles 
-	   done
-	else
-	    $ECHO "${sourceDate} : No Calibration done for Off Diectory"
-	fi
-#end of Off exist
-    else
-	$ECHO "${sourceDate} : No Off Diectory"
-    fi
-#
-#On directory
-#
-    dateField=`basename ${j}`
-    sourceDate="${sourceName}-${dateField}"
-#look if final calibration files exist
-    calibOk=`ils ${j} | $GREP -i "calib_" | $WC -l`
-    onDirExist=`ils ${j} | $GREP -i "On" | $WC -l`
-    if [ ${onDirExist} != 0 ]; then
-	listeCyclesOn=( `ils ${j}/On | $GREP -i "calibcycle" | $AWK '($1=="C-"){print $2}' | $XARGS -i basename {} | $SORT -k1.11n` )
-	IFS='
-  '
-	listeCyclesOn=( $( $PRINTF "%s\n" "${listeCyclesOn[@]}" | $AWK 'x[$0]++ == 0' ) )
-	IFS=$DefaultIFS
-	
-	if [ ${#listeCyclesOn[*]} != 0 ]; then    
-           for c in ${listeCyclesOn[@]}
-	   do
-#nb: $c has the format of calibcycle<number>
-	     nFiles=`ils ${j}/On/${c} | $GREP -i "medfiltmtx" | $WC -l`
-	     if [ ${nFiles} != 0 ]; then
-		 $ECHO "${sourceDate}/On/${c}: ${nFiles} spectra (${calibOk} calib)"
-	     else
-		 $ECHO "${sourceDate}/On/${c}: Calibration failed"
-	     fi
-#end of loop on cycles 
-	   done
-	else
-	    $ECHO "${sourceDate} : No Calibration done for On Diectory"
-	fi
-#end of On exist
-    else
-	$ECHO "${sourceDate} : No On Diectory"
-    fi
-#end of loop on dates
-  done 
-#end of loop on sources
-done
Index: ORadio/AmasNancay/statusgain.sh
===================================================================
--- /BAORadio/AmasNancay/statusgain.sh	(revision 548)
+++ 	(revision )
@@ -1,70 +1,0 @@
-#!/bin/sh
-#liste des "sources" enregistrees sous Amas
-GREP=/bin/grep
-AWK=/bin/awk
-ECHO=/bin/echo
-MKDIR=/bin/mkdir
-CAT=/bin/cat
-PRINTF=/usr/bin/printf
-RM=/bin/rm
-SORT=/bin/sort
-XARGS=/usr/bin/xargs
-WC=/usr/bin/wc
-DefaultIFS=$' \t\n'
-IFS=$DefaultIFS
-
-# Irods environment settings
-. /usr/local/shared/bin/irods_env.sh -noverbose
-
-scriptName="`basename $0`"
-$ECHO "Processing script ${scriptName} at `date`"
-
-#Path to public backupable path
-publicpath="/afs/in2p3.fr/home/c/campagne/public"
-
-#Path where the job will do temporary IO
-if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} == "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
-cd ${iojobpath}
-
-
-OUT1=./baoils.$$
-ils /baoradio/data/AmasNancay/ > ${OUT1}
-OUT2=./baoawk1.$$
-$AWK '($1=="C-") {print $2}' ${OUT1} > ${OUT2}
-$RM $OUT1
-#Sequence 
-tableau=( `$CAT $OUT2 | $AWK '{print $1}'` )
-IFS='
-'
-tableau=( $( $PRINTF "%s\n" "${tableau[@]}" | $AWK 'x[$0]++ == 0' ) )
-IFS=$DefaultIFS
-
-$RM $OUT2
-
-for i in ${tableau[@]}
-do
-  $ECHO "source $i"
-  listedate=( `ils $i | $AWK '($1=="C-"){print $2}'`)
-  IFS='
-'
-  listedate=( $( $PRINTF "%s\n" "${listedate[@]}" | $AWK 'x[$0]++ == 0' ) )
-  IFS=$DefaultIFS
-
-  for j in ${listedate[@]}
-  do
-    gainOk=`ils ${j} | $GREP -i "gain_" | $WC -l`
-    if [ ${gainOk} -gt 0 ]; then
-	$ECHO ">>> $j ---> GAIN Done (${gainOk})"
-    else
-	$ECHO ">>> $j ---> GAIN To be computed"
-    fi
-  done 
-done
Index: ORadio/AmasNancay/statusheader.sh
===================================================================
--- /BAORadio/AmasNancay/statusheader.sh	(revision 548)
+++ 	(revision )
@@ -1,94 +1,0 @@
-#!/bin/sh
-#liste des "sources" enregistrees sous Amas
-GREP=/bin/grep
-AWK=/bin/awk
-ECHO=/bin/echo
-MKDIR=/bin/mkdir
-CAT=/bin/cat
-PRINTF=/usr/bin/printf
-RM=/bin/rm
-SORT=/bin/sort
-XARGS=/usr/bin/xargs
-WC=/usr/bin/wc
-DefaultIFS=$' \t\n'
-IFS=$DefaultIFS
-
-# Irods environment settings
-. /usr/local/shared/bin/irods_env.sh -noverbose
-
-scriptName="`basename $0`"
-$ECHO "Processing script ${scriptName} at `date`"
-
-#Path to public backupable path
-publicpath="/afs/in2p3.fr/home/c/campagne/public"
-
-#Path where the job will do temporary IO
-if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} == "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
-cd ${iojobpath}
-
-
-OUT1=./baoils.$$
-ils /baoradio/data/AmasNancay/ > ${OUT1}
-OUT2=./baoawk1.$$
-$AWK '($1=="C-") {print $2}' ${OUT1} > ${OUT2}
-$RM $OUT1
-#Sequence 
-tableau=( `$CAT $OUT2 | $AWK '{print $1}'` )
-IFS='
-'
-tableau=( $( $PRINTF "%s\n" "${tableau[@]}" | $AWK 'x[$0]++ == 0' ) )
-IFS=$DefaultIFS
-
-$RM $OUT2
-
-for i in ${tableau[@]}
-do
-  $ECHO "source $i"
-  listedate=( `ils $i | $AWK '($1=="C-"){print $2}'`)
-  IFS='
-'
-  listedate=( $( $PRINTF "%s\n" "${listedate[@]}" | $AWK 'x[$0]++ == 0' ) )
-
-  ntotfiles=0
-  for j in ${listedate[@]}
-  do
-#Fiber 1
-    listOfsig1=( `ils ${j}/Fiber1 | $GREP -i "signal" | $XARGS -i basename {} | $SORT -k1.7n` )
-    IFS='
-  '
-    listOfsig1=( $( $PRINTF "%s\n" "${listOfsig1[@]}" | $AWK 'x[$0]++ == 0' ) )
-    nblinesSIG1=${#listOfsig1[@]}
-    listOfhdr1=( `ils ${j}/Fiber1 | $GREP -i "header" | $XARGS -i basename {} | $SORT -k1.7n` )
-    IFS='
-    '
-    listOfhdr1=( $( $PRINTF "%s\n" "${listOfhdr1[@]}" | $AWK 'x[$0]++ == 0' ) )
-    nblinesHDR1=${#listOfhdr1[@]}
-
-#Fiber 2
-    listOfsig2=( `ils ${j}/Fiber2 | $GREP -i "signal" | $XARGS -i basename {} | $SORT -k1.7n` )
-    IFS='
-  '
-    listOfsig2=( $( $PRINTF "%s\n" "${listOfsig2[@]}" | $AWK 'x[$0]++ == 0' ) )
-    nblinesSIG2=${#listOfsig2[@]}
-    listOfhdr2=( `ils ${j}/Fiber2 | $GREP -i "header" | $XARGS -i basename {} | $SORT -k1.7n` )
-    IFS='
-    '
-    listOfhdr2=( $( $PRINTF "%s\n" "${listOfhdr2[@]}" | $AWK 'x[$0]++ == 0' ) )
-    nblinesHDR2=${#listOfhdr2[@]}
-
-
-
-    $ECHO ">>> $j --->  Fib1: $nblinesHDR1 / $nblinesSIG1 Fib2: $nblinesHDR2 / $nblinesSIG2"
-    let "ntotfiles=ntotfiles+$nblinesSIG1"
-  done 
-  $ECHO "total signal Fiber1 files = $ntotfiles"
-
-done
Index: ORadio/AmasNancay/submit2bqs-calibmaker.sh
===================================================================
--- /BAORadio/AmasNancay/submit2bqs-calibmaker.sh	(revision 548)
+++ 	(revision )
@@ -1,43 +1,0 @@
-#!/bin/sh -xv
-
-scriptName="`basename $0`"
-echo "Processing script ${scriptName} at `date`"
-
-#Process cmd line args: the -src option is mandatory (source name as Abell85)
-sourceRadio
-freqBAOCalib=
-bwBAOCalib=
-#use -sim option to simulate processing (debug the script as if...)
-simulationMode=""
-while [ $# -gt 0 ]
-do
-  case "$1" in
-      -src)  sourceRadio="$2"; shift;;
-      -freq) freqBAOCalib="-freq $2"; shift;;
-      -bwd)  bwBAOCalib="-bwd $2"; shift;;
-      -sim) 
-      simulationMode="-sim On"
-      $ECHO "INFO ${scriptName} running in SIMUL mode";;
-	-h)
-	echo >&2 \
-	    "usage: $0 -src souce [-freq freq in MHz (default ${freqBAOCalib})] [-bwd bandwidth in MHz (default ${bwBAOCalib})]"
-	exit 1;;
-	*)  break;;	# terminate while loop
-    esac
-    shift
-done
-
-
-if [ "<${sourceRadio}>" = "<>" ]; then
-    $ECHO "FATAL: You have forgotten to select the source option (-src)"
-    exit 1
-fi
-
-
-jobBatchName="calibs-${sourceRadio}"
-
-jobLogName="${jobBatchName}.log.$$"
-
-qsub -l u_sps_baoradio,u_irods,T=120000,M=1000MB,scratch=1000MB,platform=LINUX -eo -o $jobLogName -N $jobBatchName -mb -me -mu campagne@lal.in2p3.fr <<EOF
-/afs/in2p3.fr/home/c/campagne/private/work/AmasNancay/calibmaker.sh  -src ${sourceRadio} ${freqBAOCalib} ${bwBAOCalib} ${simulationMode}
-EOF
Index: ORadio/AmasNancay/submit2bqs-gainmaker.sh
===================================================================
--- /BAORadio/AmasNancay/submit2bqs-gainmaker.sh	(revision 548)
+++ 	(revision )
@@ -1,26 +1,0 @@
-#!/bin/sh -xv
-
-#Process cmd line args: the -src option is mandatory (source name as Abell85)
-sourceRadio=
-#use -sim option to simulate processing (debug the script as if...)
-simulationMode=""
-while [ $# -gt 0 ]
-do
-  case "$1" in
-      -src)  sourceRadio=$2; shift;;
-      -sim) simulationMode="-sim";;
-	-h)
-	    echo >&2 \
-	    "usage: $0 -src souce [-sim]"
-	    exit 1;;
-	*)  break;;	# terminate while loop
-    esac
-    shift
-done
-
-jobBatchName="gains-$sourceRadio"
-jobLogName="${jobBatchName}.log.$$"
-
-qsub -l u_sps_baoradio,u_irods,T=120000,M=1000MB,scratch=500MB,platform=LINUX -eo -o $jobLogName -N $jobBatchName -mb -me -mu campagne@lal.in2p3.fr <<EOF
-/afs/in2p3.fr/home/c/campagne/private/work/AmasNancay/gainmaker.sh  -src ${sourceRadio} ${simulationMode}
-EOF
Index: ORadio/AmasNancay/submit2bqs-hdrfitsextractor.sh
===================================================================
--- /BAORadio/AmasNancay/submit2bqs-hdrfitsextractor.sh	(revision 548)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#!/bin/sh
-
-#Process cmd line args: the -src option is mandatory (source name as Abell85)
-sourceRadio=
-while [ $# -gt 0 ]
-do
-  case "$1" in
-      -src)  sourceRadio=$2; shift;;
-	-h)
-	    echo >&2 \
-	    "usage: $0 -src souce"
-	    exit 1;;
-	*)  break;;	# terminate while loop
-    esac
-    shift
-done
-
-jobBatchName="headerMaker-$sourceRadio"
-jobLogName="${jobBatchName}.log.$$"
-
-qsub -l u_sps_baoradio,u_irods,T=100000,M=256MB,scratch=700MB,platform=LINUX -eo -o $jobLogName -N $jobBatchName -mb -me -mu campagne@lal.in2p3.fr <<EOF
-/afs/in2p3.fr/home/c/campagne/private/work/AmasNancay/hdrfitsextractor.sh  $sourceRadio
-EOF
Index: /BAORadio/AmasNancay/trunk/etude_data.pic
===================================================================
--- /BAORadio/AmasNancay/trunk/etude_data.pic	(revision 549)
+++ /BAORadio/AmasNancay/trunk/etude_data.pic	(revision 549)
@@ -0,0 +1,227 @@
+echo ".... execute ON"
+exec analdata 20110416abell85 151300 On datacycle 1
+echo ".... execute OFF"
+exec analdata 20110416abell85 151300 Off datacycle 1
+
+echo ".... execute Merging"
+
+c++compile offset
+
+
+#
+#follow cycle to cycle variation of calibration coeff
+#
+vecfrascii calibOnCh0   20110416abell85-On-1346MHz-Ch0Cycles.txt
+vecfrascii calibOnCh1   20110416abell85-On-1346MHz-Ch1Cycles.txt
+vecfrascii calibOffCh0  20110416abell85-Off-1346MHz-Ch0Cycles.txt
+vecfrascii calibOffCh1  20110416abell85-Off-1346MHz-Ch1Cycles.txt
+
+del diff0
+del diff1
+
+set ncount 0
+set first 1
+
+for ic ${firstcycle}:${ncycles}
+  echo "...... cycle $ic"
+  ncount = $ncount + 1
+  k = ${ic} -1
+  del diffcycle${ic}v0 diffcycle${ic}v1
+  if ( $first == 1 ) then
+     set first 0
+     c++exec \
+        TVector<r_4> sigcalOnv0(sumc${ic}mOnv0,false); sigcalOnv0/=calibOnCh0[$k]; \
+        TVector<r_4> sigcalOnv1(sumc${ic}mOnv1,false); sigcalOnv1/=calibOnCh1[$k]; \
+        TVector<r_4> sigcalOffv0(sumc${ic}mOffv0,false); sigcalOffv0/=calibOffCh0[$k]; \
+        TVector<r_4> sigcalOffv1(sumc${ic}mOffv1,false); sigcalOffv1/=calibOffCh1[$k]; \
+        TVector<r_4> diffcycle${ic}v0 = sigcalOnv0-sigcalOffv0; \
+        TVector<r_4> diffcycle${ic}v1 = sigcalOnv1-sigcalOffv1; \
+	TVector<r_4> diff0(diffcycle${ic}v0,false); \
+	TVector<r_4> diff1(diffcycle${ic}v1,false); \
+        KeepObj(diff0);KeepObj(diff1); \
+	KeepObj(diffcycle${ic}v0); KeepObj(diffcycle${ic}v1);
+  else
+     c++exec \
+        TVector<r_4> sigcalOnv0(sumc${ic}mOnv0,false); sigcalOnv0/=calibOnCh0[$k]; \
+        TVector<r_4> sigcalOnv1(sumc${ic}mOnv1,false); sigcalOnv1/=calibOnCh1[$k]; \
+        TVector<r_4> sigcalOffv0(sumc${ic}mOffv0,false); sigcalOffv0/=calibOffCh0[$k]; \
+        TVector<r_4> sigcalOffv1(sumc${ic}mOffv1,false); sigcalOffv1/=calibOffCh1[$k]; \
+        TVector<r_4> diffcycle${ic}v0 = sigcalOnv0-sigcalOffv0; \
+        TVector<r_4> diffcycle${ic}v1 = sigcalOnv1-sigcalOffv1; \
+	diff0+=diffcycle${ic}v0; \
+	diff1+=diffcycle${ic}v1; \
+	KeepObj(diffcycle${ic}v0); KeepObj(diffcycle${ic}v1);
+  endif
+end
+
+
+newvec nmean 1 $ncount nodisp
+#coef RT @ 1346MHz Ouest - Est associees a Ch 0 et 1
+set xcal ( 27.724 22.543 )
+line2vec calib $xcal
+del difftot
+c++exec diff0/=nmean[0]; diff1/=nmean[0]; \
+        diff0*=calib[0];diff1*=calib[1]; \
+        TVector<r_4> difftot(diff0,false);difftot+=diff1;difftot/=2.; \
+        KeepObj(difftot);
+
+
+#
+#Calibrate and Offset Correction
+#
+for ic ${firstcycle}:${ncycles}
+  c++exec diffcycle${ic}v0*=calib[0];diffcycle${ic}v1*=calib[1]; 
+end
+
+del modiff0 moddiff1
+set first 1
+for ic ${firstcycle}:${ncycles}
+  echo "modif ...... cycle $ic"
+  
+  del inarr outarr  modiffc${ic}v0
+  cp  diffcycle${ic}v0 inarr
+  c++link offset.so meanoffset
+  call meanoffset 1285 1335 1355 1450
+  cp outarr modiffc${ic}v0
+
+  del inarr outarr modiffc${ic}v1
+  cp  diffcycle${ic}v1 inarr
+  c++link offset.so meanoffset
+  call meanoffset 1285 1335 1355 1450
+  cp outarr modiffc${ic}v1
+
+  if ( $first == 1 ) then
+     set first 0
+     c++exec \ 
+       TVector<r_4> modiff0(modiffc${ic}v0,false); \ 
+       TVector<r_4> modiff1(modiffc${ic}v1,false); \ 
+       KeepObj(modiff0);KeepObj(modiff1);
+  else
+     c++exec modiff0+=modiffc${ic}v0;  modiff1+=modiffc${ic}v1;
+  endif
+end  
+
+
+newwin 1 1
+setaxesatt $defatt
+graphicatt "$defatt xylimits=1250,1500,-1.,1."
+set first 1
+for ic ${firstcycle}:${ncycles}
+  echo "...... cycle $ic"
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}
+  if ( $first == 1 ) then
+     set first 0
+     plot2d  diffcycle${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+  else
+     plot2d  diffcycle${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+  endif
+end
+settitle "Diff. On-Off No Corr. $source Ch 0 cycles [$firstcycle,$lastcycle]"
+setaxelabels "Freq. (MHz)" "I (Jy)"
+
+
+newwin 1 1
+setaxesatt $defatt
+graphicatt "$defatt xylimits=1250,1500,-1.,1."
+set first 1
+for ic ${firstcycle}:${ncycles}
+  echo "...... cycle $ic"
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}
+  if ( $first == 1 ) then
+     set first 0
+     plot2d  diffcycle${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+  else
+     plot2d  diffcycle${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+  endif
+end
+settitle "Diff. On-Off No Corr. $source Ch 1 cycles [$firstcycle,$lastcycle]"
+setaxelabels "Freq. (MHz)" "I (Jy)"
+
+
+newwin 1 1
+setaxesatt $defatt
+graphicatt "$defatt xylimits=1250,1500,-50.,50."
+plot2d diff0  (n/8192)*250+1250 val*1000 n>0 "blue cpts nsta notit"
+plot2d diff1  (n/8192)*250+1250 val*1000 n>0 "red same cpts nsta notit"
+plot2d difftot  (n/8192)*250+1250 val*1000 n>0 "black same cpts nsta notit"
+settitle "Mean diff calib No Corr. per cycle ON-OFF Int.  $source cycles [$firstcycle,$lastcycle]"
+setaxelabels "Freq. (MHz)" "Int. (mJy)"
+
+newwin 1 1
+graphicatt "$defatt"
+n/plot difftot.val*1000 n>1090&&n<4000 ! ! "black  notit"
+n/plot diff0.val*1000 n>1090&&n<4000 ! ! "blue same notit"
+n/plot diff1.val*1000 n>1090&&n<4000 ! ! "red same notit"
+settitle "Diff ON-OFF No Corr. $source [$firstcycle,$lastcycle] 1280MHz - 1370MHz"
+setaxelabels "mJy" " "
+
+
+
+newwin 1 1
+setaxesatt $defatt
+graphicatt "$defatt xylimits=1250,1500,-1.,1."
+set first 1
+for ic ${firstcycle}:${ncycles}
+  echo "...... cycle $ic"
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}
+  if ( $first == 1 ) then
+     set first 0
+     plot2d  modiffc${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+  else
+     plot2d  modiffc${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+  endif
+end
+settitle "Diff. On-Off With Corr. $source Ch 0 cycles [$firstcycle,$lastcycle]"
+setaxelabels "Freq. (MHz)" "I (Jy)"
+
+newwin 1 1
+setaxesatt $defatt
+graphicatt "$defatt xylimits=1250,1500,-1.,1."
+set first 1
+for ic ${firstcycle}:${ncycles}
+  echo "...... cycle $ic"
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}
+  if ( $first == 1 ) then
+     set first 0
+     plot2d  modiffc${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+  else
+     plot2d  modiffc${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+  endif
+end
+settitle "Diff. On-Off With Corr. $source Ch 1 cycles [$firstcycle,$lastcycle]"
+setaxelabels "Freq. (MHz)" "I (Jy)"
+
+
+
+
+  
+del modifftot
+c++exec modiff0/=nmean[0]; modiff1/=nmean[0]; \
+        TVector<r_4> modifftot(modiff0,false);modifftot+=modiff1;modifftot/=2.; \
+        KeepObj(modifftot);
+
+newwin 1 1
+setaxesatt $defatt"
+graphicatt "$defatt xylimits=1250,1500,-50.,50."
+plot2d modiff0  (n/8192)*250+1250 val*1000 n>0 "blue cpts nsta notit"
+plot2d modiff1  (n/8192)*250+1250 val*1000 n>0 "red same cpts nsta notit"
+plot2d modifftot  (n/8192)*250+1250 val*1000 n>0 "black same cpts nsta notit"
+settitle "Mean diff ON-OFF With Corr.  $source cycles [$firstcycle,$lastcycle]"
+setaxelabels "Freq. (MHz)" "Int. (mJy)"
+
+newwin 1 1
+graphicatt "$defatt"
+n/plot modifftot.val*1000 n>1090&&n<4000 ! ! "black  notit"
+n/plot modiff0.val*1000 n>1090&&n<4000 ! ! "blue same notit"
+n/plot modiff1.val*1000 n>1090&&n<4000 ! ! "red same notit"
+settitle "Diff ON-OFF With Corr. $source [$firstcycle,$lastcycle] 1280MHz - 1370MHz"
+setaxelabels "mJy" " "
+
+
+newwin 1 1
+setaxesatt $defatt"
+graphicatt "$defatt xylimits=1250,1500,-50.,50."
+plot2d difftot  (n/8192)*250+1250 val*1000 n>0 "blue  cpts nsta notit"
+plot2d modifftot  (n/8192)*250+1250 val*1000 n>0 "red same  cpts nsta notit"
+settitle "Mean diff ON-OFF NO Corr (blue) With Corr (red)  $source cycles [$firstcycle,$lastcycle]"
+setaxelabels "Freq. (MHz)" "Int. (mJy)"
Index: /BAORadio/AmasNancay/trunk/statuscalib.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/statuscalib.sh	(revision 549)
+++ /BAORadio/AmasNancay/trunk/statuscalib.sh	(revision 549)
@@ -0,0 +1,138 @@
+#!/bin/sh
+#Status de l'etat de la production des fichiers INPUT de calibrations
+GREP=/bin/grep
+AWK=/bin/awk
+ECHO=/bin/echo
+MKDIR=/bin/mkdir
+CAT=/bin/cat
+PRINTF=/usr/bin/printf
+RM=/bin/rm
+SORT=/bin/sort
+XARGS=/usr/bin/xargs
+WC=/usr/bin/wc
+DefaultIFS=$' \t\n'
+IFS=$DefaultIFS
+
+# Irods environment settings
+. /usr/local/shared/bin/irods_env.sh -noverbose
+
+scriptName="`basename $0`"
+$ECHO "Processing script ${scriptName} at `date`"
+
+#Path to public backupable path
+publicpath="/afs/in2p3.fr/home/c/campagne/public"
+
+#Path where the job will do temporary IO
+if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
+    iojobpath="/sps/baoradio/AmasNancay/JEC"
+    $MKDIR -p $iojobpath
+elif [ ${ENVIRONMENT} == "BATCH" ] ; then
+    iojobpath=${TMPBATCH}
+else
+    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
+    exit 1
+fi
+cd ${iojobpath}
+
+
+OUT1=./baoils.$$
+ils /baoradio/data/AmasNancay/ > ${OUT1}
+OUT2=./baoawk1.$$
+$AWK '($1=="C-") {print $2}' ${OUT1} > ${OUT2}
+$RM $OUT1
+#Sequence 
+listeSources=( `$CAT $OUT2 | $AWK '{print $1}'` )
+IFS='
+'
+listeSources=( $( $PRINTF "%s\n" "${listeSources[@]}" | $AWK 'x[$0]++ == 0' ) )
+IFS=$DefaultIFS
+$RM $OUT2
+
+for i in ${listeSources[@]}
+do
+#nb: $i contains the full path
+  $ECHO "source ${i}"
+  sourceName=`basename ${i}`
+  listeDates=( `ils $i | $AWK '($1=="C-"){print $2}'`)
+  IFS='
+'
+  listeDates=( $( $PRINTF "%s\n" "${listeDates[@]}" | $AWK 'x[$0]++ == 0' ) )
+  IFS=$DefaultIFS
+
+  for j in ${listeDates[@]}
+  do
+#nb: $j contains the full path
+#  $ECHO "run ${j}"
+#
+#Off directory
+#
+    dateField=`basename ${j}`
+    sourceDate="${sourceName}-${dateField}"
+#look if final calibration files exist
+    calibOk=`ils ${j} | $GREP -i "calib_" | $WC -l`
+
+    offDirExist=`ils ${j} | $GREP -i "Off" | $WC -l`
+    if [ ${offDirExist} != 0 ]; then
+	listeCyclesOff=( `ils ${j}/Off | $GREP -i "calibcycle" | $AWK '($1=="C-"){print $2}' | $XARGS -i basename {} | $SORT -k1.11n` )
+	IFS='
+  '
+	listeCyclesOff=( $( $PRINTF "%s\n" "${listeCyclesOff[@]}" | $AWK 'x[$0]++ == 0' ) )
+	IFS=$DefaultIFS
+	
+	if [ ${#listeCyclesOff[*]} != 0 ]; then    
+           for c in ${listeCyclesOff[@]}
+	   do
+#nb: $c has the format of calibcycle<number>
+	     nFiles=`ils ${j}/Off/${c} | $GREP -i "medfiltmtx" | $WC -l`
+	     if [ ${nFiles} != 0 ]; then
+		 $ECHO "${sourceDate}/Off/${c}: ${nFiles} spectra (${calibOk} calib)"
+	     else
+		 $ECHO "${sourceDate}/Off/${c}: Calibration failed"
+	     fi
+#end of loop on cycles 
+	   done
+	else
+	    $ECHO "${sourceDate} : No Calibration done for Off Diectory"
+	fi
+#end of Off exist
+    else
+	$ECHO "${sourceDate} : No Off Diectory"
+    fi
+#
+#On directory
+#
+    dateField=`basename ${j}`
+    sourceDate="${sourceName}-${dateField}"
+#look if final calibration files exist
+    calibOk=`ils ${j} | $GREP -i "calib_" | $WC -l`
+    onDirExist=`ils ${j} | $GREP -i "On" | $WC -l`
+    if [ ${onDirExist} != 0 ]; then
+	listeCyclesOn=( `ils ${j}/On | $GREP -i "calibcycle" | $AWK '($1=="C-"){print $2}' | $XARGS -i basename {} | $SORT -k1.11n` )
+	IFS='
+  '
+	listeCyclesOn=( $( $PRINTF "%s\n" "${listeCyclesOn[@]}" | $AWK 'x[$0]++ == 0' ) )
+	IFS=$DefaultIFS
+	
+	if [ ${#listeCyclesOn[*]} != 0 ]; then    
+           for c in ${listeCyclesOn[@]}
+	   do
+#nb: $c has the format of calibcycle<number>
+	     nFiles=`ils ${j}/On/${c} | $GREP -i "medfiltmtx" | $WC -l`
+	     if [ ${nFiles} != 0 ]; then
+		 $ECHO "${sourceDate}/On/${c}: ${nFiles} spectra (${calibOk} calib)"
+	     else
+		 $ECHO "${sourceDate}/On/${c}: Calibration failed"
+	     fi
+#end of loop on cycles 
+	   done
+	else
+	    $ECHO "${sourceDate} : No Calibration done for On Diectory"
+	fi
+#end of On exist
+    else
+	$ECHO "${sourceDate} : No On Diectory"
+    fi
+#end of loop on dates
+  done 
+#end of loop on sources
+done
Index: /BAORadio/AmasNancay/trunk/statusgain.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/statusgain.sh	(revision 549)
+++ /BAORadio/AmasNancay/trunk/statusgain.sh	(revision 549)
@@ -0,0 +1,70 @@
+#!/bin/sh
+#liste des "sources" enregistrees sous Amas
+GREP=/bin/grep
+AWK=/bin/awk
+ECHO=/bin/echo
+MKDIR=/bin/mkdir
+CAT=/bin/cat
+PRINTF=/usr/bin/printf
+RM=/bin/rm
+SORT=/bin/sort
+XARGS=/usr/bin/xargs
+WC=/usr/bin/wc
+DefaultIFS=$' \t\n'
+IFS=$DefaultIFS
+
+# Irods environment settings
+. /usr/local/shared/bin/irods_env.sh -noverbose
+
+scriptName="`basename $0`"
+$ECHO "Processing script ${scriptName} at `date`"
+
+#Path to public backupable path
+publicpath="/afs/in2p3.fr/home/c/campagne/public"
+
+#Path where the job will do temporary IO
+if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
+    iojobpath="/sps/baoradio/AmasNancay/JEC"
+    $MKDIR -p $iojobpath
+elif [ ${ENVIRONMENT} == "BATCH" ] ; then
+    iojobpath=${TMPBATCH}
+else
+    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
+    exit 1
+fi
+cd ${iojobpath}
+
+
+OUT1=./baoils.$$
+ils /baoradio/data/AmasNancay/ > ${OUT1}
+OUT2=./baoawk1.$$
+$AWK '($1=="C-") {print $2}' ${OUT1} > ${OUT2}
+$RM $OUT1
+#Sequence 
+tableau=( `$CAT $OUT2 | $AWK '{print $1}'` )
+IFS='
+'
+tableau=( $( $PRINTF "%s\n" "${tableau[@]}" | $AWK 'x[$0]++ == 0' ) )
+IFS=$DefaultIFS
+
+$RM $OUT2
+
+for i in ${tableau[@]}
+do
+  $ECHO "source $i"
+  listedate=( `ils $i | $AWK '($1=="C-"){print $2}'`)
+  IFS='
+'
+  listedate=( $( $PRINTF "%s\n" "${listedate[@]}" | $AWK 'x[$0]++ == 0' ) )
+  IFS=$DefaultIFS
+
+  for j in ${listedate[@]}
+  do
+    gainOk=`ils ${j} | $GREP -i "gain_" | $WC -l`
+    if [ ${gainOk} -gt 0 ]; then
+	$ECHO ">>> $j ---> GAIN Done (${gainOk})"
+    else
+	$ECHO ">>> $j ---> GAIN To be computed"
+    fi
+  done 
+done
Index: /BAORadio/AmasNancay/trunk/statusheader.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/statusheader.sh	(revision 549)
+++ /BAORadio/AmasNancay/trunk/statusheader.sh	(revision 549)
@@ -0,0 +1,94 @@
+#!/bin/sh
+#liste des "sources" enregistrees sous Amas
+GREP=/bin/grep
+AWK=/bin/awk
+ECHO=/bin/echo
+MKDIR=/bin/mkdir
+CAT=/bin/cat
+PRINTF=/usr/bin/printf
+RM=/bin/rm
+SORT=/bin/sort
+XARGS=/usr/bin/xargs
+WC=/usr/bin/wc
+DefaultIFS=$' \t\n'
+IFS=$DefaultIFS
+
+# Irods environment settings
+. /usr/local/shared/bin/irods_env.sh -noverbose
+
+scriptName="`basename $0`"
+$ECHO "Processing script ${scriptName} at `date`"
+
+#Path to public backupable path
+publicpath="/afs/in2p3.fr/home/c/campagne/public"
+
+#Path where the job will do temporary IO
+if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
+    iojobpath="/sps/baoradio/AmasNancay/JEC"
+    $MKDIR -p $iojobpath
+elif [ ${ENVIRONMENT} == "BATCH" ] ; then
+    iojobpath=${TMPBATCH}
+else
+    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
+    exit 1
+fi
+cd ${iojobpath}
+
+
+OUT1=./baoils.$$
+ils /baoradio/data/AmasNancay/ > ${OUT1}
+OUT2=./baoawk1.$$
+$AWK '($1=="C-") {print $2}' ${OUT1} > ${OUT2}
+$RM $OUT1
+#Sequence 
+tableau=( `$CAT $OUT2 | $AWK '{print $1}'` )
+IFS='
+'
+tableau=( $( $PRINTF "%s\n" "${tableau[@]}" | $AWK 'x[$0]++ == 0' ) )
+IFS=$DefaultIFS
+
+$RM $OUT2
+
+for i in ${tableau[@]}
+do
+  $ECHO "source $i"
+  listedate=( `ils $i | $AWK '($1=="C-"){print $2}'`)
+  IFS='
+'
+  listedate=( $( $PRINTF "%s\n" "${listedate[@]}" | $AWK 'x[$0]++ == 0' ) )
+
+  ntotfiles=0
+  for j in ${listedate[@]}
+  do
+#Fiber 1
+    listOfsig1=( `ils ${j}/Fiber1 | $GREP -i "signal" | $XARGS -i basename {} | $SORT -k1.7n` )
+    IFS='
+  '
+    listOfsig1=( $( $PRINTF "%s\n" "${listOfsig1[@]}" | $AWK 'x[$0]++ == 0' ) )
+    nblinesSIG1=${#listOfsig1[@]}
+    listOfhdr1=( `ils ${j}/Fiber1 | $GREP -i "header" | $XARGS -i basename {} | $SORT -k1.7n` )
+    IFS='
+    '
+    listOfhdr1=( $( $PRINTF "%s\n" "${listOfhdr1[@]}" | $AWK 'x[$0]++ == 0' ) )
+    nblinesHDR1=${#listOfhdr1[@]}
+
+#Fiber 2
+    listOfsig2=( `ils ${j}/Fiber2 | $GREP -i "signal" | $XARGS -i basename {} | $SORT -k1.7n` )
+    IFS='
+  '
+    listOfsig2=( $( $PRINTF "%s\n" "${listOfsig2[@]}" | $AWK 'x[$0]++ == 0' ) )
+    nblinesSIG2=${#listOfsig2[@]}
+    listOfhdr2=( `ils ${j}/Fiber2 | $GREP -i "header" | $XARGS -i basename {} | $SORT -k1.7n` )
+    IFS='
+    '
+    listOfhdr2=( $( $PRINTF "%s\n" "${listOfhdr2[@]}" | $AWK 'x[$0]++ == 0' ) )
+    nblinesHDR2=${#listOfhdr2[@]}
+
+
+
+    $ECHO ">>> $j --->  Fib1: $nblinesHDR1 / $nblinesSIG1 Fib2: $nblinesHDR2 / $nblinesSIG2"
+    let "ntotfiles=ntotfiles+$nblinesSIG1"
+  done 
+  $ECHO "total signal Fiber1 files = $ntotfiles"
+
+done
Index: /BAORadio/AmasNancay/trunk/submit2bqs-calibmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2bqs-calibmaker.sh	(revision 549)
+++ /BAORadio/AmasNancay/trunk/submit2bqs-calibmaker.sh	(revision 549)
@@ -0,0 +1,43 @@
+#!/bin/sh -xv
+
+scriptName="`basename $0`"
+echo "Processing script ${scriptName} at `date`"
+
+#Process cmd line args: the -src option is mandatory (source name as Abell85)
+sourceRadio
+freqBAOCalib=
+bwBAOCalib=
+#use -sim option to simulate processing (debug the script as if...)
+simulationMode=""
+while [ $# -gt 0 ]
+do
+  case "$1" in
+      -src)  sourceRadio="$2"; shift;;
+      -freq) freqBAOCalib="-freq $2"; shift;;
+      -bwd)  bwBAOCalib="-bwd $2"; shift;;
+      -sim) 
+      simulationMode="-sim On"
+      $ECHO "INFO ${scriptName} running in SIMUL mode";;
+	-h)
+	echo >&2 \
+	    "usage: $0 -src souce [-freq freq in MHz (default ${freqBAOCalib})] [-bwd bandwidth in MHz (default ${bwBAOCalib})]"
+	exit 1;;
+	*)  break;;	# terminate while loop
+    esac
+    shift
+done
+
+
+if [ "<${sourceRadio}>" = "<>" ]; then
+    $ECHO "FATAL: You have forgotten to select the source option (-src)"
+    exit 1
+fi
+
+
+jobBatchName="calibs-${sourceRadio}"
+
+jobLogName="${jobBatchName}.log.$$"
+
+qsub -l u_sps_baoradio,u_irods,T=120000,M=1000MB,scratch=1000MB,platform=LINUX -eo -o $jobLogName -N $jobBatchName -mb -me -mu campagne@lal.in2p3.fr <<EOF
+/afs/in2p3.fr/home/c/campagne/private/work/AmasNancay/calibmaker.sh  -src ${sourceRadio} ${freqBAOCalib} ${bwBAOCalib} ${simulationMode}
+EOF
Index: /BAORadio/AmasNancay/trunk/submit2bqs-gainmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2bqs-gainmaker.sh	(revision 549)
+++ /BAORadio/AmasNancay/trunk/submit2bqs-gainmaker.sh	(revision 549)
@@ -0,0 +1,26 @@
+#!/bin/sh -xv
+
+#Process cmd line args: the -src option is mandatory (source name as Abell85)
+sourceRadio=
+#use -sim option to simulate processing (debug the script as if...)
+simulationMode=""
+while [ $# -gt 0 ]
+do
+  case "$1" in
+      -src)  sourceRadio=$2; shift;;
+      -sim) simulationMode="-sim";;
+	-h)
+	    echo >&2 \
+	    "usage: $0 -src souce [-sim]"
+	    exit 1;;
+	*)  break;;	# terminate while loop
+    esac
+    shift
+done
+
+jobBatchName="gains-$sourceRadio"
+jobLogName="${jobBatchName}.log.$$"
+
+qsub -l u_sps_baoradio,u_irods,T=120000,M=1000MB,scratch=500MB,platform=LINUX -eo -o $jobLogName -N $jobBatchName -mb -me -mu campagne@lal.in2p3.fr <<EOF
+/afs/in2p3.fr/home/c/campagne/private/work/AmasNancay/gainmaker.sh  -src ${sourceRadio} ${simulationMode}
+EOF
Index: /BAORadio/AmasNancay/trunk/submit2bqs-hdrfitsextractor.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2bqs-hdrfitsextractor.sh	(revision 549)
+++ /BAORadio/AmasNancay/trunk/submit2bqs-hdrfitsextractor.sh	(revision 549)
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+#Process cmd line args: the -src option is mandatory (source name as Abell85)
+sourceRadio=
+while [ $# -gt 0 ]
+do
+  case "$1" in
+      -src)  sourceRadio=$2; shift;;
+	-h)
+	    echo >&2 \
+	    "usage: $0 -src souce"
+	    exit 1;;
+	*)  break;;	# terminate while loop
+    esac
+    shift
+done
+
+jobBatchName="headerMaker-$sourceRadio"
+jobLogName="${jobBatchName}.log.$$"
+
+qsub -l u_sps_baoradio,u_irods,T=100000,M=256MB,scratch=700MB,platform=LINUX -eo -o $jobLogName -N $jobBatchName -mb -me -mu campagne@lal.in2p3.fr <<EOF
+/afs/in2p3.fr/home/c/campagne/private/work/AmasNancay/hdrfitsextractor.sh  $sourceRadio
+EOF
