Changeset 3966 in Sophya for trunk/AddOn


Ignore:
Timestamp:
Mar 4, 2011, 6:16:35 PM (15 years ago)
Author:
ansari
Message:

Ajout calcul module2 moyenne ds visfits2dt.cc, Cedric+Reza, 04/03/2011

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AddOn/TAcq/visfits2dt.cc

    r3965 r3966  
    161161
    162162  vector< TMatrix< r_4 > > vmtf;
     163  vector< TMatrix< r_4 > > vmtfa;
    163164
    164165  if (jf1<1)  jf1=1;
     
    194195    FitsInOutFile fin(fname, FitsInOutFile::Fits_RO);
    195196    TMatrix< r_4 > vismtx;
     197
    196198    fin >> vismtx;
    197199    //    cout << vismtx.Info();
     
    201203      cout << " ProcVisMtxFiles/Info: Output Time-Frequency matrices NRows(time) "
    202204           << nrows/mtf_bintime+1 << " NCols=2*NFreq) =" << nfreq << endl;
    203       for(size_t j=0; j<rowlist.size(); j++)  
     205      for(size_t j=0; j<rowlist.size(); j++) {
    204206        vmtf.push_back(TMatrix< r_4 >(nrows/mtf_bintime+1, nfreq*2));
     207        vmtfa.push_back(TMatrix< r_4 >(nrows/mtf_bintime+1, nfreq));
     208      }
    205209    }
    206210
     
    213217          vmtf[j](ktime/mtf_bintime,jfreb*2)+=vismtx(rowlist[j],jf*2); // partie reelle
    214218          vmtf[j](ktime/mtf_bintime,jfreb*2+1)+=vismtx(rowlist[j],jf*2+1); // partie imaginaire
     219          vmtfa[j](ktime/mtf_bintime,jfreb)+=vismtx(rowlist[j],jf*2)*vismtx(rowlist[j],jf*2); // module carre - z.real^2
     220          vmtfa[j](ktime/mtf_bintime,jfreb)+=vismtx(rowlist[j],jf*2+1)*vismtx(rowlist[j],jf*2+1); // module carre z.imag^2
    215221        }
    216222      }
     
    233239      fo << vmtf[j];
    234240    }
     241    sprintf(fname, "!%s/acortfreqmtx.fits",inoutpath.c_str());
     242    cout << "ProcVisMtxFiles: Opening file " << fname << " for writing Visi(Freq,Time) matrices" << endl; 
     243    FitsInOutFile foa(fname, FitsInOutFile::Fits_Create);
     244    for(size_t j=0; j<rowlist.size(); j++)  {
     245      cout << " Writing Time-Freq modulesquare matrix[" << j << "] for Mod2IJ= " << chanum(rowlist[j]) << endl;
     246      foa << vmtfa[j];
     247    }
     248
    235249  }
    236250  if (fgfilldt)  {
Note: See TracChangeset for help on using the changeset viewer.