Index: trunk/Cosmo/RadioBeam/repicon.cc
===================================================================
--- trunk/Cosmo/RadioBeam/repicon.cc	(revision 3936)
+++ trunk/Cosmo/RadioBeam/repicon.cc	(revision 3947)
@@ -32,8 +32,8 @@
 
 // pour sauver la reponse mdresp et la config des dishes dans un fichier PPF 
-void SaveDTVecDishesH2Resp(string& outfile, vector<Dish>& vdishes, Four2DRespTable& mdresp);
+void SaveDTVecDishesH2Resp(POutPersist& po, vector<Dish>& vdishes, Four2DRespTable& mdresp);
 
 // ---------------------------------------------------------------------
-// main program for computing interferometer response un (u,v) plane
+// main program for computing interferometer response in (u,v) plane
 // R. Ansari  - Avril-Juin 2010 
 // ---------------------------------------------------------------------
@@ -42,18 +42,24 @@
 {
   cout << " Usage: repicon [-parname Value] configId OutPPFName \n" 
-       << " configIds: f4x4,f8x8,f20x20, confA,confB,confC,confD, hex12,cross11, f3cyl,f8cyl,f3cylp,f8cylp \n"
-       << "   f4x4 , f8x8 , f20x20 Filled array of nxn dishes  \n" 
+       << " configIds: f4x4,f8x8,f11x11,f20x20, confA,confB,confC,confD, hex12,cross11, \n" 
+       <<  "           f3cyl,f8cyl,f3cylp,f8cylp, nan12,nan24,nan36,nan40,nan128 \n"
+       << "   f4x4 , f8x8 , f11x11 , f20x20 Filled array of nxn dishes  \n" 
        << "   confA , confB, confC, confD : semi-filled array of dishes \n"
        << "   hex12,cross11 : ASKAP like double hexagonal (12xD=12m), cross config (11xD=12m) \n"
+       << "   nan12,nan24,nan36,nan40,nan128: 3,4,6,5,8 cylinder like configurations with 12,24,36,40,128 dishes\n"
        << "   f3cyl, f8cyl , f3cylp, f8cylp : filled array of non perfect/perfect of n cylinders \n"
        << "   f4cylw : filled array of 4 perfect of wide cylinders \n"
-       << "  [ -parname value] : -renmax -z -prt -D -lmax \n" 
+       << "   pit2cyl,pit2cylw : 2 cylinders 15mx7m, 20mx10 for z=0.3 at Pittsburg (perfect) \n"
+       << "   pit4cyl : 4 cylinders 32mx8m for z=0.3-0.7 at Pittsburg (perfect) \n"
+       << "  [ -parname value] : -renmax -z -prt -D -lmax -eta -autocor \n" 
        << "    -renmax MaxValue (default : Do NOT renormalize 2D response value \n"   
        << "    -z redshift (default=0.7) --> determines Lambda \n"
        << "    -D DishDiameter (default=5 m) \n"
+       << "    -eta fill_factor (default=0.90) \n"
        << "    -lmax array extension (default=100 m ) for response calculation kmax \n" 
        << "    -repnxy Nx,Ny (default=200,200) ResponseTable binning \n"
        << "    -beamnxy Nx,Ny (default=200,200) Beam sampling \n"
        << "    -rot ThetaMaxDeg,NTheta,PhiMaxDeg,NPhi (default NO-rotate/pointing -> 23,10,30,15 ) \n" 
+       << "    -autocor : keep antenna auto-correlation signals (default NO) \n"
        << "    -prt PrtLev,PrtModulo (default=0,10) \n" 
        << endl; 
@@ -82,4 +88,5 @@
   
   double Ddish=5.;
+  double Eta=0.9;
   bool fgDfixed=false;
   double LMAX = 100.;  // taille de la zone, pour calcul kmax 
@@ -94,4 +101,5 @@
   int NBX=200;
   int NBY=200;
+  bool fgnoauto=true;  // do not keep antenna autocorrelation signal 
   
   int ka=1;
@@ -106,4 +114,7 @@
       Ddish=atof(arg[ka+1]);  fgDfixed=true;  ka+=2;
     }
