Changeset 3928 in Sophya
- Timestamp:
- Dec 17, 2010, 4:24:06 PM (15 years ago)
- Location:
- trunk/AddOn/TAcq
- Files:
-
- 2 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 -
trunk/AddOn/TAcq/svv2mtx2_1210.cc
r3927 r3928 24 24 cout<<"svv2mtx2_1012 [options] dir : lecture des fichiers acq de Pittsburgh Dec 2010"<<endl 25 25 <<" dir : repertoire ou se trouvent les fichiers d'acq"<<endl 26 <<" -C : compute and store the complexe conjugated visi"<<endl 26 27 <<" -D : visi is a duplicated one"<<endl 27 28 <<" -o visi.ppf : nom du ficher ppf pour ecrire la visi temps-frequence"<<endl … … 40 41 string outname = ""; 41 42 int numthread = -1, numrow = -1; 42 bool dupli = false ;43 bool dupli = false, doconj = false; 43 44 double freq0 = 0.; 44 45 int ifilmin=0, ifilmax=99999; … … 47 48 48 49 char c; 49 while((c = getopt(narg,arg,"hD o:t:r:f:T:F:")) != -1) {50 while((c = getopt(narg,arg,"hDCo:t:r:f:T:F:")) != -1) { 50 51 switch (c) { 51 52 case 'D' : 52 53 dupli = true; 53 54 break; 55 case 'C' : 56 doconj = true; 57 break; 54 58 case 'o' : 55 59 outname = optarg; … … 83 87 cout<<"numrow="<<numrow<<endl; if(numrow<0) return -2; 84 88 cout<<"dupli="<<(int)dupli<<endl; 89 cout<<"doconj="<<(int)doconj<<endl; 85 90 cout<<"outname="<<outname<<endl; if(outname.size()<=0) return -2; 86 91 cout<<"indir="<<indir<<endl; … … 204 209 Npaqsum(ntimefill) = nf * npaqsum; 205 210 MVisi(ntimefill,i) /= double(Npaqsum(ntimefill)); 211 if(doconj) MVisi(ntimefill,i) = conj(MVisi(ntimefill,i)); 206 212 } 207 213 ntimefill++; … … 223 229 MVisi.Info()["dir"] = indir; 224 230 MVisi.Info()["dupli"] = (dupli) ? 1: 0; 231 MVisi.Info()["doconj"] = (doconj) ? 1: 0; 225 232 MVisi.Info()["TUobs_0"] = tudeb; 226 233 MVisi.Info()["TUobs_N"] = tufin;
Note:
See TracChangeset
for help on using the changeset viewer.