Changeset 3799 in Sophya for trunk/Cosmo/SimLSS/cmvrvloscor.cc
- Timestamp:
- Jun 30, 2010, 6:23:54 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvrvloscor.cc
r3794 r3799 19 19 #include "genefluct3d.h" 20 20 // set simul = 6_0p0_780 21 // cmvrvloscorf - 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.fits23 // cmvrvloscorf - n 1,30 -2 ginit3d_${simul}_r.fits ginit3d_${simul}_rv.fits21 // cmvrvloscorf -o rvlos_${simul}.ppf -K 75 -S ginit3d_${simul}_r.fits ginit3d_${simul}_rv.fits 22 // cmvrvloscorf -o rvlos_${simul}.ppf -n 1,30 -K 75 -S -2 ginit3d_${simul}_r.fits ginit3d_${simul}_rv.fits 23 // cmvrvloscorf -o rvlos_${simul}.ppf -n 1,30 -2 ginit3d_${simul}_r.fits ginit3d_${simul}_rv.fits 24 24 25 25 void usage(void); … … 34 34 <<"-S: compute cross-power spectrum of V*conj(R) (def: no)"<<endl 35 35 <<"-N: do not create 3D cube and recompute 1D and 2D spectra (def: no do-it !)"<<endl 36 <<"-p: do not distribute dRho/Rho in pixel, just take the nearest (def: no, distribute rho)"<<endl 36 37 <<"-2: compute 2D projection fpr dRho and dRho(corrected) (def=no)"<<endl 38 <<"-o: output ppf file name (def=\"cmvrvloscor.ppf\")"<<endl 37 39 <<endl; 38 40 } … … 41 43 { 42 44 int nthread = 1, nplany=1, nhfilllos = 25, npixcor = 0; 43 bool docube=true, dopk = false, do2d = false; 45 bool docube=true, dopk = false, do2d = false, dodistrib=true; 46 string fnppf = "cmvrvloscor.ppf"; 44 47 45 48 // --- Decodage des arguments 46 49 char c; 47 while((c = getopt(narg,arg,"hn:K:SN 2")) != -1) {50 while((c = getopt(narg,arg,"hn:K:SNp2o:")) != -1) { 48 51 switch (c) { 49 52 case 'n' : … … 63 66 case '2' : 64 67 do2d = true; 68 break; 69 case 'p' : 70 dodistrib = false; 71 break; 72 case 'o' : 73 fnppf = optarg; 65 74 break; 66 75 case 'h' : … … 100 109 Histo hmpc(-dmin*nmax,dmin*nmax,4*nmax); 101 110 102 POutPersist pos( "cmvrvloscor.ppf");111 POutPersist pos(fnppf.c_str()); 103 112 DVList dvlcor; 104 113 … … 173 182 // Calcul du champ R redshift distordu 174 183 for(int l=0;l<Nz;l++) { 175 double d = (1.+Zref) / Href * V(l);184 double d = V(l) / Href; 176 185 if(fhis) hmpc.Add(d); 177 186 double lpd = (double)l + d/Dz; // valeur du deplacee 178 // on repartit proportionellement au recouvrement sur 2 pixels 179 long l1 = long(lpd); // pixel de gauche 180 long l2 = l1 + 1; // pixel de droite 181 lpd -= (double)l1; // recouvrement du pixel du dessus 182 if(l1>=0 && l1<Nz) Rdis(l1) += R(l) * (1.-lpd); 183 if(l2>=0 && l2<Nz) Rdis(l2) += R(l) * lpd; 187 if(dodistrib) { 188 // on repartit proportionellement au recouvrement sur 2 pixels 189 long l1 = long(lpd); // pixel de gauche 190 long l2 = l1 + 1; // pixel de droite 191 lpd -= (double)l1; // recouvrement du pixel du dessus 192 if(l1>=0 && l1<Nz) Rdis(l1) += R(l) * (1.-lpd); 193 if(l2>=0 && l2<Nz) Rdis(l2) += R(l) * lpd; 194 } else { // take nearest pixel 195 long l1 = long(lpd + 0.5); 196 if(l1>=0 && l1<Nz) Rdis(l1) += R(l); 197 } 184 198 } 185 199 // On remplit eventuellement les matrices 2D … … 351 365 n/plot hpkrec2.val%sqrt(x*x+y*y) ! ! "nsta crossmarker3 logx" 352 366 367 defscript tom 368 del m2 369 c++exec TMatrix<r_8> m2(hpkrec2.NBinX(),hpkrec2.NBinY()); \ 370 for(int i=0;i<hpkrec2.NBinX();i++) \ 371 for(int j=0;j<hpkrec2.NBinY();j++) m2(i,j) = hpkrec2(i,j); \ 372 KeepObj(m2); cout<<"OK"<<endl; 373 endscript 374 353 375 # les matrices 2D 354 376 set n 0
Note:
See TracChangeset
for help on using the changeset viewer.