Index: /BAORadio/AmasNancay/etude_data.pic
===================================================================
--- /BAORadio/AmasNancay/etude_data.pic	(revision 525)
+++ /BAORadio/AmasNancay/etude_data.pic	(revision 525)
@@ -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/etude_gain.pic
===================================================================
--- /BAORadio/AmasNancay/etude_gain.pic	(revision 525)
+++ /BAORadio/AmasNancay/etude_gain.pic	(revision 525)
@@ -0,0 +1,30 @@
+set toppath "/sps/baoradio/AmasNancay/JEC"
+set source "Abell85"
+set srclower "abell85"
+set date   "20110428"
+
+####################################################
+# Gains
+####################################################
+newwin 1 1
+graphicatt "xylimits=1250,1500,0,0.008"
+
+openfits ${toppath}/${source}/${date}${srclower}/gain_${date}_${srclower}.fits
+del g0 g1
+objaoper gain_20110428_abell85 row 0 g0
+objaoper gain_20110428_abell85 row 1 g1
+plot2d g1 (n/8192)*250+1250 val n>0 "red cpts nsta notit"
+plot2d g0 (n/8192)*250+1250 val n>0 "same blue cpts nsta notit"
+settitle "Gain $source ${date} Ch 0 (blue) Ch 1 (red)"
+setaxelabels "Freq. (MHz)" "I (a.u)"
+
+####################################################
+# Control of the gains
+####################################################
+newwin 1 1
+graphicatt "xylimits=0,25,0,0.006"
+
+openppf ${toppath}/${source}/${date}${srclower}/gain_monitor_${date}_${srclower}.ppf
+plot2d gainmoni n val n>0 "black cpts nsta notit"
+plot2d gainmoni0 n val n>0 "same blue cpts nsta notit"
+plot2d gainmoni1 n val n>0 "same red cpts nsta notit"
Index: /BAORadio/AmasNancay/etude_onoff.pic
===================================================================
--- /BAORadio/AmasNancay/etude_onoff.pic	(revision 525)
+++ /BAORadio/AmasNancay/etude_onoff.pic	(revision 525)
@@ -0,0 +1,285 @@
+
+set cols ( blue red black green purple orange cyan violet yellow )
+
+set toppath "/sps/baoradio/AmasNancay/JEC"
+set source "Abell85"
+set srclower "abell85"
+set date   "20110428"
+
+
+#####################################
+#Plots ON-OFF with all calibrations 
+#####################################
+openppf ${toppath}/${source}/${date}${srclower}/diffOnOff_${date}_${srclower}.ppf
+
+
+#specONOFF<i>       Matrix 2 x 8192 : i=0...
+#specONOFFMean      Matrix 2 x 8192
+#specONOFF2ChanMean Vector 8192 x 1
+
+
+#####################################
+#Plots with different Means: per channel and all 
+#####################################
+del sallcyclev0
+objaoper specONOFFMean row 0 sallcyclev0
+del sallcyclev1
+objaoper specONOFFMean row 1 sallcyclev1
+
+newwin 1 1
+graphicatt "xylimits=1250,1500,-0.5,0.5"
+plot2d specONOFF2ChanMean (n/8192)*250+1250 val n>0 "black cpts nsta notit"
+plot2d sallcyclev0        (n/8192)*250+1250 val n>0 "same blue cpts nsta notit"
+plot2d sallcyclev1        (n/8192)*250+1250 val n>0 "same red cpts nsta notit"
+settitle "ON-OFF  $source Ch 0 (blue) Ch 1 (red) Mean (black)  All cycles"
+setaxelabels "Freq. (MHz)" "I (Jy)"
+
+#####################################
+#Plots ON-OFF with all calibrations: chan 0 & 1 separaed and cycle per cycle 
+#####################################
+newwin 1 1
+graphicatt "xylimits=1250,1500,-0.5,0.5"
+del sc1v0
+objaoper specONOFF1 row 0 sc1v0
+plot2d sc1v0 (n/8192)*250+1250 val n>0 "$cols[0] cpts nsta notit"
+for ic 2:13
+    k = ${ic}-floor(${ic}/${#cols})*${#cols}
+    del sc${ic}v0
+    objaoper specONOFF${ic} row 0 sc${ic}v0	
+    plot2d sc${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+end
+settitle "ON-OFF  $source Ch 0 cycle per cycle"
+setaxelabels "Freq. (MHz)" "I (Jy)"
+
+newwin 1 1
+graphicatt "xylimits=1250,1500,-0.5,0.5"
+del sc1v1
+objaoper specONOFF1 row 1 sc1v1
+plot2d sc1v1 (n/8192)*250+1250 val n>0 "$cols[0] cpts nsta notit"
+for ic 2:13
+    k = ${ic}-floor(${ic}/${#cols})*${#cols}
+    del sc${ic}v1
+    objaoper specONOFF${ic} row 1 sc${ic}v1	
+    plot2d sc${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+end
+settitle "ON-OFF  $source Ch 1 cycle per cycle"
+setaxelabels "Freq. (MHz)" "I (Jy)"
+
+
+#####################################
+# Plots RAW no calibration at all
+#####################################
+openppf ${toppath}/${source}/${date}${srclower}/dataRaw_${date}_${srclower}.ppf
+newwin 2 2
+graphicatt "xylimits=1250,1500,0.95,1.05"
+
+###         #
+### On Ch 0 # On Ch 1 
+######################
+### Off Ch 0# Off Ch 1
+###         #
+
+set mode On	
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v0
+    objaoper specRaw${mode}${ic} row 0 sm${mode}c${ic}v0
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source Raw: On Ch 0"
+
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v1
+    objaoper specRaw${mode}${ic} row 1 sm${mode}c${ic}v1
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source Raw: On Ch 1"
+
+set mode Off
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v0
+    objaoper specRaw${mode}${ic} row 0 sm${mode}c${ic}v0
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source Raw: Off Ch 0"
+
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v1
+    objaoper specRaw${mode}${ic} row 1 sm${mode}c${ic}v1
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source Raw: Off Ch 1"
+
+#####################################
+# Plots BAO calibration included
+#####################################
+openppf ${toppath}/${source}/${date}${srclower}/dataBAOCalib_${date}_${srclower}.ppf
+newwin 2 2
+#graphicatt "xylimits=1250,1500,0.95,1.05"
+graphicatt ""
+
+
+###         #
+### On Ch 0 # On Ch 1 
+######################
+### Off Ch 0# Off Ch 1
+###         #
+
+set mode On	
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v0
+    objaoper specBAOCalib${mode}${ic} row 0 sm${mode}c${ic}v0
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source BAOCalib: On Ch 0"
+
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v1
+    objaoper specBAOCalib${mode}${ic} row 1 sm${mode}c${ic}v1
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source BAOCalib: On Ch 1"
+
+set mode Off
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v0
+    objaoper specBAOCalib${mode}${ic} row 0 sm${mode}c${ic}v0
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source BAOCalib: Off Ch 0"
+
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v1
+    objaoper specBAOCalib${mode}${ic} row 1 sm${mode}c${ic}v1
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source BAOCalib: Off Ch 1"
+
+#####################################
+# Plots BAO+RT calibration included
+#####################################
+openppf ${toppath}/${source}/${date}${srclower}/dataBAORTCalib_${date}_${srclower}.ppf
+newwin 2 2
+#graphicatt "xylimits=1250,1500,0.95,1.05"
+graphicatt ""
+
+
+###         #
+### On Ch 0 # On Ch 1 
+######################
+### Off Ch 0# Off Ch 1
+###         #
+
+set mode On	
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v0
+    objaoper specBAORTCalib${mode}${ic} row 0 sm${mode}c${ic}v0
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source BAORTCalib: On Ch 0"
+
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v1
+    objaoper specBAORTCalib${mode}${ic} row 1 sm${mode}c${ic}v1
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source BAORTCalib: On Ch 1"
+
+set mode Off
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v0
+    objaoper specBAORTCalib${mode}${ic} row 0 sm${mode}c${ic}v0
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source BAORTCalib: Off Ch 0"
+
+set first 1
+for ic 1:13
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v1
+    objaoper specBAORTCalib${mode}${ic} row 1 sm${mode}c${ic}v1
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source BAORTCalib: Off Ch 1"
+
Index: /BAORadio/AmasNancay/etude_rawonoff.pic
===================================================================
--- /BAORadio/AmasNancay/etude_rawonoff.pic	(revision 525)
+++ /BAORadio/AmasNancay/etude_rawonoff.pic	(revision 525)
@@ -0,0 +1,281 @@
+
+set cols ( blue red black green purple orange cyan violet yellow )
+
+set toppath "/sps/baoradio/AmasNancay/JEC"
+set source "Abell85"
+set srclower "abell85"
+set date   "20110428"
+# implicitement firstcycle =1
+set lastcycle 12
+set lastP1cycle 13
+
+#set showFigs ( 0 0 0 0 0 0 0 )
+
+
+
+#####################################
+#Plots RAW ON-OFF (RAW = WO calibrations) 
+#####################################
+openppf ${toppath}/${source}/${date}${srclower}/diffOnOffRaw_${date}_${srclower}.ppf
+
+
+#specONOFFRaw<i>       Matrix 2 x 8192 : i=0...
+#specONOFFRawMean      Matrix 2 x 8192
+#specONOFFRaw2ChanMean Vector 8192 x 1
+
+
+#####################################
+#Plots RAW ON-OFF with mean computed among the cycles AND(or NOT) the Channels
+#####################################
+
+#if ( $showFigs[0] == 1 ) then
+echo "Figure 1.........."
+
+del sallcyclev0
+objaoper specONOFFRawMean row 0 sallcyclev0
+del sallcyclev1
+objaoper specONOFFRawMean row 1 sallcyclev1
+
+newwin 1 1
+graphicatt "xylimits=1250,1500,-0.01,0.01"
+plot2d specONOFFRaw2ChanMean (n/8192)*250+1250 val n>0 "black cpts nsta notit"
+plot2d sallcyclev0        (n/8192)*250+1250 val n>0 "same blue cpts nsta notit"
+plot2d sallcyclev1        (n/8192)*250+1250 val n>0 "same red cpts nsta notit"
+settitle "ON-OFF  $source Ch 0 (blue) Ch 1 (red) Mean (black)  All cycles"
+setaxelabels "Freq. (MHz)" "I (a.u)"
+
+#endif
+
+#####################################
+#Plots RAW ON-OFF  chan 0 & 1 separaed and cycle per cycle 
+#####################################
+
+
+#if ( $showFigs[1] == 1 ) then
+echo "Figure 2.........."
+
+newwin 1 1
+graphicatt "xylimits=1250,1500,-0.01,0.01"
+del sc1v0
+objaoper specONOFFRaw1 row 0 sc1v0
+plot2d sc1v0 (n/8192)*250+1250 val n>0 "$cols[0] cpts nsta notit"
+for ic 2:${lastP1cycle}
+    k = ${ic}-floor(${ic}/${#cols})*${#cols}
+    del sc${ic}v0
+    objaoper specONOFFRaw${ic} row 0 sc${ic}v0	
+    plot2d sc${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+end
+settitle "ON-OFF  $source Ch 0 cycle per cycle"
+setaxelabels "Freq. (MHz)" "I (a.u)"
+
+newwin 1 1
+graphicatt "xylimits=1250,1500,-0.01,0.01"
+del sc1v1
+objaoper specONOFFRaw1 row 1 sc1v1
+plot2d sc1v1 (n/8192)*250+1250 val n>0 "$cols[0] cpts nsta notit"
+for ic 2:${lastP1cycle}
+    k = ${ic}-floor(${ic}/${#cols})*${#cols}
+    del sc${ic}v1
+    objaoper specONOFFRaw${ic} row 1 sc${ic}v1	
+    plot2d sc${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+end
+settitle "ON-OFF  $source Ch 1 cycle per cycle"
+setaxelabels "Freq. (MHz)" "I (a.u)"
+
+#endif
+
+#####################################
+# Plots RAW no calibration at all and no Diff ON-OFF
+#####################################
+openppf ${toppath}/${source}/${date}${srclower}/dataRaw_${date}_${srclower}.ppf
+
+#if ( $showFigs[2] == 1 ) then
+echo "Figure 3........."
+
+newwin 2 2
+graphicatt "xylimits=1250,1500,0.95,1.05"
+
+###         #
+### On Ch 0 # On Ch 1 
+######################
+### Off Ch 0# Off Ch 1
+###         #
+
+set mode On	
+set first 1
+for ic 1:${lastP1cycle}
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v0
+    objaoper specRaw${mode}${ic} row 0 sm${mode}c${ic}v0
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source Raw: On Ch 0"
+
+set first 1
+for ic 1:${lastP1cycle}
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v1
+    objaoper specRaw${mode}${ic} row 1 sm${mode}c${ic}v1
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source Raw: On Ch 1"
+
+set mode Off
+set first 1
+for ic 1:${lastP1cycle}
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v0
+    objaoper specRaw${mode}${ic} row 0 sm${mode}c${ic}v0
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source Raw: Off Ch 0"
+
+set first 1
+for ic 1:${lastP1cycle}
+  k = ${ic}-floor(${ic}/${#cols})*${#cols}	
+    del sm${mode}c${ic}v1
+    objaoper specRaw${mode}${ic} row 1 sm${mode}c${ic}v1
+    if ( ${first} == 1 ) then
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit"
+    else
+      plot2d sm${mode}c${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit"
+    endif
+  set first 0
+end
+settitle "$source Raw: Off Ch 1"
+
+#endif
+
+#####################################
+#Plots RAW ON-OFF  MEAN REDUCED  chan 0 & 1 separaed and cycle per cycle 
+#####################################
+
+#if ( $showFigs[3] == 1 ) then
+echo "Figure 4.........."
+
+newwin 1 1
+graphicatt "xylimits=1250,1500,-0.01,0.01"
+del sc1v0
+objaoper redMeanONOFFRaw1 row 0 sc1v0
+plot2d sc1v0 (n/32)*250+1250 val n>0 "$cols[0] marker=fcircle,7  nsta notit"
+for ic 2:${lastP1cycle}
+    k = ${ic}-floor(${ic}/${#cols})*${#cols}
+    del sc${ic}v0
+    objaoper redMeanONOFFRaw${ic} row 0 sc${ic}v0	
+    plot2d sc${ic}v0 (n/32)*250+1250 val n>0 "same $cols[k] marker=fcircle,7 nsta notit"
+end
+settitle "ON-OFF Mean 32bins $source Ch 0 cycle per cycle"
+setaxelabels "Freq. (MHz)" "I (a.u)"
+
+
+newwin 1 1
+graphicatt "xylimits=1250,1500,-0.01,0.01"
+del sc1v1
+objaoper redMeanONOFFRaw1 row 1 sc1v1
+plot2d sc1v1 (n/32)*250+1250 val n>0 "$cols[0] marker=fcircle,7 nsta notit"
+for ic 2:${lastP1cycle}
+    k = ${ic}-floor(${ic}/${#cols})*${#cols}
+    del sc${ic}v1
+    objaoper redMeanONOFFRaw${ic} row 1 sc${ic}v1	
+    plot2d sc${ic}v1 (n/32)*250+1250 val n>0 "same $cols[k] marker=fcircle,7 nsta notit"
+end
+settitle "ON-OFF Mean 32bins $source Ch 1 cycle per cycle"
+setaxelabels "Freq. (MHz)" "I (a.u)"
+
+
+#endif
+
+#####################################
+#Plots RAW ON-OFF  SIGMA REDUCED  chan 0 & 1 separaed and cycle per cycle 
+#####################################
+
+
+#if ( $showFigs[4] == 1 ) then
+echo "Figure 5.........."
+
+newwin 1 1
+graphicatt "xylimits=1250,1500,0,0.01"
+del sc1v0
+objaoper redSigmaONOFFRaw1 row 0 sc1v0
+plot2d sc1v0 (n/32)*250+1250 val n>0 "$cols[0] marker=fcircle,7  nsta notit"
+for ic 2:${lastP1cycle}
+    k = ${ic}-floor(${ic}/${#cols})*${#cols}
+    del sc${ic}v0
+    objaoper redSigmaONOFFRaw${ic} row 0 sc${ic}v0	
+    plot2d sc${ic}v0 (n/32)*250+1250 val n>0 "same $cols[k] marker=fcircle,7 nsta notit"
+end
+settitle "ON-OFF Sigma over 32bins $source Ch 0 cycle per cycle"
+setaxelabels "Freq. (MHz)" "I (a.u)"
+
+newwin 1 1
+graphicatt "xylimits=1250,1500,0,0.01"
+del sc1v1
+objaoper redSigmaONOFFRaw1 row 1 sc1v1
+plot2d sc1v1 (n/32)*250+1250 val n>0 "$cols[0] marker=fcircle,7 nsta notit"
+for ic 2:${lastP1cycle}
+    k = ${ic}-floor(${ic}/${#cols})*${#cols}
+    del sc${ic}v1
+    objaoper redSigmaONOFFRaw${ic} row 1 sc${ic}v1	
+    plot2d sc${ic}v1 (n/32)*250+1250 val n>0 "same $cols[k] marker=fcircle,7 nsta notit"
+end
+settitle "ON-OFF Sigma over 32bins $source Ch 1 cycle per cycle"
+setaxelabels "Freq. (MHz)" "I (a.u)"
+
+#endif
+
+#####################################
+#Plots RAW ON-OFF  MEAN REDUCED  chan 0 & 1 separaed ALL cycles 
+#####################################
+
+#if ( $showFigs[5] == 1 ) then
+echo "Figure 6.........."
+
+newwin 1 1
+graphicatt "xylimits=1250,1500,-0.01,0.01"
+del scallv0
+del scallv1
+
+objaoper redMeanONOFFRawAll row 0 scallv0
+objaoper redMeanONOFFRawAll row 1 scallv1
+plot2d scallv0 (n/32)*250+1250 val n>0 "blue marker=fcircle,7  nsta notit"
+plot2d scallv1 (n/32)*250+1250 val n>0 "red same marker=fcircle,7  nsta notit"
+settitle "ON-OFF Mean 32bins $source Ch 0 (blue) Ch 1 (red) All cycles"
+setaxelabels "Freq. (MHz)" "I (a.u)"
+
+#endif
+
+#####################################
+#Plots RAW ON-OFF  SIGMA REDUCED  chan 0 & 1 separaed and cycle per cycle 
+#####################################
+
+
+#if ( $showFigs[5] == 1 ) then
+echo "Figure 6.........."
+
+newwin 1 1
+graphicatt "xylimits=1250,1500,0,0.01"
+del scallv0
+del scallv1
+objaoper redSigmaONOFFRawAll row 0 scallv0
+objaoper redSigmaONOFFRawAll row 1 scallv1
+plot2d scallv0 (n/32)*250+1250 val n>0 "blue marker=fcircle,7  nsta notit"
+plot2d scallv1 (n/32)*250+1250 val n>0 "red same marker=fcircle,7  nsta notit"
+settitle "ON-OFF Sigma over 32bins $source Ch 0 (blue) Ch 1 (red) All cycles"
+setaxelabels "Freq. (MHz)" "I (a.u)"
+
+#endif
Index: /BAORadio/AmasNancay/hisold.pic
===================================================================
--- /BAORadio/AmasNancay/hisold.pic	(revision 525)
+++ /BAORadio/AmasNancay/hisold.pic	(revision 525)
@@ -0,0 +1,1 @@
+exec etude_rawonoff
Index: /BAORadio/AmasNancay/history.pic
===================================================================
--- /BAORadio/AmasNancay/history.pic	(revision 525)
+++ /BAORadio/AmasNancay/history.pic	(revision 525)
@@ -0,0 +1,12 @@
+exec etude_rawonoff
+delobjs *
+exec etude_rawonoff
+delobjs *
+exec etude_rawonoff
+delobjs *
+del *
+exec etude_rawonoff
+ls
+del *
+delobjs *
+exec etude_rawonoff
