Index: trunk/Cosmo/SimLSS/cmvobserv3d.cc
===================================================================
--- trunk/Cosmo/SimLSS/cmvobserv3d.cc	(revision 3150)
+++ trunk/Cosmo/SimLSS/cmvobserv3d.cc	(revision 3154)
@@ -28,4 +28,8 @@
      <<" -Z zref : redshift median"<<endl
      <<" -s snoise : sigma du bruit en Msol"<<endl
+     <<" -2 : compute 2D spectrum"<<endl
+     <<" -F : write cube in FITS format"<<endl
+     <<" -P : write cube in PPF format"<<endl
+     <<" -V : compute variance from real space"<<endl
      <<endl;
 }
@@ -73,8 +77,14 @@
  unsigned short nthread=4;
 
+ // *** What to do
+ bool comp2dspec = false;
+ bool wfits = false;
+ bool wppf = false;
+ bool compvarreal = false;
+
  // --- Decodage arguments
 
  char c;
- while((c = getopt(narg,arg,"ha0x:y:z:s:Z:")) != -1) {
+ while((c = getopt(narg,arg,"ha0PWV2x:y:z:s:Z:")) != -1) {
   switch (c) {
   case 'a' :
@@ -98,4 +108,16 @@
   case 'Z' :
     sscanf(optarg,"%lf",&zref);
+    break;
+  case '2' :
+    comp2dspec = true;
+    break;
+  case 'V' :
+    compvarreal = true;
+    break;
+  case 'W' :
+    wfits = true;
+    break;
+  case 'P' :
+    wppf = true;
     break;
   case 'h' :
@@ -185,5 +207,5 @@
 
  //-----------------------------------------------------------------
- cout<<endl<<"\n--- Compute galaxies density number"<<endl;
+ cout<<endl<<"\n--- Compute galaxy density number"<<endl;
 
  sch.SetOutValue(0);
@@ -249,5 +271,5 @@
  }
 
- if(1) {
+ if(comp2dspec) {
    cout<<"\n--- Checking realization 2D spectra"<<endl;
    Histo2DErr hpkgen2(0.,ktnyqmax,nherrt,0.,kznyqmax,nherrz);
@@ -265,6 +287,6 @@
  }
 
- if(1) fluct3d.WriteFits("!cmvobserv3d_k.fits");
- if(1) fluct3d.WritePPF("cmvobserv3d_k.ppf",false);
+ if(wfits) fluct3d.WriteFits("!cmvobserv3d_k0.fits");
+ if(wppf) fluct3d.WritePPF("cmvobserv3d_k0.ppf",false);
 
  if(1) {
@@ -279,5 +301,5 @@
  }
 
- if(1) {
+ if(comp2dspec) {
    cout<<"\n--- Checking realization 2D spectra after pixel shape convol."<<endl;
    Histo2DErr hpkgenf2(0.,ktnyqmax,nherrt,0.,kznyqmax,nherrz);
@@ -295,6 +317,6 @@
  cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl;
 
- if(1) fluct3d.WriteFits("!cmvobserv3d_r0.fits");
- if(1) fluct3d.WritePPF("cmvobserv3d_r0.ppf",true);
+ if(wfits) fluct3d.WriteFits("!cmvobserv3d_r0.fits");
+ if(wppf) fluct3d.WritePPF("cmvobserv3d_r0.ppf",true);
 
  int_8 nm;
@@ -308,5 +330,5 @@
  }
 
- if(1) {
+ if(compvarreal) {
    cout<<"\n--- Check variance sigmaR in real space"<<endl;
    double varr;
@@ -336,5 +358,5 @@
      <<rs2<<" -> "<<sqrt(rs2)<<endl;
 
- cout<<"\n--- Apply poisson on galaxie number"<<endl;
+ cout<<"\n--- Apply poisson on galaxy number"<<endl;
  nm = fluct3d.ApplyPoisson();
  cout<<nm<<" galaxies into survey after poisson"<<endl;
@@ -343,5 +365,5 @@
      <<rs2<<" -> "<<sqrt(rs2)<<endl;
 
- cout<<"\n--- Convert Galaxies number to HI mass"<<endl;
+ cout<<"\n--- Convert Galaxy number to HI mass"<<endl;
  long nhmdndm = long( (lschmax-lschmin+1.)*100. + 0.5);
  Histo hmdndm(lschmin,lschmax,nhmdndm);
@@ -368,6 +390,6 @@
      <<rs2<<" -> "<<sqrt(rs2)<<endl;
 
- if(1) fluct3d.WriteFits("!cmvobserv3d_r.fits");
- if(1) fluct3d.WritePPF("cmvobserv3d_r.ppf",true);
+ if(wfits) fluct3d.WriteFits("!cmvobserv3d_r.fits");
+ if(wppf) fluct3d.WritePPF("cmvobserv3d_r.ppf",true);
 
  cout<<"\n--- Add noise to HI Flux snoise="<<snoise<<endl;
@@ -384,4 +406,7 @@
    fluct3d.ReComputeFourier();
  }
+
+ if(wfits) fluct3d.WriteFits("!cmvobserv3d_k.fits");
+ if(wppf) fluct3d.WritePPF("cmvobserv3d_k.ppf",false);
 
  if(1) {
@@ -394,5 +419,5 @@
  }
 
- if(1) {
+ if(comp2dspec) {
    cout<<"\n--- Computing final 2D spectrum"<<endl;
    Histo2DErr hpkrec2(0.,ktnyqmax,nherrt,0.,kznyqmax,nherrz);
@@ -410,8 +435,10 @@
 /*
 ######################################################
+readfits cmvobserv3d_k0.fits
 readfits cmvobserv3d_k.fits
 readfits cmvobserv3d_r0.fits
 readfits cmvobserv3d_r.fits
 
+openppf cmvobserv3d_k0.ppf
 openppf cmvobserv3d_k.ppf
 openppf cmvobserv3d_r0.ppf
