Index: trunk/AddOn/TAcq/dispbrpfft.pic
===================================================================
--- trunk/AddOn/TAcq/dispbrpfft.pic	(revision 3593)
+++ trunk/AddOn/TAcq/dispbrpfft.pic	(revision 3610)
@@ -5,16 +5,16 @@
 delobjs *
 set sigo signal0
-set basedir /Raid/TestNancay_6avril2009/
+set basedir /Raid/
 # set file TestFFT_$1/$sigo.fits
-set file $basedir/FFT_$1/$sigo.fits
+set file $basedir/$1/$sigo.fits
 echo '----> Opening file ' $file
 readfits $file
 
 listobjs 
-set cutrow (r<1)
+set cutrow (r<1000)
+set cutrowpt (r<5)
 set cutcol (c<5000)
 # sval=val a cause du c++exec
 #set sval ((val<127.5)?val:val-256.)
-set sval val
 if ( $# > 1 )  then 
   set cutrow $2
@@ -26,9 +26,29 @@
 echo ' ---- CutCol= ' $cutcol ' PAS UTILISE'
 
-set sval ((val<127.5)?val:val-256.)
 mv ${sigo} sigdum
+#c++exec \
+#for(int i=0;i<sigdum.Size();i++)  sigdum[i] = (sigdum[i]<127.5)?sigdum[i]:sigdum[i]-256.; 
+#      
+#      
+
 c++exec \
-for(int i=0;i<sigdum.Size();i++)  sigdum[i] = (sigdum[i]<127.5)?sigdum[i]:sigdum[i]-256.;
+  Vector cumulsq(sigdum.NCols()); cumulsq=0; \
+  TVector<int_8> cumul(sigdum.NCols()); cumul=0; \
+  TVector<int_4> nbzero(sigdum.NCols()); nbzero=0; \
+  TVector<int_8> cumulnz(sigdum.NCols()); cumulnz=0; \
+  for(int j=0; j<sigdum.NRows(); j++)  \
+    for(int i=0; i<sigdum.NCols(); i++) { \
+      cumul(i) += sigdum(j,i); \
+      if (sigdum(j,i)==0)  nbzero(i)++; \
+      else cumulnz(i) += sigdum(j,i); \
+      sigdum(j,i) = (sigdum(j,i)<127.5)?sigdum(j,i):sigdum(j,i)-256.; \ 
+      cumulsq(i) += sigdum(j,i)*sigdum(j,i); \
+    } \ 
+  cumul.Info()["NFRAME"] = cumulnz.Info()["NFRAME"] = nbzero.Info()["NFRAME"] = cumulsq.Info()["NFRAME"] = sigdum.NRows(); \
+  KeepObj(cumul);   KeepObj(cumulsq); \   
+  KeepObj(cumulnz);   KeepObj(nbzero);
+
 mv sigdum ${sigo}
+set sval val
 
 setaxesatt 'font=helvetica,bold,16 autofontsize=0.05 minorticks'
@@ -47,5 +67,4 @@
 fmin = -0.5*500./8192.
 #  FFT8K -> N=8192 echantillons en temps ==> N/2 frequences
-
 
 ntimesample = 8192
@@ -79,12 +98,57 @@
 endscript 
 
-plot2d $sigo c val ${cutrow}&&c>23 'blue font=helvetica,bold,16 fixedfontsize win'
+# plot2d $sigo c val $cutrowpt&&c>23 'blue font=helvetica,bold,16 fixedfontsize win'
 settitle  "Aff. frame data $1" ' ' 'font=helvetica,bold,16'
 
 zone 2 2 
-faithisto 1
-faithisto 2
+#faithisto 1
+#faithisto 2
+
+defscript rawproj 
+  zone
+  nrawmax = 24+8192*2
+  rawmax = 24+8192*2-0.5
+  newh1d rawproj -0.5 $rawmax $nrawmax
+  projh1d rawproj $sigo c $sval*$sval ${cutrow}
+  n/plot rawproj.val%i ! ! "marker=cross,5"
+endscript
+
+defscript ifreqpos
+set nf $1
+f = $nf * 500./8192.
+pic1 = 24+2*$nf
+pic2 = 24+8192+2*$nf
+echo bin freq $f nfreq $nf pics V1 $pic1 V2 $pic2
+endscript
+
+defscript freqpos
+set f $1
+nf = $f/(500./8192.)
+pic1 = 24+2*$nf
+pic2 = 24+8192+2*$nf
+echo bin freq $f nfreq $nf pics V1 $pic1 V2 $pic2
+endscript
 
 #n/plot specV1.10*log10(val)%x val>0
 #n/plot specV2.10*log10(val)%x val>0
 #disp signal0 "lut=lin,-1,1 imagecenter=4120,20"
+
+
+defscript ckzeros 
+  c++exec for(int i=0; i<cumul.Size(); i++) \
+    if (cumul(i)<10) cout << " --ZERO: i=" << i << " i-24=" << i-24 \
+      << " cum(i)=" << cumul(i) << " i-24-4096=" << i-24-4096 \
+      << " i-24-8192=" << i-24-8192 << " i-24-8192-4096=" << i-24-8192-4096 << endl; \
+  int_4 nframe = nbzero.Info()["NFRAME"]; \
+  for(int i=0; i<nbzero.Size(); i++) \
+    if (nbzero(i) > 95*nframe/100)  cout << " --NbZero: i=" << i << " i-24=" << i-24 \
+      << " nbzero(i)=" << nbzero(i) << " /NFrame= " << nframe << " i-24-4096=" << i-24-4096 \
+      << " i-24-8192=" << i-24-8192 << " i-24-8192-4096=" << i-24-8192-4096 << endl; 
+endscript
+
+zone 
+disp cumulsq 'blue marker=cross,5'
+
+echo '---- Scripts utiles definis : '
+echo 'ifreqpos numero_frequence , freqpos frequence , ckzeros'
+
Index: trunk/AddOn/TAcq/mfits2spec.cc
===================================================================
--- trunk/AddOn/TAcq/mfits2spec.cc	(revision 3593)
+++ trunk/AddOn/TAcq/mfits2spec.cc	(revision 3610)
@@ -238,5 +238,5 @@
     tm.Split();
     cout << "---- FIN lecture " << ffname << " NFileOK=" << nfileok << endl; 
-    cout << "  TotalDiskRead" << totnbytesrd/(1024*1024) << " MBytes Disk-Read rate= " 
+    cout << "  TotalDiskRead= " << totnbytesrd/(1024*1024) << " MBytes Disk-Read rate= " 
          << (double)(nbytesrd)/(1024.*1024.)/tm.PartialCPUTime() << " MB/s" << endl;    
   }   
@@ -330,5 +330,5 @@
     tm.Split();
     cout << "---- FIN lecture " << ffname << " NFileOK=" << nfileok << endl; 
-    cout << "  TotalDiskRead" << totnbytesrd/(1024*1024) << " MBytes Disk-Read rate= " 
+    cout << "  TotalDiskRead= " << totnbytesrd/(1024*1024) << " MBytes Disk-Read rate= " 
          << (double)(nbytesrd)/(1024.*1024.)/tm.PartialCPUTime() << " MB/s" << endl;    
   }  
@@ -436,5 +436,5 @@
     tm.Split();
     cout << "---- FIN lecture " << ffname << " NFileOK=" << nfileok << endl; 
-    cout << "  TotalDiskRead" << totnbytesrd/(1024*1024) << " MBytes Disk-Read rate= " 
+    cout << "  TotalDiskRead= " << totnbytesrd/(1024*1024) << " MBytes Disk-Read rate= " 
          << (double)(nbytesrd)/(1024.*1024.)/tm.PartialCPUTime() << " MB/s" << endl;    
   }  
