Changeset 3909 in Sophya for trunk/AddOn/TAcq/brviscalc.cc
- Timestamp:
- Nov 21, 2010, 2:26:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/brviscalc.cc
r3895 r3909 32 32 33 33 uint_4 maxnpairs = (2*memgr_.NbFibres()+1)*memgr_.NbFibres(); 34 chanum_.SetSize(maxnpairs); 35 sa_size_t k=0; 36 for(size_t i=0; i<2*memgr_.NbFibres(); i++) vpdata_[i]=NULL; 37 for(size_t i=0; i<2*memgr_.NbFibres(); i++) { 38 for(size_t j=i; j<2*memgr_.NbFibres(); j++) { 39 chanum_(k) = (i+1)*100+(j+1); k++; 40 } 41 } 34 chanids_.SetSize(2*memgr_.NbFibres()); 35 chanpairnumall_.SetSize(maxnpairs); 36 chanpairsall_.SetSize(maxnpairs,2); 37 for(size_t i=0; i<2*memgr_.NbFibres(); i++) vpdata_[i]=NULL; 42 38 SelectPairs(); 43 39 … … 82 78 po << visdt_; 83 79 if (calcid_ == 0) { 84 POutPersist poc(outpath_+"chanum.ppf");85 poc << chanum_;86 80 87 81 if (fgcktt_) { … … 130 124 nbpairs_=nbpairs; 131 125 vismtx_.SetSize(nbpairs_, paq.DataSize()/4); 126 127 chanpairnum_.SetSize(nbpairs_); 128 chanpairs_.SetSize(nbpairs_,2); 129 132 130 return nbpairs_; 133 131 } … … 147 145 } 148 146 147 /* --Methode-- */ 148 void BRVisibilityCalculator::UpdateChanIds() 149 { 150 151 for(size_t i=0; i<memgr_.NbFibres(); i++) { 152 chanids_(2*i)=memgr_.FiberId(i)*2-1; 153 chanids_(2*i+1)=memgr_.FiberId(i)*2; 154 } 155 sa_size_t k=0; // numero de ligne dans la matrice des visibilites 156 for(size_t i=0; i<vpdata_.size(); i++) { 157 for(size_t j=i; j<vpdata_.size(); j++) { 158 chanpairnumall_(k)=chanids_(i)*CHANPAIRCONVFAC+chanids_(j); 159 chanpairsall_(k,0)=chanids_(i); chanpairsall_(k,1)=chanids_(j); k++; 160 } 161 } 162 sa_size_t kpair=0; 163 k=0; // numero de ligne dans la matrice des visibilites 164 for(size_t i=0; i<vpdata_.size(); i++) { 165 for(size_t j=i; j<vpdata_.size(); j++) { 166 kpair++; 167 if (kpair<(pairst_+1)) continue; 168 if (kpair>=(pairst_+nbpairs_+1)) break; 169 chanpairnum_(k)=chanids_(i)*CHANPAIRCONVFAC+chanids_(j); 170 chanpairs_(k,0)=chanids_(i); chanpairs_(k,1)=chanids_(j); k++; 171 } 172 } 173 174 string filename; 175 filename = outpath_+"chanum.ppf"; 176 if (nbcalc_>1) { 177 char sbuff[32]; 178 sprintf(sbuff,"chanum_%d.ppf",(int)calcid_); 179 filename = outpath_+sbuff; 180 } 181 POutPersist poc(outpath_+"chanum.ppf"); 182 poc << PPFNameTag("chanids") << chanids_; 183 poc << PPFNameTag("chanpairs") << chanpairs_; 184 poc << PPFNameTag("chanpairnum") << chanpairnum_; 185 poc << PPFNameTag("chanpairsall") << chanpairsall_; 186 poc << PPFNameTag("chanpairnumal") << chanpairnumall_; 187 cout << "BRVisibilityCalculator::UpdateChanIds() Channel Ids/Pairs saved to PPF file " << filename << endl; 188 return; 189 } 149 190 150 191 /* --Methode-- */ … … 207 248 break; 208 249 } 250 cts_=memgr_.GetAuxData(mid)->FillTime(); // get associated date/time (DATEOBS) 251 209 252 for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) { 210 253 fbuff_[fib] = memgr_.GetMemZone(mid,fib); … … 238 281 vismtx_ = complex<r_4>((r_4)0.,(r_4)0.); 239 282 moyfc_=moytt_=0.; 240 first_tmstamp_.SetNow(); // Current date and time 283 // first_tmstamp_.SetNow(); // Current date and time 284 first_tmstamp_=cts_; // Current date and time 241 285 } 242 286 … … 326 370 first_fc_=curfc_[0]; 327 371 first_tt_= (vpaq_[0].TimeTag()-ttfirst_[0]); 328 first_tmstamp_.SetNow(); // Current date and time 372 // first_tmstamp_.SetNow(); // Current date and time 373 first_tmstamp_=cts_; // Current date and time 329 374 } 330 375 … … 439 484 for(sa_size_t jf=jf1_; jf<jf2_; jf++) { 440 485 xnt[2]=jf; 441 xnt[3]=chan um_(rv+pairst_);486 xnt[3]=chanpairnumall_(rv+pairst_); 442 487 xnt[4]=vismtx_(rv,jf).real()/(r_4)(nmean_); 443 488 xnt[5]=vismtx_(rv,jf).imag()/(r_4)(nmean_); … … 458 503 } 459 504 xnt[2]=jf+djf_/2; 460 xnt[3]=chan um_(rv+pairst_);505 xnt[3]=chanpairnumall_(rv+pairst_); 461 506 xnt[4]=moyreal/(r_4)(nmean_*djf_); 462 507 xnt[5]=moyimag/(r_4)(nmean_*djf_);
Note:
See TracChangeset
for help on using the changeset viewer.