Changeset 3928 in Sophya for trunk/AddOn/TAcq/chanum_1210.cc
- Timestamp:
- Dec 17, 2010, 4:24:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/chanum_1210.cc
r3927 r3928 18 18 #include "nbtrixx.h" 19 19 20 // > chanum_1210 -f 1375.0610351 -o CasA02Dec. txt crt*/CasA02Dec/chanum_*.ppf21 // > chanum_1210 -f 1375.0610351 -o Crab03Dec. txt crt*/Crab03Dec/chanum_*.ppf22 // > chanum_1210 -f 1382.5378418 -o Sun03Dec. txt crt*/Sun03Dec/chanum_*.ppf23 // > chanum_1210 -f 1390.0146484 -o CasA03Dec. txt crt*/CasA03Dec/chanum_*.ppf20 // > 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 24 24 25 25 int decode_numthread(string filein,string& dir); … … 31 31 cout<<"Usage: chanum_1210 [options] chanum_?.ppf ..."<<endl 32 32 <<" -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; 34 34 } 35 35 … … 37 37 int main(int narg, char* arg[]) 38 38 { 39 string outname = "chanum_1210. txt";39 string outname = "chanum_1210.csh"; 40 40 double freq0 = 0.; 41 41 … … 92 92 ofstream ftxt(outname.c_str(), ofstream::out); 93 93 cout<<"writing in "<<outname<<" (is_open="<<ftxt.is_open()<<")"<<endl; 94 ftxt << "#!/bin/csh" <<endl; 94 95 if(!ftxt) {cout<<"!!!!OPENING failed "<<outname<<endl; return -3;} 95 96 int dupli = 0, ndupli = 0; 96 97 nvisi = 0; 97 98 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); 100 101 string argu = str; 101 102 uint_4 ip = IVcode(i); … … 103 104 uint_4 vcode_suiv = (i<vcode.size()-1) ? vcode[IVcode(i+1)]: 99999999; 104 105 uint_4 v1 = vcode[ip]/1000, v2 = vcode[ip]%100; 105 if(v1>v2) {swap(v1,v2); argu += " -c";} // faut-il conjuger ?106 106 sprintf(str," -t %d",vnth[ip]); argu += str; // numero de threads 107 107 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 108 113 // 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 } 112 122 sprintf(str," -o visi%d_%02d_%02d.ppf",dupli,v1,v2); argu += str; 113 123 argu += " "; argu += vdir[ip]; // repertoire des fichiers acq 114 124 ftxt << argu <<endl; 115 125 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; 117 128 } 118 129 cout<<"nvisi tot="<<nvisi<<", number of duplicate="<<ndupli<<", nvisi="<<nvisi-ndupli<<" / 528"<<endl; 130 ftxt << "exit 0" <<endl; 119 131 120 return 0;132 return 0; 121 133 } 122 134
Note:
See TracChangeset
for help on using the changeset viewer.