Changeset 3790 in Sophya for trunk/Cosmo/SimLSS/cmvrvloscor.cc
- Timestamp:
- Jun 28, 2010, 2:12:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvrvloscor.cc
r3782 r3790 20 20 // set simul = 6_0p0_780 21 21 // cmvrvloscorf -K 75 -S ginit3d_${simul}_r.fits ginit3d_${simul}_rv.fits 22 // cmvrvloscorf -n 1,30 -K 75 -S ginit3d_${simul}_r.fits ginit3d_${simul}_rv.fits22 // cmvrvloscorf -n 1,30 -K 75 -S -2 ginit3d_${simul}_r.fits ginit3d_${simul}_rv.fits 23 23 24 24 void usage(void); … … 33 33 <<"-S: compute cross-power spectrum of V*conj(R) (def: no)"<<endl 34 34 <<"-N: do not create 3D cube and recompute 1D and 2D spectra (def: no do-it !)"<<endl 35 <<"-2: compute 2D projection fpr dRho and dRho(corrected) (def=no)"<<endl 35 36 <<endl; 36 37 } … … 39 40 { 40 41 int nthread = 1, nplany=1, nhfilllos = 25, npixcor = 0; 41 bool docube=true, dopk = false ;42 bool docube=true, dopk = false, do2d = false; 42 43 43 44 // --- Decodage des arguments 44 45 char c; 45 while((c = getopt(narg,arg,"hn:K:SN ")) != -1) {46 while((c = getopt(narg,arg,"hn:K:SN2")) != -1) { 46 47 switch (c) { 47 48 case 'n' : … … 58 59 case 'N' : 59 60 docube = false; 61 break; 62 case '2' : 63 do2d = true; 60 64 break; 61 65 case 'h' : … … 93 97 double nmax = max(Nx,max(Ny,Nz)); 94 98 cout<<"dmin="<<dmin<<" nmax="<<nmax<<endl; 95 Histo hmpc(-dmin*nmax,dmin*nmax,4 .*nmax);99 Histo hmpc(-dmin*nmax,dmin*nmax,4*nmax); 96 100 97 101 POutPersist pos("cmvrvloscor.ppf"); … … 107 111 rgen = &(fluct3d->GetRealArray()); 108 112 *rgen = 0.; 113 cout<<"rgen: size [1]="<<rgen->SizeX() 114 <<" [2]="<<rgen->SizeY() 115 <<" [3]="<<rgen->SizeZ()<<endl; 116 cout<<"pkgen: size [1]="<<fluct3d->GetComplexArray().SizeX() 117 <<" [2]="<<fluct3d->GetComplexArray().SizeY() 118 <<" [3]="<<fluct3d->GetComplexArray().SizeZ()<<endl; 109 119 } 110 120 … … 147 157 for(int i=0;i<Nx;i++) { 148 158 if(i%(Nx/10)==0) cout<<" i="<<i<<endl; 159 TMatrix<r_4> M2d, M2dc; 160 if(do2d && (i==0 || i==Nx/2 || i==Nx-1)) { 161 M2d.ReSize(Ny,Nz); M2d = 0.; 162 M2dc.ReSize(Ny,Nz); M2dc = 0.; 163 } 149 164 for(int j=0;j<Ny;j+=nplany) { 150 165 bool fhis = false; … … 161 176 double lpd = (double)l + d/Dz; // valeur du deplacee 162 177 // on repartit proportionellement au recouvrement sur 2 pixels 163 long l1 = long(lpd); // pixel de droite164 long l2 = l1 + 1; // pixel de gauche178 long l1 = long(lpd); // pixel de gauche 179 long l2 = l1 + 1; // pixel de droite 165 180 lpd -= (double)l1; // recouvrement du pixel du dessus 166 181 if(l1>=0 && l1<Nz) Rdis(l1) += R(l) * (1.-lpd); 167 182 if(l2>=0 && l2<Nz) Rdis(l2) += R(l) * lpd; 168 183 } 184 // On remplit eventuellement les matrices 2D 185 if(do2d && M2d.Size()>0) 186 for(int l=0;l<Nz;l++) {M2d(j,l) = R(l); M2dc(j,l) = Rdis(l);} 169 187 // On remplit le cube avec le champ R redshift distordu 170 188 if(fluct3d) for(int l=0;l<Nz;l++) (*rgen)(l,j,i) += Rdis(l); … … 203 221 nlosread++; 204 222 } 223 if(do2d && M2d.Size()>0) { 224 char str[64]; 225 sprintf(str,"mx_%d",i); 226 pos.PutObject(M2d,str); 227 sprintf(str,"mxc_%d",i); 228 pos.PutObject(M2dc,str); 229 } 205 230 } 206 231 … … 324 349 # proj selon kT (black), selon kZ (red) 325 350 n/plot hpkrec2.val%sqrt(x*x+y*y) ! ! "nsta crossmarker3 logx" 351 352 # les matrices 2D 353 set n 0 354 disp mx_$n 355 newwin 356 disp mxc_$n 326 357 */
Note:
See TracChangeset
for help on using the changeset viewer.