Index: trunk/Cosmo/SimLSS/cmvginit3d.cc
===================================================================
--- trunk/Cosmo/SimLSS/cmvginit3d.cc	(revision 3799)
+++ trunk/Cosmo/SimLSS/cmvginit3d.cc	(revision 3800)
@@ -572,5 +572,5 @@
       cout<<"\n--- Apply Growth factor"<<endl;
       cout<<"...D(z=0)="<<growth(0.)<<"  D(z="<<zref<<")="<<growth(zref)<<endl;
-      fluct3d.ApplyDerGrowthFactor(use_growth_factor);
+      fluct3d.ApplyVelLosGrowthFactor(use_growth_factor);
       fluct3d.MinMax(rmin,rmax);
       cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl;
Index: trunk/Cosmo/SimLSS/cmvrvloscor.cc
===================================================================
--- trunk/Cosmo/SimLSS/cmvrvloscor.cc	(revision 3799)
+++ trunk/Cosmo/SimLSS/cmvrvloscor.cc	(revision 3800)
@@ -107,5 +107,5 @@
  long nmax = max(Nx,max(Ny,Nz));
  cout<<"dmin="<<dmin<<" nmax="<<nmax<<endl;
- Histo hmpc(-dmin*nmax,dmin*nmax,4*nmax);
+ Histo hmpc(-dmin*nmax/10.,dmin*nmax/10.,nmax);
 
  POutPersist pos(fnppf.c_str());
