Index: /BAORadio/AmasNancay/trunk/isInteractive.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/isInteractive.sh	(revision 580)
+++ /BAORadio/AmasNancay/trunk/isInteractive.sh	(revision 580)
@@ -0,0 +1,10 @@
+isInteractive()
+{
+  if [ ${ENVIRONMENT} == "INTERACTIVE" -o ${ENVIRONMENT} == "ACCESS" ]; then
+    isInteractive=1
+  else
+    isInteractive=0
+  fi
+
+  echo ${isInteractive}
+}
Index: /BAORadio/AmasNancay/trunk/set_iojobpath.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/set_iojobpath.sh	(revision 580)
+++ /BAORadio/AmasNancay/trunk/set_iojobpath.sh	(revision 580)
@@ -0,0 +1,19 @@
+set_iojobpath()
+{
+  if [ ${ENVIRONMENT} == "INTERACTIVE" -o ${ENVIRONMENT} == "ACCESS" ]; then
+      iojobpath=${IOJOBPATH}
+      $MKDIR -p $iojobpath
+
+  elif [ ${ENVIRONMENT} == "BATCH" ]; then
+    iojobpath=${TMPBATCH}
+
+  elif [ ${ENVIRONMENT} == "SEQUENTIAL_BATCH" -o ${ENVIRONMENT} == "PARALLEL_BATCH" -o  ${ENVIRONMENT} == "INTERACTIVE_BATCH" ]; then
+    iojobpath=${TMPDIR}
+
+  else
+    $ECHO "FATAL: environment is ${ENVIRONMENT} not allowed"
+    exit 1
+  fi
+  $ECHO ${iojobpath}
+
+}
Index: /BAORadio/AmasNancay/trunk/submit2ge-anacalibmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2ge-anacalibmaker.sh	(revision 580)
+++ /BAORadio/AmasNancay/trunk/submit2ge-anacalibmaker.sh	(revision 580)
@@ -0,0 +1,46 @@
+#!/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=
+dateSelected=
+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;;
+      -date) dateSelected="-date $2"; dateJob="$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 -date YYYYMMDD [-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="anacalibs-${sourceRadio}${dateJob}"
+
+jobLogName="${jobBatchName}.log.$$"
+
+qsub -P P_baoradio -l sps=1,irods=1,ct=1200,vmem=1000M,fsize=1000M -o $jobLogName -j yes -N $jobBatchName -m be -M ${LOGNAME}@lal.in2p3.fr -V <<EOF
+
+${SCRIPTPATH}/anacalibmaker.sh  -src ${sourceRadio} ${dateSelected} ${freqBAOCalib} ${bwBAOCalib} ${simulationMode}
+EOF
Index: /BAORadio/AmasNancay/trunk/submit2ge-anagainmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2ge-anagainmaker.sh	(revision 580)
+++ /BAORadio/AmasNancay/trunk/submit2ge-anagainmaker.sh	(revision 580)
@@ -0,0 +1,27 @@
+#!/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 -P P_baoradio -l sps=1,irods=1,ct=2400,vmem=1000M,fsize=500M -o $jobLogName -j yes -N $jobBatchName -m be -M ${LOGNAME}@lal.in2p3.fr -V <<EOF
+
+${SCRIPTPATH}/gainmaker.sh  -src ${sourceRadio} ${simulationMode}
+EOF
Index: /BAORadio/AmasNancay/trunk/submit2ge-anarawonoffmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2ge-anarawonoffmaker.sh	(revision 580)
+++ /BAORadio/AmasNancay/trunk/submit2ge-anarawonoffmaker.sh	(revision 580)
@@ -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=
+dateSelected=
+dateJob=
+#use -sim option to simulate processing (debug the script as if...)
+simulationMode=""
+while [ $# -gt 0 ]
+do
+  case "$1" in
+      -src)  sourceRadio="$2"; shift;;
+      -date) dateSelected="-date $2"; dateJob="$2";     shift;;
+      -sim) 
+      simulationMode="-sim On"
+      $ECHO "INFO ${scriptName} running in SIMUL mode";;
+      -h)
+	echo >&2 \
+	    "usage: $0 -src souce -date YYYYMMDD [-freq freq in MHz (default ${freqBAOCalib})] [-sim to trig simulation mode]"
+	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="anarawonoff-${sourceRadio}${dateJob}"
+
+jobLogName="${jobBatchName}.log.$$"
+
+qsub -P P_baoradio -l sps=1,irods=1,ct=2400,vmem=1000M,fsize=1000M -o $jobLogName -j yes -N $jobBatchName -m be -M ${LOGNAME}@lal.in2p3.fr -V <<EOF
+
+${SCRIPTPATH}/anarawonoffmaker.sh  -src ${sourceRadio} ${dateSelected} ${simulationMode}
+EOF
Index: /BAORadio/AmasNancay/trunk/submit2ge-calibmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2ge-calibmaker.sh	(revision 580)
+++ /BAORadio/AmasNancay/trunk/submit2ge-calibmaker.sh	(revision 580)
@@ -0,0 +1,44 @@
+#!/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 -P P_baoradio -l sps=1,irods=1,ct=2400,vmem=1000M,fsize=1000M -o $jobLogName -j yes -N $jobBatchName -m be -M ${LOGNAME}@lal.in2p3.fr -V <<EOF
+
+${SCRIPTPATH}/calibmaker.sh  -src ${sourceRadio} ${freqBAOCalib} ${bwBAOCalib} ${simulationMode}
+EOF
Index: /BAORadio/AmasNancay/trunk/submit2ge-gainmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2ge-gainmaker.sh	(revision 580)
+++ /BAORadio/AmasNancay/trunk/submit2ge-gainmaker.sh	(revision 580)
@@ -0,0 +1,34 @@
+#!/bin/sh -xv
+
+#Process cmd line args: the -src option is mandatory (source name as Abell85)
+sourceRadio=
+dateSelected=
+#use -sim option to simulate processing (debug the script as if...)
+simulationMode=""
+while [ $# -gt 0 ]
+do
+  case "$1" in
+      -src)  sourceRadio=$2; shift;;
+      -date) dateSelected="-date $2"; dateJob="$2";     shift;;
+      -sim) simulationMode="-sim";;
+	-h)
+	    echo >&2 \
+	    "usage: $0 -src souce -date YYYYMMDD [-sim]"
+	    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="anagains-${sourceRadio}${dateJob}"
+jobLogName="${jobBatchName}.log.$$"
+
+qsub -P P_baoradio -l sps=1,irods=1,ct=2400,vmem=1000M,fsize=500M -o $jobLogName -j yes -N $jobBatchName -m be -M ${LOGNAME}@lal.in2p3.fr -V <<EOF
+
+${SCRIPTPATH}/anagainmaker.sh  -src ${sourceRadio} ${dateSelected} ${simulationMode}
+EOF
Index: /BAORadio/AmasNancay/trunk/submit2ge-hdrfitsextractor.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2ge-hdrfitsextractor.sh	(revision 580)
+++ /BAORadio/AmasNancay/trunk/submit2ge-hdrfitsextractor.sh	(revision 580)
@@ -0,0 +1,24 @@
+#!/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 -P P_baoradio -l sps=1,irods=1,ct=2000,vmem=256M,fsize=700M -o $jobLogName -j yes -N $jobBatchName -m be -M ${LOGNAME}@lal.in2p3.fr -V <<EOF
+
+${SCRIPTPATH}/hdrfitsextractor.sh  $sourceRadio
+EOF
Index: /BAORadio/AmasNancay/trunk/submit2ge-onoffmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2ge-onoffmaker.sh	(revision 580)
+++ /BAORadio/AmasNancay/trunk/submit2ge-onoffmaker.sh	(revision 580)
@@ -0,0 +1,45 @@
+#!/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=
+dateSelected=
+dateJob=
+freqBAOCalib=
+#use -sim option to simulate processing (debug the script as if...)
+simulationMode=""
+while [ $# -gt 0 ]
+do
+  case "$1" in
+      -src)  sourceRadio="$2"; shift;;
+      -date) dateSelected="-date $2"; dateJob="$2";     shift;;
+      -freq) freqBAOCalib="-freq $2"; shift;;
+      -sim) 
+      simulationMode="-sim On"
+      $ECHO "INFO ${scriptName} running in SIMUL mode";;
+	-h)
+	echo >&2 \
+	    "usage: $0 -src souce -date YYYYMMDD [-freq freq in MHz (default ${freqBAOCalib})] [-sim to trig simulation mode]"
+	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="onoff-${sourceRadio}${dateJob}"
+
+jobLogName="${jobBatchName}.log.$$"
+
+qsub -P P_baoradio -l sps=1,irods=1,ct=2400,vmem=1000M,fsize=1000M -o $jobLogName -j yes -N $jobBatchName -m be -M ${LOGNAME}@lal.in2p3.fr -V <<EOF
+
+${SCRIPTPATH}/onoffmaker.sh  -src ${sourceRadio} ${dateSelected} ${freqBAOCalib} ${simulationMode}
+EOF
Index: /BAORadio/AmasNancay/trunk/submit2ge-procspecmfib.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2ge-procspecmfib.sh	(revision 580)
+++ /BAORadio/AmasNancay/trunk/submit2ge-procspecmfib.sh	(revision 580)
@@ -0,0 +1,128 @@
+#!/bin/sh -xv
+AWK=/bin/awk
+SED=/bin/sed
+GREP=/bin/grep
+WC=/usr/bin/wc
+RM=/bin/rm
+CAT=/bin/cat
+TOUCH=/bin/touch
+DATE=/bin/date
+ECHO=/bin/echo
+LS=/bin/ls
+MKDIR=/bin/mkdir
+TR=/usr/bin/tr
+FIND=/usr/bin/find
+PRINTF=/usr/bin/printf
+XARGS=/usr/bin/xargs
+SORT=/bin/sort
+QSUB=qsub
+
+DefaultIFS=$' \t\n'
+IFS=$DefaultIFS
+
+
+scriptName="`basename $0`"
+echo "Processing script ${scriptName} at `date`"
+
+#Process cmd line args: the -src option is mandatory (source name as Abell85)
+#action: gain|mspec (gain: gain-like doucble median filtering
+#                   mspec: mean+sigma wo filetring)
+action="-act gain"
+sourceRadio=
+dateSelected=
+typeofproc=
+#first and last cycle to process
+#
+firstCycle=
+lastCycle=
+#use -sim option to simulate processing (debug the script as if...)
+simulationMode=""
+while [ $# -gt 0 ]
+do
+  case "$1" in
+      -act)  action="-act $2"; act=$2; shift;;
+      -src)  sourceRadio="$2"; shift;;
+      -date) dateSelected="-date $2"; dateJob="$2";     shift;;
+      -type) typeofproc="-type $2"; type=$2; shift;;
+      -fcycle) firstCycle="-fcycle $2"; fcycle="$2"; shift;;
+      -lcycle) lastCycle="-lcycle $2"; lcycle="$2"; shift;;
+       -sim) 
+      simulationMode="-sim On"
+      $ECHO "INFO ${scriptName} running in SIMUL mode";;
+	-h)
+	echo >&2 \
+	    "usage: $0 -src souce -date YYYYMMDD -type type [-fcycle firstCycle] [-lcycle lastCycle] [-sim to trig simulation mode]"
+	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
+
+if [ "<${dateSelected}>" = "<>" ]; then
+    $ECHO "FATAL: You have forgotten to select the date option (-date)"
+    exit 1
+fi
+
+if [ "<${typeofproc}>" = "<>" ]; then
+    $ECHO "FATAL: You have forgotten to select the type option (-type)"
+    exit 1
+fi
+
+#Path to public backupable path
+publicpath="/afs/in2p3.fr/home/c/campagne/public"
+#temporary files to synchronize scripts
+tmppublicpath=${TMPPUBLICPATH}
+#Path of the utility scripts
+scriptpath=${SCRIPTPATH}
+#get the daq current irod status
+#JEC 1/10/11 Use generic baodaqstatus name 
+#### tag=`${DATE} +%F`
+OUT1=${publicpath}/baodaqstatus-current.txt
+
+if [ ! -e ${OUT1}  -o ! -r ${OUT1} ]; then
+    $ECHO "FATAL (${scriptName}): ${OUT1} has a problem"
+    exit 1
+#JEC 29/9/11 avoid finished stuff
+#    $RM -f ${tmppublicpath}/statusdaq.finished
+#    ${scriptpath}/statusdaq.sh > ${OUT1}
+#    while [ ! -f "${tmppublicpath}/statusdaq.finished" ]; do
+#	sleep 30
+#    done
+#    $RM ${tmppublicpath}/statusdaq.finished
+#protect against remove/rewriting    
+#    $CHMOD -v 444 ${OUT1} 
+fi
+
+#assume 20 files/cycles cf. 30sec/cycle et 3sec par signal et fact 2 margin 
+if [ "<${firstCycle}>" != "<>" -a "<${lastCycle}>" != "<>" ]; then
+    jobBatchName="procspecmfib-${sourceRadio}${dateJob}${type}-${fcycle}-${lcycle}"
+    nFiles=`expr ${lcycle} - ${fcycle} + 1`
+    nFiles=`expr ${nFiles} \* 20`
+else
+    jobBatchName="procspecmfib-${sourceRadio}${dateJob}${type}-All"
+    #assume 30 cycles maxi!
+    nFiles=`expr 20 \* 30`
+
+fi
+
+jobLogName="${jobBatchName}.log.$$"
+
+#Nbre de paquets utilises pour 1 spectre
+tspwin="5120"
+#calcul du scratch sachant que l'on nettoie apres chaque cycle
+nSpectra=`expr 20 \* 25600 /  ${tspwin}`
+scratchSize=`expr  20 \* 500 + ${nSpectra} \* 200 / 1000 + 5`
+
+#le cpu total tient compte de l'emsemble des ficheirs a traiter
+#cpu=`expr ${nFiles} \* 60 \* 50`  # BQS estimation
+cpu=`expr ${nFiles} \* 60`
+
+qsub -P P_baoradio -l sps=1,irods=1,ct=${cpu},vmem=1000M,fsize=${scratchSize}M -o $jobLogName -j yes -N $jobBatchName -m be -M ${LOGNAME}@lal.in2p3.fr -V <<EOF
+
+${SCRIPTPATH}/proc_specmfib.sh ${action} -src ${sourceRadio} ${dateSelected} ${typeofproc} ${firstCycle} ${lastCycle} ${simulationMode}
+EOF
Index: /BAORadio/AmasNancay/trunk/submit2ge-scaextractor.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/submit2ge-scaextractor.sh	(revision 580)
+++ /BAORadio/AmasNancay/trunk/submit2ge-scaextractor.sh	(revision 580)
@@ -0,0 +1,64 @@
+#!/bin/sh -xvf
+DATE=/bin/date
+GREP=/bin/grep
+AWK=/bin/awk
+ECHO=/bin/echo
+WC=/usr/bin/wc
+CAT=/bin/cat
+PRINTF=/usr/bin/printf
+FIND=/usr/bin/find
+MKDIR=/bin/mkdir
+XARGS=/usr/bin/xargs
+SORT=/bin/sort
+RM=/bin/rm
+TR=/usr/bin/tr
+CP=/bin/cp
+LS=/bin/ls
+CHMOD=/bin/chmod
+
+#Process cmd line args: the -src option is mandatory (source name as Abell85)
+sourceRadio=
+force=
+while [ $# -gt 0 ]
+do
+  case "$1" in
+      -src)  sourceRadio=$2; shift;;
+      -force) force="Yes";;
+	-h)
+	    echo >&2 \
+	    "usage: $0 -src souce"
+	    exit 1;;
+	*)  break;;	# terminate while loop
+    esac
+    shift
+done
+
+#Path to public backupable path
+publicpath="/afs/in2p3.fr/home/c/campagne/public"
+
+
+#temporary files to synchronize scripts
+tmppublicpath=${TMPPUBLICPATH}
+$LS -l ${tmppublicpath} > /dev/null
+
+#Path of the utility scripts
+scriptpath=${SCRIPTPATH}
+
+#JEC 1/10/11 Use generic baodaqstatus name 
+#the daq current irod status
+#tag=`${DATE} +%F`
+#OUT1=${publicpath}/baodaqstatus-${tag}.txt
+OUT1=${publicpath}/baodaqstatus-current.txt
+
+if [ ! -e ${OUT1}  -o ! -r ${OUT1} ]; then
+    $ECHO "FATAL (${scriptName}): ${OUT1} has a problem"
+    exit 1
+fi
+
+jobBatchName="scaMaker-$sourceRadio"
+jobLogName="${jobBatchName}.log.$$"
+
+qsub -P P_baoradio -l sps=1,irods=1,ct=2000,vmem=256M,fsize=700M -o $jobLogName -j yes -N $jobBatchName -m be -M ${LOGNAME}@lal.in2p3.fr -V <<EOF
+
+${SCRIPTPATH}/scaextractor.sh  ${sourceRadio} ${force}
+EOF
