Changeset 2361 in Sophya for trunk/ArchTOIPipe


Ignore:
Timestamp:
Apr 17, 2003, 3:47:34 PM (22 years ago)
Author:
cecile
Message:

nouveaux tuyaux de ring : theta, phi puis Nsamples mesures

Location:
trunk/ArchTOIPipe
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/fitsringrdr.cc

    r2360 r2361  
    22//                               Christophe Magneville
    33//                               Reza Ansari
    4 // $Id: fitsringrdr.cc,v 1.4 2003-04-04 14:17:03 cecile Exp $
     4// $Id: fitsringrdr.cc,v 1.5 2003-04-17 13:47:34 cecile Exp $
    55
    66#include "fitsringrdr.h"
     
    7474void FITSRingReader::init() {
    7575
    76   declareOutput("CircTheta");
    77   declareOutput("CircPhi");
    7876  declareOutput("signal");
    79   openFile(fname);
     77  openFile(fname); 
    8078}
    8179
     
    121119
    122120void FITSRingReader::run() {
     121    cout << "!!!!!!! RING " <<  endl;
    123122
    124123  fits_lock();
     
    142141    fits_read_key(fptr, TDOUBLE, "CIRPHI", &phi, commt, &fstatus);
    143142    fits_read_key(fptr, TDOUBLE, "CIRAPER", &aperture, commt, &fstatus);
    144     fits_read_key(fptr, TLONG, "NSAMPLES", &nSamples, commt, &fstatus);
     143    fits_read_key(fptr, TLONG,   "NSAMPLES", &nSamples, commt, &fstatus);
    145144    fits_unlock();
    146     wontNeedBefore(ring*nSamples);
     145    wontNeedBefore(ring*(nSamples+2));
    147146    cout << "!!!!!!! RING " << ring << endl;
    148147   
     148    double data;
     149    fits_lock();
     150    putData(0, ring*(nSamples+2)+0,theta);
     151    putData(0, ring*(nSamples+2)+1,phi);
     152    fits_unlock();     
    149153    for (int i=0; i<nSamples; i++) {
    150       double data;
    151154      fits_lock();
    152155      fits_read_col_dbl(fptr,1,i+1,1,1,0,&data,&anyNul,&fstatus);
    153       putData(0, ring*nSamples+i,theta);
    154       putData(1, ring*nSamples+i,phi);
    155       putData(2, ring*nSamples+i,data);
     156      putData(0, ring*(nSamples+2)+2+i,data);
    156157      fits_unlock();     
    157158    }
  • trunk/ArchTOIPipe/Kernel/fitsringwtr.cc

    r2355 r2361  
    44//                               Christophe Magneville
    55//                               Reza Ansari
    6 // $Id: fitsringwtr.cc,v 1.6 2003-03-28 16:06:40 cecile Exp $
     6// $Id: fitsringwtr.cc,v 1.7 2003-04-17 13:47:34 cecile Exp $
    77
    88#include "fitsringwtr.h"
     
    4040
    4141void FITSRingWriter::init() {
    42   declareInput("CircTheta");
    43   declareInput("CircPhi");
    4442  declareInput("signal");
    4543}
     
    5957  fits_write_key(fptr, TLONG,   "NCIRCLES", &nRings, "Number of rings", &fstatus);
    6058  fits_unlock();
    61  
     59                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
    6260  char* ttype = "DATA";
    6361  char* tform = "1D";
     
    6765    sprintf(xname, "CRING_%d", ring);
    6866
    69     double theta = getData(0, ring*nSamples);
    70     double phi = getData(1, ring*nSamples);
     67    wontNeedBefore(ring*(nSamples+2));
     68    double theta = getData(0, ring*(nSamples+2)+0);
     69    double phi   = getData(0, ring*(nSamples+2)+1);
    7170
    7271    fits_lock();
     
    7978    fits_write_key(fptr, TLONG, "NSAMPLES", &nSamples, "Number of samples on the circle", &fstatus);
    8079    fits_unlock();
    81     wontNeedBefore(ring*nSamples);
    8280
     81    cout << nSamples << " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << endl;
     82   
    8383    for (int i=0; i<nSamples; i++) {
    84       double data = getData(2, ring*nSamples+i);
     84      double data = getData(0, ring*(nSamples+2)+2+i);
     85      if (i > 1000) cout << i << " "  << data << endl;
    8586      fits_lock();
    8687      fits_write_col(fptr, TDOUBLE, 1,i+1,1,1, &data, &fstatus);
  • trunk/ArchTOIPipe/ProcWSophya/ring2cout.cc

    r2360 r2361  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: ring2cout.cc,v 1.4 2003-04-04 14:17:37 cecile Exp $
     5// $Id: ring2cout.cc,v 1.5 2003-04-17 13:47:34 cecile Exp $
    66
    77#include "toimanager.h"
     
    3333void Ring2cout::init() {
    3434  cout << "Ring2cout::init" << endl;
    35   declareInput("Theta");     // input  index 0
    36   declareInput("Phi");     // input  index 1
    37   declareInput("Phase");     // input  index 2
     35  declareInput("Phase");     // input  index 0
    3836}
    3937
     
    4644
    4745  cout << " ring " << Nrings << " ns " << Nsamples<< endl;
    48   double ctheta[Nsamples],cphi[Nsamples],val[Nsamples];
     46  double val[Nsamples];
    4947  for (int k=0; k<Nrings; k++) {
    5048   
    51     getData(0,k*Nsamples,Nsamples,ctheta);
    52     getData(1,k*Nsamples,Nsamples,cphi);
    53     getData(2,k*Nsamples,Nsamples,val);
     49    double theta= getData(0,k*(Nsamples+2)+0);
     50    double phi  = getData(0,k*(Nsamples+2)+1);
     51    cout << Nrings << " " << k <<" " <<theta <<" " <<phi<< endl;
     52    getData(0,k*(Nsamples+2)+2,Nsamples,val);
    5453    mSnRead ++;
    5554   
    5655    for (int i=0; i< Nsamples;i++)
    57       cout << Nrings << " " << k <<" " << i <<" " << ctheta[i] << " " << cphi[i]<< " " << val[i]<< endl;
    58     totnscount+=Nsamples;
     56      cout <<  i << " " << val[i]<< endl;
     57    totnscount+=Nsamples+2;
    5958   
    6059  }
  • trunk/ArchTOIPipe/ProcWSophya/ring2cout.h

    r2354 r2361  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: ring2cout.h,v 1.2 2003-03-26 09:48:53 cecile Exp $
     7// $Id: ring2cout.h,v 1.3 2003-04-17 13:47:34 cecile Exp $
    88
    99#ifndef TOI2RING_H
     
    1717class Ring2cout : public TOIProcessor {
    1818public:
    19                  Ring2cout(long n);
     19                 Ring2cout(long ns,long nr);
    2020  virtual       ~Ring2cout();
    2121
    2222  inline void setNSamples( long n=1024)
    2323              {Nsamples = n;}
     24
     25  inline void setNRings( long n=1)
     26              {Nrings = n;}
    2427
    2528  virtual void  init(void);
     
    3134  void Print(::ostream & os);
    3235  inline long   ProcessedSampleCount() const { return totnscount; }
    33   inline long   ProcessedRingCount() const { return nRings; }
     36  inline long   ProcessedRingCount() const { return Nrings; }
    3437
    3538protected:
    3639  long Nsamples;
    3740  long totnscount;
    38   long nRings;
     41  long Nrings;
    3942 
    4043};
  • trunk/ArchTOIPipe/ProcWSophya/toi2ring.cc

    r2355 r2361  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toi2ring.cc,v 1.5 2003-03-28 16:06:17 cecile Exp $
     5// $Id: toi2ring.cc,v 1.6 2003-04-17 13:47:34 cecile Exp $
    66
    77#include "toimanager.h"
     
    3333  cout << "Toi2RING::init" << endl;
    3434  declareInput("Theta");     // input  index 0
    35   declareInput("Phi");     // input  index 1
     35  declareInput("Phi");       // input  index 1
    3636  declareInput("Phase");     // input  index 2
    3737  declareInput("Value");     // input  index 3
    38   declareOutput("CircTheta");   // output index 0
    39   declareOutput("CircPhi");   // output index 1
    40   declareOutput("Rvalue");   // output index 2
    41   declareOutput("WCircTheta");   // output index 3
    42   declareOutput("WCircPhi");   // output index 4
    43   declareOutput("WRvalue");   // output index 5
     38  declareOutput("Rvalue");   // output index 0
     39  declareOutput("WRvalue");  // output index 1
    4440}
    4541
     
    9187    //  if (k==sne) { wfits.setNRings(Nrings); wwfits.setNRings(Nrings);}
    9288   
     89    putData(0,Nrings*(Nsamples+2)+0,ctheta_prec);
     90    putData(1,Nrings*(Nsamples+2)+0,ctheta_prec);
     91    putData(0,Nrings*(Nsamples+2)+1,cphi_prec);
     92    putData(1,Nrings*(Nsamples+2)+1,cphi_prec);
     93    cout << Nsamples << " !@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << endl;
    9394    for(i=0;i<Nsamples;i++) {
    9495      if(wr[i] == 0) r[i] = -999999.;
    9596      else r[i] /= wr[i];
    9697     
    97       putData(0,Nrings*Nsamples+i,ctheta_prec);
    98       putData(1,Nrings*Nsamples+i,cphi_prec);
    99       putData(2,Nrings*Nsamples+i,r[i]);
    100       putData(3,Nrings*Nsamples+i,ctheta_prec);
    101       putData(4,Nrings*Nsamples+i,cphi_prec);
    102       putData(5,Nrings*Nsamples+i,wr[i]);
     98      putData(0,Nrings*(Nsamples+2)+2+i,r[i]);
     99      putData(1,Nrings*(Nsamples+2)+2+i,wr[i]);
    103100      wr[i]=0;
    104101      r[i]=0.;
  • trunk/ArchTOIPipe/TestPipes/tstring2cout.cc

    r2356 r2361  
    2121void usage(void);
    2222void usage(void) {
    23   cout<<"tsttoi2ring fitsin_ring "<<endl;
     23  cout<<"tsttoi2ring fitsin_ring Nrings"<<endl;
    2424 return;
    2525}
     
    3535bool snimplicit = false;
    3636
    37 if(narg != 2) {usage(); exit(2);}
    38 char * fitsin_ring    = arg[1];
     37if(narg != 3) {usage(); exit(2);}
     38 char * fitsin_ring    = arg[1];
     39 long nr=atoi(arg[2]);
    3940 
    40 
    4141 cout<<">>>> tsttoi2ring:"<<endl;
    4242cout<<"Fits Infile Value "<<fitsin_ring<<endl;
     
    5555 // FITS reader et writer
    5656 FITSRingReader rfitsr(fitsin_ring);
     57 rfitsr.setNRings(nr);
     58
    5759
    5860 // TOI Processor
    59  Ring2cout ring2p(1024);
     61 Ring2cout ring2p(1024,nr);
    6062 cout<<"RING2cout created"<<endl;
    6163
     
    6365 // Definition des tuyaux
    6466 
    65  plombier.Connect(rfitsr,"CircTheta",ring2p,"Theta");
    66  plombier.Connect(rfitsr,"CircPhi",ring2p,"Phi");
    6767 plombier.Connect(rfitsr,"signal",ring2p,"Phase");
    6868
  • trunk/ArchTOIPipe/TestPipes/tsttoi2ring.cc

    r2355 r2361  
    107107 cout<<"file out "<<fitsout_value<< endl;
    108108
    109  plombier.Connect(m2ring,"CircTheta",wfits,"CircTheta");
    110  plombier.Connect(m2ring,"CircPhi",wfits,"CircPhi");
    111109 plombier.Connect(m2ring,"Rvalue",wfits,"signal");
    112 
    113  plombier.Connect(m2ring,"WCircTheta",wwfits,"CircTheta");
    114  plombier.Connect(m2ring,"WCircPhi",wwfits,"CircPhi");
    115110 plombier.Connect(m2ring,"WRvalue",wwfits,"signal");
    116111
Note: See TracChangeset for help on using the changeset viewer.