Changeset 3928 in Sophya


Ignore:
Timestamp:
Dec 17, 2010, 4:24:06 PM (15 years ago)
Author:
cmv
Message:

gestion de la conjugaison complexe pour visi # de <E.conj(W)>, cmv 17/12/2010

Location:
trunk/AddOn/TAcq
Files:
2 edited

Legend:

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

    r3927 r3928  
    1818#include "nbtrixx.h"
    1919
    20 // > chanum_1210 -f 1375.0610351 -o CasA02Dec.txt crt*/CasA02Dec/chanum_*.ppf
    21 // > chanum_1210 -f 1375.0610351 -o Crab03Dec.txt crt*/Crab03Dec/chanum_*.ppf
    22 // > chanum_1210 -f 1382.5378418 -o Sun03Dec.txt  crt*/Sun03Dec/chanum_*.ppf
    23 // > chanum_1210 -f 1390.0146484 -o CasA03Dec.txt crt*/CasA03Dec/chanum_*.ppf
     20// > chanum_1210 -f 1375.0610351 -o CasA02Dec.csh ../../crt*/PittsDec10/CasA02Dec/chanum_*.ppf
     21// > chanum_1210 -f 1375.0610351 -o Crab03Dec.csh ../../crt*/PittsDec10/Crab03Dec/chanum_*.ppf
     22// > chanum_1210 -f 1382.5378418 -o Sun03Dec.csh  ../../crt*/PittsDec10/Sun03Dec/chanum_*.ppf
     23// > chanum_1210 -f 1390.0146484 -o CasA03Dec.csh ../../crt*/PittsDec10/CasA03Dec/chanum_*.ppf
    2424
    2525int decode_numthread(string filein,string& dir);
     
    3131cout<<"Usage: chanum_1210 [options] chanum_?.ppf ..."<<endl
    3232    <<" -f F0MHz : 1ere frequence pour cette acquisition"<<endl
    33     <<" -o fichier.txt : nom du fichier de sortie pour les commandes a lancer"<<endl;
     33    <<" -o fichier.csh : nom du fichier de sortie pour les commandes a lancer"<<endl;
    3434}
    3535
     
    3737int main(int narg, char* arg[])
    3838{
    39   string outname = "chanum_1210.txt";
     39  string outname = "chanum_1210.csh";
    4040  double freq0 = 0.;
    4141
     
    9292  ofstream ftxt(outname.c_str(), ofstream::out);
    9393  cout<<"writing in "<<outname<<" (is_open="<<ftxt.is_open()<<")"<<endl;
     94  ftxt << "#!/bin/csh" <<endl;
    9495  if(!ftxt) {cout<<"!!!!OPENING failed "<<outname<<endl; return -3;}
    9596  int dupli = 0, ndupli = 0;
    9697  nvisi = 0;
    9798  for(uint_4 i=0;i<vcode.size();i++) {
    98     char str[128];
    99     sprintf(str,"${EXE}/svv2mtx2_1210 -T 0,99999 -F 0,9999,1 -f %.7f",freq0);
     99    char str[256];
     100    sprintf(str,"${TACQEXE}/svv2mtx2_1210 -T 0,99999 -F 0,8888,1 -f %.7f",freq0);
    100101    string argu = str;
    101102    uint_4 ip = IVcode(i);
     
    103104    uint_4 vcode_suiv = (i<vcode.size()-1) ? vcode[IVcode(i+1)]: 99999999;
    104105    uint_4 v1 = vcode[ip]/1000, v2 = vcode[ip]%100;
    105     if(v1>v2) {swap(v1,v2); argu += " -c";}  // faut-il conjuger ?
    106106    sprintf(str," -t %d",vnth[ip]); argu += str;  // numero de threads
    107107    sprintf(str," -r %d",vrow[ip]); argu += str;  // ligne de la matrice acq
     108    // L'acq fait: <v1.conj(v2)>
     109    // Si v1 et v2 sont de parites differentes donc de cylindres differents
     110    //   on veut toujours avoir une visi <E.conj(W)> cad <impair.conj(pair)>
     111    bool doconj = false;
     112    if( v1%2==0 && v2%2!=0 ) {argu += " -C"; doconj = true;}  // v1 pair et v2 impair
    108113    //  nom du fichier de sortie avec gestion des duplications
    109     if(vcode_suiv==vcode[ip] || vcode_prec!=vcode[ip]) argu += " -D";
    110     if(vcode_prec==vcode[ip]) { dupli++; argu += " -D"; }
    111         else { ndupli+=dupli; dupli=0; }
     114    if(vcode_suiv==vcode[ip] || vcode_prec==vcode[ip]) argu += " -D";
     115    if(vcode_prec==vcode[ip]) {
     116      dupli++;
     117      if(i==vcode.size()-1) ndupli += dupli;
     118    } else {
     119      ndupli += dupli;
     120      dupli = 0;
     121    }
    112122    sprintf(str," -o visi%d_%02d_%02d.ppf",dupli,v1,v2); argu += str;
    113123    argu += " "; argu += vdir[ip];  // repertoire des fichiers acq
    114124    ftxt << argu <<endl;
    115125    nvisi++;
    116     cout<<i<<" "<<ip<<" "<<vcode[ip]<<" "<<v1<<","<<v2<<" th="<<vnth[ip]<<" ro="<<vrow[ip]<<" du="<<dupli<<" "<<vdir[ip]<<endl;
     126    cout<<i<<" "<<ip<<" "<<vcode[ip]<<" "<<v1<<","<<v2<<" th="<<vnth[ip]<<" ro="<<vrow[ip]
     127        <<" du="<<dupli<<" cj="<<doconj<<" "<<vdir[ip]<<endl;
    117128  }
    118129  cout<<"nvisi tot="<<nvisi<<", number of duplicate="<<ndupli<<", nvisi="<<nvisi-ndupli<<" / 528"<<endl;
     130  ftxt << "exit 0" <<endl;
    119131
    120  return 0;
     132  return 0;
    121133}
    122134
  • trunk/AddOn/TAcq/svv2mtx2_1210.cc

    r3927 r3928  
    2424cout<<"svv2mtx2_1012 [options] dir : lecture des fichiers acq de Pittsburgh Dec 2010"<<endl
    2525    <<" dir : repertoire ou se trouvent les fichiers d'acq"<<endl
     26    <<" -C : compute and store the complexe conjugated visi"<<endl
    2627    <<" -D : visi is a duplicated one"<<endl
    2728    <<" -o visi.ppf : nom du ficher ppf pour ecrire la visi temps-frequence"<<endl
     
    4041  string outname = "";
    4142  int numthread = -1, numrow = -1;
    42   bool dupli = false;
     43  bool dupli = false, doconj = false;
    4344  double freq0 = 0.;
    4445  int ifilmin=0, ifilmax=99999;
     
    4748
    4849  char c;
    49   while((c = getopt(narg,arg,"hDo:t:r:f:T:F:")) != -1) {
     50  while((c = getopt(narg,arg,"hDCo:t:r:f:T:F:")) != -1) {
    5051    switch (c) {
    5152    case 'D' :
    5253      dupli = true;
    5354      break;
     55    case 'C' :
     56      doconj = true;
     57      break;
    5458    case 'o' :
    5559      outname = optarg;
     
    8387  cout<<"numrow="<<numrow<<endl;  if(numrow<0) return -2;
    8488  cout<<"dupli="<<(int)dupli<<endl;
     89  cout<<"doconj="<<(int)doconj<<endl;
    8590  cout<<"outname="<<outname<<endl; if(outname.size()<=0) return -2;
    8691  cout<<"indir="<<indir<<endl;
     
    204209      Npaqsum(ntimefill) = nf * npaqsum;
    205210      MVisi(ntimefill,i) /= double(Npaqsum(ntimefill));
     211      if(doconj) MVisi(ntimefill,i) = conj(MVisi(ntimefill,i));
    206212    }
    207213    ntimefill++;
     
    223229  MVisi.Info()["dir"] = indir;
    224230  MVisi.Info()["dupli"] = (dupli) ? 1: 0;
     231  MVisi.Info()["doconj"] = (doconj) ? 1: 0;
    225232  MVisi.Info()["TUobs_0"] = tudeb;
    226233  MVisi.Info()["TUobs_N"] = tufin;
Note: See TracChangeset for help on using the changeset viewer.