Index: /trunk/ArchTOIPipe/Kernel/fitsringrdr.cc
===================================================================
--- /trunk/ArchTOIPipe/Kernel/fitsringrdr.cc	(revision 2360)
+++ /trunk/ArchTOIPipe/Kernel/fitsringrdr.cc	(revision 2361)
@@ -2,5 +2,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: fitsringrdr.cc,v 1.4 2003-04-04 14:17:03 cecile Exp $
+// $Id: fitsringrdr.cc,v 1.5 2003-04-17 13:47:34 cecile Exp $
 
 #include "fitsringrdr.h"
@@ -74,8 +74,6 @@
 void FITSRingReader::init() {
 
-  declareOutput("CircTheta");
-  declareOutput("CircPhi");
   declareOutput("signal");
-  openFile(fname);
+  openFile(fname);  
 }
 
@@ -121,4 +119,5 @@
 
 void FITSRingReader::run() {
+    cout << "!!!!!!! RING " <<  endl;
 
   fits_lock();
@@ -142,16 +141,18 @@
     fits_read_key(fptr, TDOUBLE, "CIRPHI", &phi, commt, &fstatus);
     fits_read_key(fptr, TDOUBLE, "CIRAPER", &aperture, commt, &fstatus);
-    fits_read_key(fptr, TLONG, "NSAMPLES", &nSamples, commt, &fstatus);
+    fits_read_key(fptr, TLONG,   "NSAMPLES", &nSamples, commt, &fstatus);
     fits_unlock();
-    wontNeedBefore(ring*nSamples);
+    wontNeedBefore(ring*(nSamples+2));
     cout << "!!!!!!! RING " << ring << endl;
     
+    double data;
+    fits_lock();
+    putData(0, ring*(nSamples+2)+0,theta);
+    putData(0, ring*(nSamples+2)+1,phi);
+    fits_unlock();      
     for (int i=0; i<nSamples; i++) {
-      double data;
       fits_lock();
       fits_read_col_dbl(fptr,1,i+1,1,1,0,&data,&anyNul,&fstatus);
-      putData(0, ring*nSamples+i,theta);
-      putData(1, ring*nSamples+i,phi);
-      putData(2, ring*nSamples+i,data);
+      putData(0, ring*(nSamples+2)+2+i,data);
       fits_unlock();      
     }
Index: /trunk/ArchTOIPipe/Kernel/fitsringwtr.cc
===================================================================
--- /trunk/ArchTOIPipe/Kernel/fitsringwtr.cc	(revision 2360)
+++ /trunk/ArchTOIPipe/Kernel/fitsringwtr.cc	(revision 2361)
@@ -4,5 +4,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: fitsringwtr.cc,v 1.6 2003-03-28 16:06:40 cecile Exp $
+// $Id: fitsringwtr.cc,v 1.7 2003-04-17 13:47:34 cecile Exp $
 
 #include "fitsringwtr.h"
@@ -40,6 +40,4 @@
 
 void FITSRingWriter::init() {
-  declareInput("CircTheta");
-  declareInput("CircPhi");
   declareInput("signal");
 }
@@ -59,5 +57,5 @@
   fits_write_key(fptr, TLONG,   "NCIRCLES", &nRings, "Number of rings", &fstatus);
   fits_unlock();
-  
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   char* ttype = "DATA";
   char* tform = "1D";
@@ -67,6 +65,7 @@
     sprintf(xname, "CRING_%d", ring);
 
-    double theta = getData(0, ring*nSamples);
-    double phi = getData(1, ring*nSamples);
+    wontNeedBefore(ring*(nSamples+2));
+    double theta = getData(0, ring*(nSamples+2)+0);
+    double phi   = getData(0, ring*(nSamples+2)+1);
 
     fits_lock();
@@ -79,8 +78,10 @@
     fits_write_key(fptr, TLONG, "NSAMPLES", &nSamples, "Number of samples on the circle", &fstatus);
     fits_unlock();
-    wontNeedBefore(ring*nSamples);
 
+    cout << nSamples << " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << endl;
+    
     for (int i=0; i<nSamples; i++) {
-      double data = getData(2, ring*nSamples+i);
+      double data = getData(0, ring*(nSamples+2)+2+i);
+      if (i > 1000) cout << i << " "  << data << endl;
       fits_lock();
       fits_write_col(fptr, TDOUBLE, 1,i+1,1,1, &data, &fstatus);
Index: /trunk/ArchTOIPipe/ProcWSophya/ring2cout.cc
===================================================================
--- /trunk/ArchTOIPipe/ProcWSophya/ring2cout.cc	(revision 2360)
+++ /trunk/ArchTOIPipe/ProcWSophya/ring2cout.cc	(revision 2361)
@@ -3,5 +3,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: ring2cout.cc,v 1.4 2003-04-04 14:17:37 cecile Exp $
+// $Id: ring2cout.cc,v 1.5 2003-04-17 13:47:34 cecile Exp $
 
 #include "toimanager.h"
@@ -33,7 +33,5 @@
 void Ring2cout::init() {
   cout << "Ring2cout::init" << endl;
-  declareInput("Theta");     // input  index 0
-  declareInput("Phi");     // input  index 1
-  declareInput("Phase");     // input  index 2
+  declareInput("Phase");     // input  index 0
 }
 
@@ -46,15 +44,16 @@
 
   cout << " ring " << Nrings << " ns " << Nsamples<< endl;
-  double ctheta[Nsamples],cphi[Nsamples],val[Nsamples];
+  double val[Nsamples];
   for (int k=0; k<Nrings; k++) {
     
-    getData(0,k*Nsamples,Nsamples,ctheta);
-    getData(1,k*Nsamples,Nsamples,cphi);
-    getData(2,k*Nsamples,Nsamples,val);
+    double theta= getData(0,k*(Nsamples+2)+0);
+    double phi  = getData(0,k*(Nsamples+2)+1);
+    cout << Nrings << " " << k <<" " <<theta <<" " <<phi<< endl;
+    getData(0,k*(Nsamples+2)+2,Nsamples,val);
     mSnRead ++;
     
     for (int i=0; i< Nsamples;i++)
-      cout << Nrings << " " << k <<" " << i <<" " << ctheta[i] << " " << cphi[i]<< " " << val[i]<< endl;
-    totnscount+=Nsamples;
+      cout <<  i << " " << val[i]<< endl;
+    totnscount+=Nsamples+2;
     
   }
Index: /trunk/ArchTOIPipe/ProcWSophya/ring2cout.h
===================================================================
--- /trunk/ArchTOIPipe/ProcWSophya/ring2cout.h	(revision 2360)
+++ /trunk/ArchTOIPipe/ProcWSophya/ring2cout.h	(revision 2361)
@@ -5,5 +5,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: ring2cout.h,v 1.2 2003-03-26 09:48:53 cecile Exp $
+// $Id: ring2cout.h,v 1.3 2003-04-17 13:47:34 cecile Exp $
 
 #ifndef TOI2RING_H
@@ -17,9 +17,12 @@
 class Ring2cout : public TOIProcessor {
 public:
-                 Ring2cout(long n);
+                 Ring2cout(long ns,long nr);
   virtual	~Ring2cout();
 
   inline void setNSamples( long n=1024)
               {Nsamples = n;}
+
+  inline void setNRings( long n=1)
+              {Nrings = n;}
 
   virtual void	init(void);
@@ -31,10 +34,10 @@
   void Print(::ostream & os);
   inline long 	ProcessedSampleCount() const { return totnscount; }
-  inline long	ProcessedRingCount() const { return nRings; }
+  inline long	ProcessedRingCount() const { return Nrings; }
 
 protected:
   long Nsamples;
   long totnscount;
-  long nRings;
+  long Nrings;
   
 };
Index: /trunk/ArchTOIPipe/ProcWSophya/toi2ring.cc
===================================================================
--- /trunk/ArchTOIPipe/ProcWSophya/toi2ring.cc	(revision 2360)
+++ /trunk/ArchTOIPipe/ProcWSophya/toi2ring.cc	(revision 2361)
@@ -3,5 +3,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: toi2ring.cc,v 1.5 2003-03-28 16:06:17 cecile Exp $
+// $Id: toi2ring.cc,v 1.6 2003-04-17 13:47:34 cecile Exp $
 
 #include "toimanager.h"
@@ -33,13 +33,9 @@
   cout << "Toi2RING::init" << endl;
   declareInput("Theta");     // input  index 0
-  declareInput("Phi");     // input  index 1
+  declareInput("Phi");       // input  index 1
   declareInput("Phase");     // input  index 2
   declareInput("Value");     // input  index 3
-  declareOutput("CircTheta");   // output index 0
-  declareOutput("CircPhi");   // output index 1
-  declareOutput("Rvalue");   // output index 2
-  declareOutput("WCircTheta");   // output index 3
-  declareOutput("WCircPhi");   // output index 4
-  declareOutput("WRvalue");   // output index 5
+  declareOutput("Rvalue");   // output index 0
+  declareOutput("WRvalue");  // output index 1
 }
 
@@ -91,14 +87,15 @@
     //  if (k==sne) { wfits.setNRings(Nrings); wwfits.setNRings(Nrings);}
     
+    putData(0,Nrings*(Nsamples+2)+0,ctheta_prec);
+    putData(1,Nrings*(Nsamples+2)+0,ctheta_prec);
+    putData(0,Nrings*(Nsamples+2)+1,cphi_prec);
+    putData(1,Nrings*(Nsamples+2)+1,cphi_prec);
+    cout << Nsamples << " !@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << endl;
     for(i=0;i<Nsamples;i++) {
       if(wr[i] == 0) r[i] = -999999.;
       else r[i] /= wr[i];
       
-      putData(0,Nrings*Nsamples+i,ctheta_prec);
-      putData(1,Nrings*Nsamples+i,cphi_prec);
-      putData(2,Nrings*Nsamples+i,r[i]);
-      putData(3,Nrings*Nsamples+i,ctheta_prec);
-      putData(4,Nrings*Nsamples+i,cphi_prec);
-      putData(5,Nrings*Nsamples+i,wr[i]);
+      putData(0,Nrings*(Nsamples+2)+2+i,r[i]);
+      putData(1,Nrings*(Nsamples+2)+2+i,wr[i]);
       wr[i]=0;
       r[i]=0.;
Index: /trunk/ArchTOIPipe/TestPipes/tstring2cout.cc
===================================================================
--- /trunk/ArchTOIPipe/TestPipes/tstring2cout.cc	(revision 2360)
+++ /trunk/ArchTOIPipe/TestPipes/tstring2cout.cc	(revision 2361)
@@ -21,5 +21,5 @@
 void usage(void);
 void usage(void) {
-  cout<<"tsttoi2ring fitsin_ring "<<endl;
+  cout<<"tsttoi2ring fitsin_ring Nrings"<<endl;
  return;
 }
@@ -35,8 +35,8 @@
 bool snimplicit = false;
 
-if(narg != 2) {usage(); exit(2);}
-char * fitsin_ring    = arg[1];
+if(narg != 3) {usage(); exit(2);}
+ char * fitsin_ring    = arg[1];
+ long nr=atoi(arg[2]);
  
-
  cout<<">>>> tsttoi2ring:"<<endl;
 cout<<"Fits Infile Value "<<fitsin_ring<<endl;
@@ -55,7 +55,9 @@
  // FITS reader et writer
  FITSRingReader rfitsr(fitsin_ring);
+ rfitsr.setNRings(nr);
+
 
  // TOI Processor
- Ring2cout ring2p(1024);
+ Ring2cout ring2p(1024,nr);
  cout<<"RING2cout created"<<endl;
 
@@ -63,6 +65,4 @@
  // Definition des tuyaux
  
- plombier.Connect(rfitsr,"CircTheta",ring2p,"Theta");
- plombier.Connect(rfitsr,"CircPhi",ring2p,"Phi");
  plombier.Connect(rfitsr,"signal",ring2p,"Phase");
 
Index: /trunk/ArchTOIPipe/TestPipes/tsttoi2ring.cc
===================================================================
--- /trunk/ArchTOIPipe/TestPipes/tsttoi2ring.cc	(revision 2360)
+++ /trunk/ArchTOIPipe/TestPipes/tsttoi2ring.cc	(revision 2361)
@@ -107,10 +107,5 @@
  cout<<"file out "<<fitsout_value<< endl;
 
- plombier.Connect(m2ring,"CircTheta",wfits,"CircTheta");
- plombier.Connect(m2ring,"CircPhi",wfits,"CircPhi");
  plombier.Connect(m2ring,"Rvalue",wfits,"signal");
-
- plombier.Connect(m2ring,"WCircTheta",wwfits,"CircTheta");
- plombier.Connect(m2ring,"WCircPhi",wwfits,"CircPhi");
  plombier.Connect(m2ring,"WRvalue",wwfits,"signal"); 
 
