Changeset 3931 in Sophya for trunk/Cosmo/RadioBeam/pknoise.cc
- Timestamp:
- Dec 23, 2010, 6:38:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/RadioBeam/pknoise.cc
r3930 r3931 5 5 R. Ansari , C. Magneville - Juin 2010 6 6 7 Usage: pknoise Diameter/Four2DRespTableFile OutPPFName8 [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 9 9 --------------------------------------------------------------- */ 10 10 … … 38 38 // --------------------------------------------------------------------- 39 39 40 40 void 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 } 41 51 42 52 //------------------------------------------------------------------------- … … 46 56 { 47 57 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(); 50 59 return 1; 51 60 } … … 61 70 double DIAMETRE=100.; 62 71 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])) { 64 112 fgresptbl=false; 65 DIAMETRE=atof(arg[ 1]);113 DIAMETRE=atof(arg[ka]); 66 114 sprintf(cbuff,"pknoise_Dish(%g m)", DIAMETRE); 67 115 } 68 116 else { 69 resptblname=arg[ 1];117 resptblname=arg[ka]; 70 118 fgresptbl=true; 71 sprintf(cbuff,"pknoise_RespTblName=%s", arg[ 1]);119 sprintf(cbuff,"pknoise_RespTblName=%s", arg[ka]); 72 120 } 73 121 tits=cbuff; 74 string outfile = arg[ 2];122 string outfile = arg[ka+1]; 75 123 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 92 125 93 126 int rc = 1;
Note:
See TracChangeset
for help on using the changeset viewer.