Changeset 2361 in Sophya
- Timestamp:
- Apr 17, 2003, 3:47:34 PM (22 years ago)
- Location:
- trunk/ArchTOIPipe
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/fitsringrdr.cc
r2360 r2361 2 2 // Christophe Magneville 3 3 // Reza Ansari 4 // $Id: fitsringrdr.cc,v 1. 4 2003-04-04 14:17:03cecile Exp $4 // $Id: fitsringrdr.cc,v 1.5 2003-04-17 13:47:34 cecile Exp $ 5 5 6 6 #include "fitsringrdr.h" … … 74 74 void FITSRingReader::init() { 75 75 76 declareOutput("CircTheta");77 declareOutput("CircPhi");78 76 declareOutput("signal"); 79 openFile(fname); 77 openFile(fname); 80 78 } 81 79 … … 121 119 122 120 void FITSRingReader::run() { 121 cout << "!!!!!!! RING " << endl; 123 122 124 123 fits_lock(); … … 142 141 fits_read_key(fptr, TDOUBLE, "CIRPHI", &phi, commt, &fstatus); 143 142 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); 145 144 fits_unlock(); 146 wontNeedBefore(ring* nSamples);145 wontNeedBefore(ring*(nSamples+2)); 147 146 cout << "!!!!!!! RING " << ring << endl; 148 147 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(); 149 153 for (int i=0; i<nSamples; i++) { 150 double data;151 154 fits_lock(); 152 155 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); 156 157 fits_unlock(); 157 158 } -
trunk/ArchTOIPipe/Kernel/fitsringwtr.cc
r2355 r2361 4 4 // Christophe Magneville 5 5 // Reza Ansari 6 // $Id: fitsringwtr.cc,v 1. 6 2003-03-28 16:06:40cecile Exp $6 // $Id: fitsringwtr.cc,v 1.7 2003-04-17 13:47:34 cecile Exp $ 7 7 8 8 #include "fitsringwtr.h" … … 40 40 41 41 void FITSRingWriter::init() { 42 declareInput("CircTheta");43 declareInput("CircPhi");44 42 declareInput("signal"); 45 43 } … … 59 57 fits_write_key(fptr, TLONG, "NCIRCLES", &nRings, "Number of rings", &fstatus); 60 58 fits_unlock(); 61 59 62 60 char* ttype = "DATA"; 63 61 char* tform = "1D"; … … 67 65 sprintf(xname, "CRING_%d", ring); 68 66 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); 71 70 72 71 fits_lock(); … … 79 78 fits_write_key(fptr, TLONG, "NSAMPLES", &nSamples, "Number of samples on the circle", &fstatus); 80 79 fits_unlock(); 81 wontNeedBefore(ring*nSamples);82 80 81 cout << nSamples << " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << endl; 82 83 83 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; 85 86 fits_lock(); 86 87 fits_write_col(fptr, TDOUBLE, 1,i+1,1,1, &data, &fstatus); -
trunk/ArchTOIPipe/ProcWSophya/ring2cout.cc
r2360 r2361 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: ring2cout.cc,v 1. 4 2003-04-04 14:17:37cecile Exp $5 // $Id: ring2cout.cc,v 1.5 2003-04-17 13:47:34 cecile Exp $ 6 6 7 7 #include "toimanager.h" … … 33 33 void Ring2cout::init() { 34 34 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 38 36 } 39 37 … … 46 44 47 45 cout << " ring " << Nrings << " ns " << Nsamples<< endl; 48 double ctheta[Nsamples],cphi[Nsamples],val[Nsamples];46 double val[Nsamples]; 49 47 for (int k=0; k<Nrings; k++) { 50 48 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); 54 53 mSnRead ++; 55 54 56 55 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; 59 58 60 59 } -
trunk/ArchTOIPipe/ProcWSophya/ring2cout.h
r2354 r2361 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: ring2cout.h,v 1. 2 2003-03-26 09:48:53cecile Exp $7 // $Id: ring2cout.h,v 1.3 2003-04-17 13:47:34 cecile Exp $ 8 8 9 9 #ifndef TOI2RING_H … … 17 17 class Ring2cout : public TOIProcessor { 18 18 public: 19 Ring2cout(long n );19 Ring2cout(long ns,long nr); 20 20 virtual ~Ring2cout(); 21 21 22 22 inline void setNSamples( long n=1024) 23 23 {Nsamples = n;} 24 25 inline void setNRings( long n=1) 26 {Nrings = n;} 24 27 25 28 virtual void init(void); … … 31 34 void Print(::ostream & os); 32 35 inline long ProcessedSampleCount() const { return totnscount; } 33 inline long ProcessedRingCount() const { return nRings; }36 inline long ProcessedRingCount() const { return Nrings; } 34 37 35 38 protected: 36 39 long Nsamples; 37 40 long totnscount; 38 long nRings;41 long Nrings; 39 42 40 43 }; -
trunk/ArchTOIPipe/ProcWSophya/toi2ring.cc
r2355 r2361 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: toi2ring.cc,v 1. 5 2003-03-28 16:06:17cecile Exp $5 // $Id: toi2ring.cc,v 1.6 2003-04-17 13:47:34 cecile Exp $ 6 6 7 7 #include "toimanager.h" … … 33 33 cout << "Toi2RING::init" << endl; 34 34 declareInput("Theta"); // input index 0 35 declareInput("Phi"); // input index 135 declareInput("Phi"); // input index 1 36 36 declareInput("Phase"); // input index 2 37 37 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 44 40 } 45 41 … … 91 87 // if (k==sne) { wfits.setNRings(Nrings); wwfits.setNRings(Nrings);} 92 88 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; 93 94 for(i=0;i<Nsamples;i++) { 94 95 if(wr[i] == 0) r[i] = -999999.; 95 96 else r[i] /= wr[i]; 96 97 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]); 103 100 wr[i]=0; 104 101 r[i]=0.; -
trunk/ArchTOIPipe/TestPipes/tstring2cout.cc
r2356 r2361 21 21 void usage(void); 22 22 void usage(void) { 23 cout<<"tsttoi2ring fitsin_ring "<<endl;23 cout<<"tsttoi2ring fitsin_ring Nrings"<<endl; 24 24 return; 25 25 } … … 35 35 bool snimplicit = false; 36 36 37 if(narg != 2) {usage(); exit(2);} 38 char * fitsin_ring = arg[1]; 37 if(narg != 3) {usage(); exit(2);} 38 char * fitsin_ring = arg[1]; 39 long nr=atoi(arg[2]); 39 40 40 41 41 cout<<">>>> tsttoi2ring:"<<endl; 42 42 cout<<"Fits Infile Value "<<fitsin_ring<<endl; … … 55 55 // FITS reader et writer 56 56 FITSRingReader rfitsr(fitsin_ring); 57 rfitsr.setNRings(nr); 58 57 59 58 60 // TOI Processor 59 Ring2cout ring2p(1024 );61 Ring2cout ring2p(1024,nr); 60 62 cout<<"RING2cout created"<<endl; 61 63 … … 63 65 // Definition des tuyaux 64 66 65 plombier.Connect(rfitsr,"CircTheta",ring2p,"Theta");66 plombier.Connect(rfitsr,"CircPhi",ring2p,"Phi");67 67 plombier.Connect(rfitsr,"signal",ring2p,"Phase"); 68 68 -
trunk/ArchTOIPipe/TestPipes/tsttoi2ring.cc
r2355 r2361 107 107 cout<<"file out "<<fitsout_value<< endl; 108 108 109 plombier.Connect(m2ring,"CircTheta",wfits,"CircTheta");110 plombier.Connect(m2ring,"CircPhi",wfits,"CircPhi");111 109 plombier.Connect(m2ring,"Rvalue",wfits,"signal"); 112 113 plombier.Connect(m2ring,"WCircTheta",wwfits,"CircTheta");114 plombier.Connect(m2ring,"WCircPhi",wwfits,"CircPhi");115 110 plombier.Connect(m2ring,"WRvalue",wwfits,"signal"); 116 111
Note:
See TracChangeset
for help on using the changeset viewer.