Changeset 3796 in Sophya
- Timestamp:
- Jun 29, 2010, 7:26:01 PM (15 years ago)
- Location:
- trunk/Cosmo/RadioBeam
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/RadioBeam/applobe.cc
r3792 r3796 3 3 R. Ansari , C. Magneville - Juin 2010 4 4 5 Usage: applobe In3DPPFName Out3DPPFName [ResmapleFactor=0.5,0.333...] [TargetBeamDoL] 5 Usage: applobe Diameter/Four2DRespTableFile In3DPPFName Out3DPPFName 6 [TargetBeamDoL] [ResmapleFactor=0.5,0.333...] 6 7 --------------------------------------------------------------- */ 7 8 … … 50 51 51 52 if (narg < 3) { 52 cout << "Usage: applobe In3DPPFName Out3DPPFName [ResmapleFactor=0.5,0.333...] [TargetBeamDoL]\n" << endl; 53 cout << "Usage: applobe Diameter/Four2DRespTableFile In3DPPFName Out3DPPFName " 54 << " [TargetBeamDoL] [ResmapleFactor=0.5,0.333...] \n" << endl; 53 55 return 1; 54 56 } 55 57 56 58 // decodage arguments 57 string outname = arg[2]; 58 string inname = arg[1]; 59 bool fgresample=false; 60 double fresamp=1.; 61 if (narg>3) { 62 fresamp=atof(arg[3]); 63 if ((fabs(fresamp)>1.e-2)&&(fabs(fresamp-1.)>1.e-2)) fgresample=true; 59 bool fgresptbl=true; 60 double DIAMETRE=100.; 61 string resptblname; 62 if (isdigit(*arg[1])) { 63 fgresptbl=false; 64 DIAMETRE=atof(arg[1]); 64 65 } 66 else resptblname=arg[1]; 67 68 string inname = arg[2]; 69 string outname = arg[3]; 65 70 bool fgcorrbeam=false; 66 71 double tbeamDoL=135; … … 68 73 tbeamDoL=atof(arg[4]); 69 74 if (tbeamDoL>1) fgcorrbeam=true; 75 } 76 bool fgresample=false; 77 double fresamp=1.; 78 if (narg>5) { 79 fresamp=atof(arg[5]); 80 if ((fabs(fresamp)>1.e-2)&&(fabs(fresamp-1.)>1.e-2)) fgresample=true; 70 81 } 71 82 … … 101 112 conv.setFrequency(Freq0MHz); 102 113 double lambda = conv.getLambda(); 103 Four2DResponse fresp(2, InterfArrayDiametre/lambda, InterfArrayDiametre/lambda, lambda); 104 BeamEffect beam(fresp); 114 115 Four2DResponse fresp(2, DIAMETRE/lambda, DIAMETRE/lambda, lambda); 116 Four2DResponse* fresp_p=&fresp; 117 Four2DRespTable resptbl; 118 if (fgresptbl) { 119 cout << "applobe[2.b]: initializing Four2DRespTable from file" << resptblname << endl; 120 resptbl.readFromPPF(resptblname); 121 fresp_p=&resptbl; 122 } 123 else cout << " applobe[2.b]: Four2DResponse ( Diameter=" << DIAMETRE << " Lambda= " << lambda 124 << " DoL=" << DIAMETRE/lambda << " ) " << endl; 125 BeamEffect beam(*fresp_p); 105 126 106 127 if (fgcorrbeam) { 107 128 double DoL = tbeamDoL; 108 129 double tbeamarcmin = RadianToDegree(1.22/DoL)*60.; 109 Four2DResponse tbeam(2, DoL, DoL ); 130 int typcb = 2; 131 if (fgresptbl) typcb=22; 132 Four2DResponse tbeam(typcb, DoL, DoL ); 110 133 cout << "applobe[3]: calling Correct2RefLobe() with target beam D/Lambda=" << DoL 111 << " -> arcmin " << tbeamarcmin << endl;134 << " -> arcmin " << tbeamarcmin << " TypDishResp=" << typcb << endl; 112 135 beam.Correct2RefLobe(tbeam, incube, dx, dy, Freq0MHz, dfreq); 113 136 } -
trunk/Cosmo/RadioBeam/calcpk2.cc
r3792 r3796 7 7 R. Ansari , C. Magneville - Juin 2010 8 8 9 Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync InMapRadioSource convFacRsc OutPk 10 [PixNoiseLevel] [ TargetBeamArcmin] [NSigSrcThr]9 Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync InMapRadioSource convFacRsc OutPkFile 10 [PixNoiseLevel] [Diameter/Four2DRespTableFile] [TargetBeamArcmin] [NSigSrcThr] 11 11 --------------------------------------------------------------- */ 12 12 … … 44 44 { 45 45 if (narg<6) { 46 cout << " Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync OutPk \n"47 << " [PixNoiseLevel] [ TargetBeamArcmin] [NSigSrcThr]" << endl;46 cout << " Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync OutPkFile \n" 47 << " [PixNoiseLevel] [Diameter/Four2DRespTableFile] [TargetBeamArcmin] [NSigSrcThr]" << endl; 48 48 return 1; 49 49 } … … 65 65 66 66 bool fgcorrbeam=true; 67 68 bool fgresptbl=false; 69 double DIAMETRE=100.; 70 string resptblname; 71 if (narg>7) { 72 if (isdigit(*arg[7])) { 73 fgresptbl=false; 74 DIAMETRE=atof(arg[7]); 75 } 76 else { 77 resptblname=arg[7]; 78 fgresptbl=true; 79 } 80 } 67 81 double tbeamDoL=135; 68 if (narg> 7) {69 tbeamDoL=atof(arg[ 7]);82 if (narg>8) { 83 tbeamDoL=atof(arg[8]); 70 84 if (tbeamDoL<1.) fgcorrbeam=false; 71 85 } 72 86 bool fgclnsrc=true; 73 87 double nsigsrc=5.; 74 if (narg> 8) {75 nsigsrc=atof(arg[ 8]);88 if (narg>9) { 89 nsigsrc=atof(arg[9]); 76 90 if (nsigsrc<1.e-6) fgclnsrc=false; 77 91 } … … 119 133 conv.setFrequency(Freq0MHz); 120 134 double lambda = conv.getLambda(); 121 Four2DResponse arep(2, InterfArrayDiametre/lambda, InterfArrayDiametre/lambda, lambda); 135 Four2DResponse arep(2, DIAMETRE/lambda, DIAMETRE/lambda, lambda); 136 Four2DResponse* arep_p=&arep; 137 Four2DRespTable resptbl; 138 if (fgresptbl) { 139 cout << "calcpk2[3.a]: initializing Four2DRespTable from file" << resptblname << endl; 140 resptbl.readFromPPF(resptblname); 141 arep_p=&resptbl; 142 } 143 else cout << " calcpk2[3.a]: Four2DResponse ( Diameter=" << DIAMETRE << " Lambda= " << lambda 144 << " DoL=" << DIAMETRE/lambda << " ) " << endl; 145 122 146 double DoL = tbeamDoL; 123 147 double tbeamarcmin = RadianToDegree(1.22/DoL)*60.; 124 Four2DResponse tbeam(2, DoL, DoL ); 125 ForegroundCleaner cleaner(arep, tbeam, skycube); 148 int typcb = 2; 149 // if (fgresptbl) typcb=22; 150 Four2DResponse tbeam(typcb, DoL, DoL ); 151 152 ForegroundCleaner cleaner(*arep_p, tbeam, skycube); 126 153 if (fgcorrbeam) { 127 cout << "calcpk2[3. a] : calling cleaner.BeamCorrections() for target beam D/Lambda=" << DoL128 << " -> arcmin " << tbeamarcmin << endl;154 cout << "calcpk2[3.b] : calling cleaner.BeamCorrections() for target beam D/Lambda=" << DoL 155 << " -> arcmin " << tbeamarcmin << " TypDishResp=" << typcb << endl; 129 156 cleaner.BeamCorrections(); 130 157 } 131 cout << " calcpk2[3. b] : calling cleaner.CleanNegatives() ... " << endl;158 cout << " calcpk2[3.c] : calling cleaner.CleanNegatives() ... " << endl; 132 159 cleaner.CleanNegatives(); 133 160 if (fgclnsrc) { 134 cout << "calcpk2[3. c] : calling cleaner.CleanPointSources() with threshold NSigma=" << nsigsrc << endl;161 cout << "calcpk2[3.d] : calling cleaner.CleanPointSources() with threshold NSigma=" << nsigsrc << endl; 135 162 cleaner.CleanPointSources(nsigsrc); 136 163 } -
trunk/Cosmo/RadioBeam/cubedef.h
r3789 r3796 39 39 static double sigPLidxSrc = 0.15; // Sigma de la variation (gaussienne) de l'index 40 40 41 // Parametres pour la reponse en Fourier de l'instrument :42 static double InterfArrayDiametre = 50.; // Taille du reseau en metres43 44 41 /* 45 42 static sa_size_t NTheta=256; -
trunk/Cosmo/RadioBeam/mdish.cc
r3792 r3796 33 33 return ( (wk<1.)?(1.-wk):0.); 34 34 break; 35 case 22: // Reponse parabole diametre D Triangle <= kmax= 2 pi D / lambda + trou au centre 36 wk = sqrt(kx*kx+ky*ky)/dx_/2./M_PI; 37 if (wk<0.025) return 39.*wk; 38 else if (wk<1.) return (1.-wk); 39 else return 0.; 40 break; 35 41 case 3: // Reponse rectangle Dx x Dy Triangle (|kx|,|k_y|) <= (2 pi Dx / lambda, 2 pi Dx / lambda) 36 wkx = kx/2./M_PI/dx_;37 wky = ky/2./M_PI/dy_;42 wkx = fabs(kx)/2./M_PI/dx_; 43 wky = fabs(ky)/2./M_PI/dy_; 38 44 return ( ((wkx<1.)&&(wky<1.))?((1.-wkx)*(1-wky)):0.); 39 45 break; … … 78 84 hrep_.FindBin(kx, ky, i, j); 79 85 return hrep_(i, j); 86 } 87 88 double Four2DRespTable::renormalize(double max) 89 { 90 double cmx = hrep_.VMax(); 91 hrep_ *= (max/cmx); 92 return cmx; 80 93 } 81 94 -
trunk/Cosmo/RadioBeam/mdish.h
r3792 r3796 20 20 #endif 21 21 22 // -- Four2DResponse : Reponse instrumentale ds le plan k_x,k_y ( angles theta,phi)22 // -- Four2DResponse : Reponse instrumentale ds le plan k_x,k_y (frequences angulaires theta,phi) 23 23 // typ=1 : Reponse gaussienne parabole diametre D exp[ - 0.5 (lambda k_g / D )^2 ] 24 24 // typ=2 : Reponse parabole diametre D Triangle <= kmax= 2 pi D / lambda 25 25 // typ=3 : Reponse rectangle Dx x Dy Triangle (|kx|,|k_y|) <= (2 pi Dx / lambda, 2 pi Dx / lambda) 26 // typ=22 : Reponse parabole diametre D Triangle <= kmax= 2 pi D / lambda avec un trou au centre 27 26 28 class Four2DResponse { 27 29 public: … … 65 67 // On donne dx=D/lambda=Dx/lambda , dy=Dy/lambda 66 68 Four2DRespTable(Histo2D const & hrep, double d, double lambda=1.); 69 // Apres renormalisaton Value(kx,ky) <= max 70 double renormalize(double max=1.); 67 71 // Return the 2D response for wave vector (kx,ky) 68 72 virtual double Value(double kx, double ky); -
trunk/Cosmo/RadioBeam/repicon.cc
r3792 r3796 36 36 { 37 37 if (((narg>1)&&(strcmp(arg[1],"-h")==0))||(narg<3)) { 38 cout << " Usage: repicon configId OutPPFName [Lambda ]"38 cout << " Usage: repicon configId OutPPFName [Lambda=0.357] [RenormalizeMax]" 39 39 << " configs: f4x4 , f8x8 , f20x20 Filled array of nxn dishes \n" 40 40 << " confA , confB, confC : semi-filled array of dishes \n" … … 54 54 if (outfile==".") outfile = "repicon.ppf"; 55 55 double LAMBDA=0.357 ; // 21 cm at z=0.7 56 if (narg>3) LAMBDA = atof(arg[2]); 57 56 if (narg>3) LAMBDA = atof(arg[3]); 57 bool fgrenorm=false; 58 double rmax=1.; 59 if (narg>4) { 60 rmax=atof(arg[4]); 61 fgrenorm=true; 62 } 58 63 //-- end command line arguments 59 64 … … 61 66 try { // exception handling try bloc at top level 62 67 63 cout << " 2.c/ Creating MultiDish Filled Array " << endl;64 68 double Ddish = 5.; 65 69 double Ddish2 = 7.5; … … 122 126 double LMAX = D; 123 127 bool fgnoauto = true; 124 int NRX= 100;125 int NRY= 100;128 int NRX=200; 129 int NRY=200; 126 130 127 131 MultiDish mdish(LAMBDA, LMAX, vdishes, fgnoauto); … … 134 138 PrtTim("Apres mdish.GetResponse()"); 135 139 140 Four2DRespTable mdresp(hrep, Dol, LAMBDA); 141 if (fgrenorm) { 142 cout << " repicon[2.b] call to mdresp.renormalize(" << rmax << ")"; 143 double omax=mdresp.renormalize(rmax); 144 cout << " Old Max=" << omax << endl; 145 } 136 146 cout << " repicon[3] : saving Four2DRespTable for config " << config << " to PPF file " << outfile << endl; 137 Four2DRespTable mdresp(hrep, Dol, LAMBDA);138 147 mdresp.writeToPPF(outfile); 139 148 -
trunk/Cosmo/RadioBeam/subtractradsrc.cmd
r3793 r3796 50 50 csh> spiapp -term -exec sumcubes.pic 51 51 52 ## Step 3/ Apply lobe effect on foreground cube and LSS cube53 csh> ./Objs/applobe fgndcube.ppf fgndcube_lobe.ppf54 csh> ./Objs/applobe lsscube.ppf lsscube_lobe.ppf52 ## Step 3/ Apply lobe (50 meter diameter array) effect on foreground cube and LSS cube 53 csh> ./Objs/applobe 50. fgndcube.ppf fgndcube_lobe.ppf 54 csh> ./Objs/applobe 50. lsscube.ppf lsscube_lobe.ppf 55 55 ## Step 3.b/ Correct for the lobe effect by bringing all to the beam of Diam/Lambda = 130 56 csh> ./Objs/applobe lsscube_lobe.ppf lsscube_corlobe.ppf 113057 csh> ./Objs/applobe fgndcube_lobe.ppf fgndcube_corlobe.ppf 113056 csh> ./Objs/applobe 50. lsscube_lobe.ppf lsscube_corlobe.ppf 130 57 csh> ./Objs/applobe 50. fgndcube_lobe.ppf fgndcube_corlobe.ppf 130 58 58 59 59 ### Step 4/ Compute power spectra … … 77 77 78 78 # 4.c/ Extract LSS P(k) from Foreground+LSS+noise , after cleaning/subtraction without beam 79 csh> ./Objs/calcpk2 lsscube.ppf 0.2 fgndcube.ppf 1000 subpk.ppf 0.35 0. 0.79 csh> ./Objs/calcpk2 lsscube.ppf 0.2 fgndcube.ppf 1000 subpk.ppf 0.35 50. 0. 0. 80 80 # 4.d / Extract LSS P(k) from Foreground+LSS+noise and beam effect - correcting to a beam of Diam/Lambda = 130 81 csh> ./Objs/calcpk2 lsscube_lobe.ppf 0.2 fgndcube_lobe.ppf 1000 subpklobe.ppf 0.35 130. 3.81 csh> ./Objs/calcpk2 lsscube_lobe.ppf 0.2 fgndcube_lobe.ppf 1000 subpklobe.ppf 0.35 50. 130. 3. 82 82 83 83 ### Step 5 / Check the results using spiapp
Note:
See TracChangeset
for help on using the changeset viewer.