Changeset 3931 in Sophya for trunk/Cosmo/RadioBeam/pknoise.cc


Ignore:
Timestamp:
Dec 23, 2010, 6:38:00 PM (15 years ago)
Author:
ansari
Message:

1/ Ajout nouvelle config interfero en croix (ASKAP like)
2/ Correction et ameliorations diverses, en particulier sur les limites de rotation

ThetaMax=23 degres, angles phi, -phi, phi+pi, -phi-pi

Reza 23/12/2010

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/RadioBeam/pknoise.cc

    r3930 r3931  
    55    R. Ansari , C. Magneville - Juin 2010
    66
    7   Usage:  pknoise Diameter/Four2DRespTableFile OutPPFName
    8                  [NGen=1] [S2Cut=100.] [z_redshift=0.7]
     7  Usage:  pknoise pknoise [-parname value] Diameter/Four2DRespTableFile OutPPFName
     8          -parname : -noise , -renmax , -scut , -ngen , -z , -prt
    99---------------------------------------------------------------  */
    1010
     
    3838// ---------------------------------------------------------------------
    3939
    40 
     40void Usage()
     41{
     42  cout << " Usage:  pknoise [-parname value] Diameter/Four2DRespTableFile OutPPFName \n"
     43       << "    -noise NoiseLevel (default=1.) \n"
     44       << "    -renmax MaxValue (default : Do NOT renormalize 2D response value \n"   
     45       << "    -scut SCutValue (default=100.) \n"
     46       << "    -ngen NGen (default=1) number of noise fourier amp generations \n"
     47       << "    -z redshift (default=0.7) \n"
     48       << "    -prt PrtLev,PrtModulo (default=0,10) " << endl;
     49  return;
     50}
    4151
    4252//-------------------------------------------------------------------------
     
    4656{
    4757  if ( (narg<3)||((narg>1)&&(strcmp(arg[1],"-h")==0)) )  {
    48     cout << " Usage:  pknoise Diameter/Four2DRespTableFile OutPPFName [RenormalizeMax]\n"
    49          << "         [NGen=1] [S2Cut=100.] [z_redshift=0.7] [PrtLev,PrtModulo=0,10]" << endl;
     58    Usage();
    5059    return 1;
    5160  }
     
    6170  double DIAMETRE=100.;
    6271  string resptblname;
    63   if (isdigit(*arg[1])) {
     72  double NoiseLevel=1.;
     73 
     74  bool fgrenorm=false;
     75  double rmax=1.;
     76  int NMAX = 1;
     77  double SCut=0.;
     78  double z_Redshift=0.7 ;  // 21 cm at z=0.7 -> 0.357 m 
     79  int prtlev=0;
     80  int prtmod=10;
     81
     82  int ka=1;
     83  while (ka<(narg-1)) {
     84    if (strcmp(arg[ka],"-noise")==0) {
     85      NoiseLevel=atof(arg[ka+1]);
     86      ka+=2;
     87    }
     88    else if (strcmp(arg[ka],"-renmax")==0) {
     89      rmax=atof(arg[ka+1]);  fgrenorm=true;   ka+=2;
     90    }
     91    else if (strcmp(arg[ka],"-scut")==0) {
     92      SCut=atof(arg[ka+1]);    ka+=2;
     93    }
     94    else if (strcmp(arg[ka],"-ngen")==0) {
     95      NMAX=atoi(arg[ka+1]);    ka+=2;
     96    }
     97    else if (strcmp(arg[ka],"-z")==0) {
     98      z_Redshift=atof(arg[ka+1]);  ka+=2;
     99    }
     100    else if (strcmp(arg[ka],"-prt")==0) {
     101      sscanf(arg[ka+1],"%d,%d",&prtlev,&prtmod);   ka+=2;
     102    }
     103    else break;
     104  }
     105
     106  if ((ka+1)>=narg) {
     107    cout << " pknoise / Argument error " << endl;
     108    Usage();
     109    return 2;
     110  }
     111  if (isdigit(*arg[ka])) {
    64112    fgresptbl=false;
    65     DIAMETRE=atof(arg[1]);
     113    DIAMETRE=atof(arg[ka]);
    66114    sprintf(cbuff,"pknoise_Dish(%g m)", DIAMETRE);
    67115  }
    68116  else {
    69     resptblname=arg[1];
     117    resptblname=arg[ka];
    70118    fgresptbl=true;
    71     sprintf(cbuff,"pknoise_RespTblName=%s", arg[1]);
     119    sprintf(cbuff,"pknoise_RespTblName=%s", arg[ka]);
    72120  }
    73121  tits=cbuff;
    74   string outfile = arg[2]; 
     122  string outfile = arg[ka+1]; 
    75123  if (outfile==".")  outfile = "pknoise.ppf";
    76   bool fgrenorm=false;
    77   double rmax=1.;
    78   if (narg>3) {
    79     rmax=atof(arg[3]);
    80     fgrenorm=true;
    81   }
    82   int NMAX = 1;
    83   if (narg>4) NMAX = atoi(arg[4]);
    84   double SCut=0.;
    85   if (narg>5) SCut = atof(arg[5]);
    86   double z_Redshift=0.7 ;  // 21 cm at z=0.7 -> 0.357 m 
    87   if (narg>6) z_Redshift = atof(arg[6]);
    88   int prtlev=0;
    89   int prtmod=10;
    90   if (narg>7) sscanf(arg[7],"%d,%d",&prtlev,&prtmod);
    91   //-- end command line arguments
     124 //-- end command line arguments
    92125 
    93126  int rc = 1; 
Note: See TracChangeset for help on using the changeset viewer.