+    else if (strcmp(arg[ka],"-eta")==0) {
+      Eta=atof(arg[ka+1]);  ka+=2;
+    }
     else if (strcmp(arg[ka],"-lmax")==0) {
       LMAX=atof(arg[ka+1]);  fgLMAXfixed=true;  ka+=2;
@@ -117,4 +128,7 @@
     else if (strcmp(arg[ka],"-rot")==0) {
       sscanf(arg[ka+1],"%lg,%d,%lg,%d",&thetamxdeg,&nteta,&phimxdeg,&nphi);  fgpoint=true;  ka+=2;
+    }
+    else if (strcmp(arg[ka],"-autocor")==0) {
+      fgnoauto=false;   ka+=1;
     }
     else if (strcmp(arg[ka],"-prt")==0) {
@@ -143,5 +157,4 @@
     LAMBDA = conv.getLambda();
     
-    double Eta=0.95;
     double cylW=12.;   // Largeur des cylindres 
     double cylRL=2*LAMBDA;  // Longeur des elements de reception le long du cylindre
@@ -150,5 +163,6 @@
 
     vector<Dish> vdishes;
-    cout << " repicon[1] : creating dish vector/ MultiDish for configuration: " << config << endl;
+    cout << " repicon[1] : creating dish vector/ MultiDish for configuration: " << config 
+	 << " Ddish=" << Ddish << " m. Eta=" << Eta << endl;
 
     if (config=="f4x4") {
@@ -157,4 +171,7 @@
     else if (config=="f8x8") {
       vdishes=CreateFilledSqConfig(8,Ddish, Eta);
+    }
+    else if (config=="f11x11") {
+      vdishes=CreateFilledSqConfig(11,Ddish, Eta);
     }
     else if (config=="f20x20") {
@@ -172,4 +189,19 @@
       cylW=25.;   cylRL=3*LAMBDA; 
       vdishes=CreateFilledCylConfig(4, 100, cylW, cylRL, etaW, etaRL, false);
+    }
+    else if (config=="pit2cyl") {
+      etaW=0.9; etaRL=0.9;
+      cylW=7.;   cylRL=2*LAMBDA; 
+      vdishes=CreateFilledCylConfig(2, 32, cylW, cylRL, etaW, etaRL, false);
+    }
+    else if (config=="pit2cylw") {
+      etaW=0.9; etaRL=0.9;
+      cylW=9.;   cylRL=2*LAMBDA; 
+      vdishes=CreateFilledCylConfig(2, 40, cylW, cylRL, etaW, etaRL, false);
+    }
+    else if (config=="pit4cyl") {
+      etaW=0.9; etaRL=0.9;
+      cylW=8.;   cylRL=2*LAMBDA; 
+      vdishes=CreateFilledCylConfig(4, 64, cylW, cylRL, etaW, etaRL, false);
     }
     else if (config=="f8cyl") {
@@ -206,4 +238,19 @@
       vdishes=CreateDoubleHexagonConfig(Ddish);
     }
+    else if (config=="nan12") {
+      vdishes=CreateConfigNancay12(Ddish, Eta);
+    }
+    else if (config=="nan24") {
+      vdishes=CreateConfigNancay24(Ddish, Eta);
+    }
+    else if (config=="nan36") {
+      vdishes=CreateConfigNancay36(Ddish, Eta);
+    }
+    else if (config=="nan40") {
+      vdishes=CreateConfigNancay40(Ddish, Eta);
+    }
+    else if (config=="nan128") {
+      vdishes=CreateConfigNancay128(Ddish, Eta);
+    }
     else {
       cout << " NON valid configuration option -> exit" << endl;
@@ -212,8 +259,7 @@
         
     double Dol = LMAX/LAMBDA;
-    bool fgnoauto = true;
     
     cout << " repicon[1] : Lambda=" << LAMBDA << " LMAX= " << LMAX << " NDishes=" << vdishes.size() 
-	 << " D-Dish=" << Ddish << " m." << endl;
+	 << " D-Dish=" << Ddish << " m. " << ((fgnoauto)?" NO-":"With-") << "AutoCorrelation" << endl;
  
     MultiDish mdish(LAMBDA, LMAX, vdishes, fgnoauto);
@@ -230,4 +276,6 @@
     Histo2D hrep = mdish.GetResponse();
     PrtTim("Apres mdish.GetResponse()");
+    HProf h1dnoise = mdish.GetProjNoiseLevel();
+    HProf h1drep = mdish.GetProjResponse();
 
     Four2DRespTable mdresp(hrep, Dol, LAMBDA);
@@ -241,6 +289,9 @@
 
     string outfile2 = "hdt_"+outfile;
-    cout << " repicon[4] : saving H2D-response, multidish config to PPF file " << outfile2 << endl;
-    SaveDTVecDishesH2Resp(outfile2, vdishes, mdresp);
+    POutPersist po2(outfile2);
+    cout << " repicon[4] : saving H1D/H2D-response, multidish config to PPF file " << outfile2 << endl;
+    po2 << PPFNameTag("h1dnoise") << h1dnoise;
+    po2 << PPFNameTag("h1drep") << h1drep;
+    SaveDTVecDishesH2Resp(po2, vdishes, mdresp);
 
     rc = 0;
@@ -265,5 +316,5 @@
 
 /*-- Nouvelle-Fonction --*/
-void SaveDTVecDishesH2Resp(string& outfile, vector<Dish>& vdishes, Four2DRespTable& mdresp)
+void SaveDTVecDishesH2Resp(POutPersist& po, vector<Dish>& vdishes, Four2DRespTable& mdresp)
 {
   char* names[5]={"did","posx","posy","diam","diamy"};
@@ -285,5 +336,4 @@
   }
   Histo2D h2rep=mdresp.GetResponse();
-  POutPersist po(outfile);
   po << PPFNameTag("mdish") << ntvd;
   po << PPFNameTag("h2rep") << h2rep;
