Changeset 3928 in Sophya for trunk/AddOn/TAcq/chanum_1210.cc


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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.