Changeset 3790 in Sophya for trunk/Cosmo/SimLSS/cmvrvloscor.cc


Ignore:
Timestamp:
Jun 28, 2010, 2:12:24 PM (15 years ago)
Author:
cmv
Message:

etude des cubes generes par le GSM, cmv 28/06/2010

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/SimLSS/cmvrvloscor.cc

    r3782 r3790  
    2020// set simul = 6_0p0_780
    2121// 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.fits
     22// cmvrvloscorf -n 1,30 -K 75 -S -2 ginit3d_${simul}_r.fits ginit3d_${simul}_rv.fits
    2323
    2424void usage(void);
     
    3333<<"-S: compute cross-power spectrum of V*conj(R) (def: no)"<<endl
    3434<<"-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
    3536<<endl;
    3637}
     
    3940{
    4041 int nthread = 1, nplany=1, nhfilllos = 25, npixcor = 0;
    41  bool docube=true, dopk = false;
     42 bool docube=true, dopk = false, do2d = false;
    4243 
    4344 // --- Decodage des arguments
    4445 char c;
    45  while((c = getopt(narg,arg,"hn:K:SN")) != -1) {
     46 while((c = getopt(narg,arg,"hn:K:SN2")) != -1) {
    4647  switch (c) {
    4748  case 'n' :
     
    5859  case 'N' :
    5960    docube = false;
     61    break;
     62  case '2' :
     63    do2d = true;
    6064    break;
    6165  case 'h' :
     
    9397 double nmax = max(Nx,max(Ny,Nz));
    9498 cout<<"dmin="<<dmin<<" nmax="<<nmax<<endl;
    95  Histo hmpc(-dmin*nmax,dmin*nmax,4.*nmax);
     99 Histo hmpc(-dmin*nmax,dmin*nmax,4*nmax);
    96100
    97101 POutPersist pos("cmvrvloscor.ppf");
     
    107111   rgen = &(fluct3d->GetRealArray());
    108112   *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;
    109119 }
    110120
     
    147157 for(int i=0;i<Nx;i++) {
    148158   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   }
    149164 for(int j=0;j<Ny;j+=nplany) {
    150165   bool fhis = false;
     
    161176     double lpd = (double)l + d/Dz; // valeur du deplacee
    162177     // on repartit proportionellement au recouvrement sur 2 pixels
    163      long l1 = long(lpd); // pixel de droite
    164      long l2 = l1 + 1;  // pixel de gauche
     178     long l1 = long(lpd); // pixel de gauche
     179     long l2 = l1 + 1;  // pixel de droite
    165180     lpd -= (double)l1;  // recouvrement du pixel du dessus
    166181     if(l1>=0 && l1<Nz) Rdis(l1) += R(l) * (1.-lpd);
    167182     if(l2>=0 && l2<Nz) Rdis(l2) += R(l) * lpd;
    168183   }
     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);}
    169187   // On remplit le cube avec le champ R redshift distordu
    170188   if(fluct3d) for(int l=0;l<Nz;l++) (*rgen)(l,j,i) += Rdis(l);
     
    203221   nlosread++;
    204222 }
     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   }
    205230 }
    206231
     
    324349# proj selon kT (black), selon kZ (red)
    325350n/plot hpkrec2.val%sqrt(x*x+y*y) ! ! "nsta crossmarker3 logx"
     351
     352# les matrices 2D
     353set n 0
     354disp mx_$n
     355newwin
     356disp mxc_$n
    326357 */
Note: See TracChangeset for help on using the changeset viewer.