Index: trunk/Cosmo/SimLSS/cmvobserv3d.cc
===================================================================
--- trunk/Cosmo/SimLSS/cmvobserv3d.cc	(revision 3330)
+++ trunk/Cosmo/SimLSS/cmvobserv3d.cc	(revision 3331)
@@ -23,5 +23,7 @@
      <<" -a : auto init random seed (needed for multiple simul)"<<endl
      <<" -0 : use ComputeFourier0 method (defaut: no, use normal way)"<<endl
-     <<" -G : compute Pk(z=0) and apply growth factor in real space"<<endl
+     <<" -G typevol: compute Pk(z=0) and apply growth factor in real space"<<endl
+     <<"             typevol=1 noise evolved with distance / observateur (def)"<<endl
+     <<"             typevol=2 noise evolved with distance to middle of Z planes"<<endl
      <<"      (default: no, spectrum Pk(z=z_median) for all cube)"<<endl
      <<" -F : filter spectrum by pixel shape (0=no 1=yes(default)"<<endl
@@ -32,6 +34,8 @@
      <<" -z nz,dz : size along z axis (redshift axis, npix,Mpc)"<<endl
      <<" -Z zref : redshift for the center of the simulation cube"<<endl
-     <<" -s snoise,evol : gaussian noise sigma in equivalent Msol"<<endl
-     <<"                  if evol>0 noise evolved with distance (def no)"<<endl
+     <<" -s snoise,typevol : gaussian noise sigma in equivalent Msol"<<endl
+     <<"           typevol=0 no evolution (def)"<<endl
+     <<"           typevol=1 noise evolved with distance / observateur"<<endl
+     <<"           typevol=2 noise evolved with distance to middle of Z planes"<<endl
      <<" -2 : compute also 2D spectrum (default: no)"<<endl
      <<" -N scalecube,offsetcube: normalize cube before doing final spectrum (default: automatic)"<<endl
@@ -95,5 +99,5 @@
  // *** Niveau de bruit
  double snoise= 0.;   // en equivalent MSol
- int isnoise_evol = 0;
+ int noise_evol = 0;
 
  // *** AGN
@@ -104,5 +108,5 @@
  // *** type de generation
  bool computefourier0=false;
- bool use_growth_factor = false;
+ int use_growth_factor = 0;
  unsigned short nthread=0;
  int filter_by_pixel = 1;
@@ -124,5 +128,5 @@
 
  char c;
- while((c = getopt(narg,arg,"ha0PWSV2GUF:x:y:z:s:Z:M:A:T:N:Q:R:")) != -1) {
+ while((c = getopt(narg,arg,"ha0PWSV2UG:F:x:y:z:s:Z:M:A:T:N:Q:R:")) != -1) {
   int nth = 0;
   switch (c) {
@@ -134,5 +138,5 @@
     break;
   case 'G' :
-    use_growth_factor = true;
+    sscanf(optarg,"%d",&use_growth_factor);
     break;
   case 'U' :
@@ -152,5 +156,5 @@
     break;
   case 's' :
-    sscanf(optarg,"%lf,%d",&snoise,&isnoise_evol);
+    sscanf(optarg,"%lf,%d",&snoise,&noise_evol);
     break;
   case 'Z' :
@@ -212,4 +216,5 @@
  cout<<"Filter by pixel = "<<filter_by_pixel<<endl;
  cout<<"R="<<R<<" Rg="<<Rg<<" Mpc, sigmaR="<<sigmaR<<endl;
+ cout<<"Use_growth_factor = "<<use_growth_factor<<endl;
  cout<<"nstar= "<<nstar<<"  mstar="<<mstar<<"  alpha="<<alpha<<endl;
  cout<<"schmin="<<schmin<<" ("<<lschmin
@@ -217,5 +222,5 @@
      <<", schnpt="<<schnpt<<endl;
  if(no_poisson) cout<<"No poisson fluctuation, direct conversion to HI mass"<<endl;
- cout<<"snoise="<<snoise<<" equivalent Msol, evolution="<<isnoise_evol<<endl;
+ cout<<"snoise="<<snoise<<" equivalent Msol, evolution="<<noise_evol<<endl;
  cout<<"scalecube="<<scalecube<<", offsetcube="<<offsetcube<<endl;
  if(do_agn)
@@ -385,5 +390,5 @@
  //-----------------------------------------------------------------
  cout<<"\n--- Computing a realization in Fourier space"<<endl;
- if(use_growth_factor) pkz.SetZ(0.); else pkz.SetZ(zref);
+ if(use_growth_factor>0) pkz.SetZ(0.); else pkz.SetZ(zref);
  cout<<"Power spectrum set at redshift: "<<pkz.GetZ()<<endl;
  if(computefourier0) fluct3d.ComputeFourier0(pkz);
@@ -473,8 +478,8 @@
  PrtTim(">>>> End Computing a realization in real space");
 
- if(use_growth_factor) {
+ if(use_growth_factor>0) {
    cout<<"\n--- Apply Growth factor"<<endl;
    cout<<"...D(z=0)="<<growth(0.)<<"  D(z="<<zref<<")="<<growth(zref)<<endl;
-   fluct3d.ApplyGrowthFactor();
+   fluct3d.ApplyGrowthFactor(use_growth_factor);
    fluct3d.MinMax(rmin,rmax);
    cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl;
@@ -607,6 +612,6 @@
  double snoisesave = 0.;
  if(snoise>0.) {
-   cout<<"\n--- Add noise to HI Flux snoise="<<snoise<<", evolution="<<isnoise_evol<<endl;
-   fluct3d.AddNoise2Real(snoise,(isnoise_evol>0? true:false));
+   cout<<"\n--- Add noise to HI Flux snoise="<<snoise<<", evolution="<<noise_evol<<endl;
+   fluct3d.AddNoise2Real(snoise,noise_evol);
    snoisesave = snoise;
      nm = fluct3d.MeanSigma2(rm,rs2);