@@ -167,7 +167,8 @@
  for(int i=0;i<Nx;i++) {
    if(i%(Nx/10)==0) cout<<"   i="<<i<<endl;
-   TMatrix<r_4> M2d, M2dc;
+   TMatrix<r_4> M2d, M2dv, M2dc;
    if(do2d && (i==0 || i==Nx/2 || i==Nx-1)) {
      M2d.ReSize(Ny,Nz); M2d = 0.;
+     M2dv.ReSize(Ny,Nz); M2dv = 0.;
      M2dc.ReSize(Ny,Nz); M2dc = 0.;
    }
@@ -199,5 +200,5 @@
    // On remplit eventuellement les matrices 2D
    if(do2d && M2d.Size()>0)
-     for(int l=0;l<Nz;l++) {M2d(j,l) = R(l); M2dc(j,l) = Rdis(l);}
+     for(int l=0;l<Nz;l++) {M2d(j,l) = R(l); M2dv(j,l) = V(l); M2dc(j,l) = Rdis(l);}
    // On remplit le cube avec le champ R redshift distordu
    if(fluct3d) for(int l=0;l<Nz;l++) (*rgen)(l,j,i) += Rdis(l);
@@ -240,4 +241,6 @@
      sprintf(str,"mx_%d",i);
      pos.PutObject(M2d,str);
+     sprintf(str,"mxv_%d",i);
+     pos.PutObject(M2dv,str);
      sprintf(str,"mxc_%d",i);
      pos.PutObject(M2dc,str);
Index: trunk/Cosmo/SimLSS/genefluct3d.cc
===================================================================
--- trunk/Cosmo/SimLSS/genefluct3d.cc	(revision 3799)
+++ trunk/Cosmo/SimLSS/genefluct3d.cc	(revision 3800)
@@ -904,6 +904,46 @@
 
 //-------------------------------------------------------------------
+void GeneFluct3D::ToRedshiftSpace(void)
+// Apply redshift distortion corrections
+// ---- ATTENTION: Le spectre Pk doit etre (dRho/Rho)(k)
+{
+ double zpk = compute_pk_redsh_ref_;
+ double beta = -(1.+zpk) * growth_->DsDz(zpk,good_dzinc_) / (*growth_)(zpk);
+ if(lp_>0) cout<<"--- ToRedshiftSpace --- at z="<<zpk<<", Beta="<<beta
+               <<" (km/s)/Mpc (comp. for dz="<<good_dzinc_<<")"<<endl;
+ check_array_alloc();
+
+ for(long i=0;i<Nx_;i++) {
+   double kx = Kx(i);
+   for(long j=0;j<Ny_;j++) {
+     double ky = Ky(j);
+     double kt2 = kx*kx + ky*ky;
+     for(long l=0;l<NCz_;l++) {
+       double kz = Kz(l);
+       if(l==0)  continue;
+       T_(l,j,i) *= (1. + beta*kz*kz/(kt2 + kz*kz));
+     }
+   }
+ }
+}
+
+//-------------------------------------------------------------------
 void GeneFluct3D::ToVelLoS(void)
-// Le spectre Pk doit etre (dRho/Rho)(k)
+/*
+---- Vitesse particuliere
+Un atome au redshift "z" emet a la longueur d'onde "Le" si il est au repos
+Il a une vitesse (particuliere) "V" dans le referentiel comobile au redshift "z"
+Dans le referentiel comobile au redshift "z", il emet a la longueur d'onde "Le*(1+V/C)"
+L'observateur voit donc une longueur d'onde "Le*(1+V/C)*(1+z) = Le*[1+z+V/C*(1+z)]"
+  et croit que l'atome est au redshift "z' = z + V/C*(1+z)"
+L'observateur observe donc une vitesse particuliere (1+z)*V/c
+  --> vitesse particuliere dans le repere comobile en z: V/C
+      vitesse particuliere dans le repere comobile de l'observateur: (1+z)*V/C
+---- ATTENTION: Le spectre Pk doit etre (dRho/Rho)(k)
+---- On genere la vitesse particuliere (dans le referentiel comobile au redshift "z")
+     Vlos(k) = i*Beta(z)*k(los)/k^2*(dRho/Rho)(k)
+        .avec Beta(z) = dln(D)/da = -(1+z)/D*dD/dz
+        .on convertit en vitesse en faisant Vlos(k)/H(z)
+*/
 {
  double zpk = compute_pk_redsh_ref_;
@@ -931,5 +971,5 @@
 //-------------------------------------------------------------------
 void GeneFluct3D::ApplyGrowthFactor(int type_evol)
-// Apply Growth to real space
+// Apply Growth to real space d(Rho)/Rho cube
 // Using the correspondance between redshift and los comoving distance
 // describe in vector "zred_" "loscom_"
@@ -971,16 +1011,24 @@
 
 //-------------------------------------------------------------------
-void GeneFluct3D::ApplyDerGrowthFactor(int type_evol)
-// Apply Conformal derivative of Growth to real space for transverse velocity cube
-{
- if(lp_>0) cout<<"--- ApplyDerGrowthFactor: evol="<<type_evol<<endl;
+void GeneFluct3D::ApplyRedshiftSpaceGrowthFactor(void)
+// Apply Growth(z) to redshift-distorted real space cube
+{
+ const char *bla = "GeneFluct3D::ApplyRedshiftSpaceGrowthFactor_Error: redshift evolution impossible because factor depen on k";
+ cout<<bla<<endl; throw ParmError(bla);
+}
+
+//-------------------------------------------------------------------
+void GeneFluct3D::ApplyVelLosGrowthFactor(int type_evol)
+// Apply Growth(z) to transverse velocity real space cube
+{
+ if(lp_>0) cout<<"--- ApplyVelLosGrowthFactor: evol="<<type_evol<<endl;
  check_array_alloc();
 
  if(growth_ == NULL) {
-   const char *bla = "GeneFluct3D::ApplyGrowthFactor_Error: set GrowthFactor first";
+   const char *bla = "GeneFluct3D::ApplyVelLosGrowthFactor_Error: set GrowthFactor first";
    cout<<bla<<endl; throw ParmError(bla);
  }
  if(type_evol<1 || type_evol>2) {
-   const char *bla = "GeneFluct3D::ApplyGrowthFactor_Error: bad type_evol value";
+   const char *bla = "GeneFluct3D::ApplyVelLosGrowthFactor_Error: bad type_evol value";
    cout<<bla<<endl; throw ParmError(bla);
  }
Index: trunk/Cosmo/SimLSS/genefluct3d.h
===================================================================
--- trunk/Cosmo/SimLSS/genefluct3d.h	(revision 3799)
+++ trunk/Cosmo/SimLSS/genefluct3d.h	(revision 3800)
@@ -118,9 +118,11 @@
   void ComputeFourier(PkSpectrumZ& pk_at_z);
   void FilterByPixel(void);
+  void ToRedshiftSpace(void);
   void ToVelLoS(void);
 
   void ComputeReal(void);
   void ApplyGrowthFactor(int type_evol=1);
-  void ApplyDerGrowthFactor(int type_evol=1);
+  void ApplyRedshiftSpaceGrowthFactor(void);
+  void ApplyVelLosGrowthFactor(int type_evol=1);
 
   void ReComputeFourier(void);
