Changeset 3973 in Sophya for trunk/Cosmo/RadioBeam/applobe.cc
- Timestamp:
- Apr 18, 2011, 5:30:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/RadioBeam/applobe.cc
r3797 r3973 3 3 R. Ansari , C. Magneville - Juin 2010 4 4 5 Usage: applobe Diameter/Four2DRespTableFile In3DPPFName Out3DPPFName 6 [TargetBeamDoL] [ResmapleFactor=0.5,0.333...] 5 Usage: applobe [-g -t -fib] Diameter/Four2DRespTableFile In3DPPFName Out3DPPFName 6 [TargetBeamDiam] [ResmapleFactor=0.5,0.333...] 7 o -t : triangle beam shape in k-space 8 o -g : gaussian beam shape in k-space 9 o -fib: application d'un lobe fixe (independant de la frequence) 10 o Diameter/Four2DRespTableFile : diametre dish ou nom de fichier PPF reponse 2D 11 o In3DPPFName Out3DPPFName : Noms des fichiers (TArray<r_4> 3D) entree-sortie 12 o TargetBeamDiam : Correction à un beam fiduciel, independant de la frequence 13 avec specification de la valeur du diametre pour la frequence la plus basse 14 o ResmapleFactor : reechantillonnage du cube (2 -> surechantillonnage, 0.5 : 1 sur 2) 7 15 --------------------------------------------------------------- */ 8 16 … … 48 56 49 57 InitTim(); // Initializing the CPU timer 58 59 if ((narg < 3)||(strcmp(arg[1],"-h")==0)) { 60 cout << "Usage: applobe [-t -g -fib] Diameter/Four2DRespTableFile In3DPPFName Out3DPPFName \n" 61 << " [TargetBeamDiam] [ResmapleFactor=0.5,0.333...] \n" << endl; 62 if ((narg>1)&&(strcmp(arg[1],"-h")==0)) { 63 cout << " -t -g : Triangular / gaussian beam shape (def=gaussian) \n" 64 << " -fib : Application of a fixed (freq.independent) lobe dish-triangle or gaussian \n" 65 << " Diameter/Four2DRespTableFile : dish diameter or 2D response PPF file name\n" 66 << " In3DPPFName Out3DPPFName: Input/Output PPF file names (TArray<r_4> 3D) \n" 67 << " TargetBeamDiam: Corrected beam target diameter (D/Lambda at lowest frequency) \n" 68 << " DoL = 100 --> beam ~ 35 arcmin (D=30m @ z~0.5 Lambda~30cm)) \n" 69 << " ResmapleFactor : Resampling (2-> oversampling, 0.5 : 1/2 undersampling) \n" << endl; 70 } 71 return 1; 72 } 73 50 74 Timer tm("applobe"); 51 75 76 // decodage arguments 77 bool fggaussian=true; // true -> gaussian beam 78 bool fixedbeam=false; // true -> apply freq. independent beam 79 80 // decodage argument optionnel 81 bool fgoptarg=true; 82 while (fgoptarg) { 83 string fbo = arg[1]; 84 if (fbo=="-t") { fggaussian=false; arg++; narg--; } 85 else if (fbo=="-g") { fggaussian=true; arg++; narg--; } 86 else if (fbo=="-fib") { fixedbeam=true; arg++; narg--; } 87 else fgoptarg=false; 88 } 52 89 if (narg < 3) { 53 cout << "Usage: applobe Diameter/Four2DRespTableFile In3DPPFName Out3DPPFName " 54 << " [TargetBeamDoL] [ResmapleFactor=0.5,0.333...] \n" << endl; 55 return 1; 56 } 57 58 // decodage arguments 90 cout << " applobe/error arguments , applobe -h for help " << endl; 91 return 2; 92 } 93 59 94 bool fgresptbl=true; 60 95 double DIAMETRE=100.; … … 64 99 DIAMETRE=atof(arg[1]); 65 100 } 66 else resptblname=arg[1];67 101 else resptblname=arg[1]; 102 68 103 string inname = arg[2]; 69 104 string outname = arg[3]; 70 105 bool fgcorrbeam=false; 71 double tbeamD oL=135;106 double tbeamDiam=50.; 72 107 if (narg>4) { 73 tbeamD oL=atof(arg[4]);74 if (tbeamD oL>1) fgcorrbeam=true;108 tbeamDiam=atof(arg[4]); 109 if (tbeamDiam>1.) fgcorrbeam=true; 75 110 } 76 111 bool fgresample=false; … … 83 118 int rc = 91; 84 119 85 cout << " ====== applobe : Input skycube name= " << inname << " OutName=" << outname; 120 cout << " ====== applobe : Input skycube name= " << inname << " OutName=" << outname << endl; 121 cout << ((fggaussian)?" Gaussian ":" Triangular") << ((fixedbeam)?" Fixed (freq.independent)":"") << " beams" << endl; 86 122 bool fginmap=true; 87 123 try { … … 113 149 double lambda = conv.getLambda(); 114 150 115 Four2DResponse fresp(2, DIAMETRE/lambda, DIAMETRE/lambda, lambda); 151 int typbeam=(fggaussian)?1:2; 152 Four2DResponse fresp(typbeam, DIAMETRE/lambda, DIAMETRE/lambda, lambda); 116 153 Four2DResponse* fresp_p=&fresp; 117 154 Four2DRespTable resptbl; … … 119 156 cout << "applobe[2.b]: initializing Four2DRespTable from file" << resptblname << endl; 120 157 resptbl.readFromPPF(resptblname); 158 resptbl.renormalize(1.); 121 159 fresp_p=&resptbl; 122 160 } … … 126 164 127 165 if (fgcorrbeam) { 128 double DoL = tbeamD oL;166 double DoL = tbeamDiam/lambda; 129 167 double tbeamarcmin = RadianToDegree(1.22/DoL)*60.; 130 int typcb = 2;168 int typcb = (fggaussian)?1:2; 131 169 // if (fgresptbl) typcb=22; 132 170 Four2DResponse tbeam(typcb, DoL, DoL ); 133 cout << "applobe[3]: calling Correct2RefLobe() with target beam D /Lambda=" << DoL134 << " -> arcmin " << tbeamarcmin << " TypDishResp=" << typcb << endl;171 cout << "applobe[3]: calling Correct2RefLobe() with target beam Diameter=" << tbeamDiam 172 << " D/Lambda=" << DoL << " -> arcmin " << tbeamarcmin << " TypDishResp=" << typcb << endl; 135 173 beam.Correct2RefLobe(tbeam, incube, dx, dy, Freq0MHz, dfreq); 174 } 175 else if (fixedbeam) { 176 cout << "applobe[3]: calling ApplyLobe() (freq.independent beam) ... " << endl; 177 beam.ApplyLobe(incube, dx, dy, Freq0MHz); 136 178 } 137 179 else {
Note:
See TracChangeset
for help on using the changeset viewer.