Changeset 3799 in Sophya


Ignore:
Timestamp:
Jun 30, 2010, 6:23:54 PM (15 years ago)
Author:
cmv
Message:

Vlos * by (1+z), Dlos(com) do not * by (1+z), cmv 30/06/2010

Location:
trunk/Cosmo/SimLSS
Files:
2 edited

Legend:

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

    r3794 r3799  
    1919#include "genefluct3d.h"
    2020// set simul = 6_0p0_780
    21 // cmvrvloscorf -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
    23 // cmvrvloscorf -n 1,30 -2 ginit3d_${simul}_r.fits ginit3d_${simul}_rv.fits
     21// 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
    2424
    2525void usage(void);
     
    3434<<"-S: compute cross-power spectrum of V*conj(R) (def: no)"<<endl
    3535<<"-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
    3637<<"-2: compute 2D projection fpr dRho and dRho(corrected) (def=no)"<<endl
     38<<"-o: output ppf file name (def=\"cmvrvloscor.ppf\")"<<endl
    3739<<endl;
    3840}
     
    4143{
    4244 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";
    4447 
    4548 // --- Decodage des arguments
    4649 char c;
    47  while((c = getopt(narg,arg,"hn:K:SN2")) != -1) {
     50 while((c = getopt(narg,arg,"hn:K:SNp2o:")) != -1) {
    4851  switch (c) {
    4952  case 'n' :
     
    6366  case '2' :
    6467    do2d = true;
     68    break;
     69  case 'p' :
     70    dodistrib = false;
     71    break;
     72  case 'o' :
     73    fnppf = optarg;
    6574    break;
    6675  case 'h' :
     
    100109 Histo hmpc(-dmin*nmax,dmin*nmax,4*nmax);
    101110
    102  POutPersist pos("cmvrvloscor.ppf");
     111 POutPersist pos(fnppf.c_str());
    103112 DVList dvlcor;
    104113
     
    173182   // Calcul du champ R redshift distordu
    174183   for(int l=0;l<Nz;l++) {
    175      double d = (1.+Zref) / Href * V(l);
     184     double d = V(l) / Href;
    176185     if(fhis) hmpc.Add(d);
    177186     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     }
    184198   }
    185199   // On remplit eventuellement les matrices 2D
     
    351365n/plot hpkrec2.val%sqrt(x*x+y*y) ! ! "nsta crossmarker3 logx"
    352366
     367defscript tom
     368del m2
     369c++exec TMatrix<r_8> m2(hpkrec2.NBinX(),hpkrec2.NBinY()); \
     370for(int i=0;i<hpkrec2.NBinX();i++) \
     371for(int j=0;j<hpkrec2.NBinY();j++) m2(i,j) = hpkrec2(i,j); \
     372KeepObj(m2); cout<<"OK"<<endl;
     373endscript
     374
    353375# les matrices 2D
    354376set n 0
  • trunk/Cosmo/SimLSS/genefluct3d.cc

    r3790 r3799  
    421421 for(int i=0;i<nptd;i++) {
    422422   double z = zredmin_dpsd_ + i*dz;
    423    double v = -cosmo_->H(z) * growth_->DsDz(z,good_dzinc_) / (*growth_)(z);
     423   double om = cosmo_->Omatter(z);
     424   double h = cosmo_->H(z);
     425   double dsdz = growth_->DsDz(z,good_dzinc_);
     426   double d = (*growth_)(z);
     427   double v = -h * (1.+z) * dsdz / d;
    424428   dpsdfrzred_.push_back(v);
    425    if(lp_ && (i%nmod==0 || i==nptd-1)) cout<<"    z="<<z<<"  D'/D="<<v<<" km/s/Mpc"<<endl;
     429   if(lp_ && (i%nmod==0 || i==nptd-1))
     430     cout<<"    z="<<z<<" H="<<h<<" Beta="<<-(1.+z)*dsdz/d
     431         <<" (Om^0.6="<<pow(om,0.6)
     432         <<")  -H*(1+z)*D'/D="<<v<<" km/s/Mpc"<<endl;
    426433 }
    427434
     
    901908{
    902909 double zpk = compute_pk_redsh_ref_;
    903  double dpsd = -cosmo_->H(zpk) * growth_->DsDz(zpk,good_dzinc_) / (*growth_)(zpk);
    904  if(lp_>0) cout<<"--- ToVelLoS --- at z="<<zpk<<", D'/D="<<dpsd
     910 double dpsd = -cosmo_->H(zpk) * (1.+zpk) * growth_->DsDz(zpk,good_dzinc_) / (*growth_)(zpk);
     911 if(lp_>0) cout<<"--- ToVelLoS --- at z="<<zpk<<", -H*(1+z)*D'/D="<<dpsd
    905912               <<" (km/s)/Mpc (comp. for dz="<<good_dzinc_<<")"<<endl;
    906913 check_array_alloc();
     
    980987
    981988 double zpk = compute_pk_redsh_ref_;
    982  double dpsd_orig = - cosmo_->H(zpk) * growth_->DsDz(zpk,good_dzinc_) / (*growth_)(zpk);
     989 double dpsd_orig = - cosmo_->H(zpk) * (1.+zpk) * growth_->DsDz(zpk,good_dzinc_) / (*growth_)(zpk);
    983990
    984991 InterpFunc interpinv(loscom2zred_min_,loscom2zred_max_,loscom2zred_);
Note: See TracChangeset for help on using the changeset viewer.