Changeset 3825 in Sophya
- Timestamp:
- Aug 2, 2010, 7:29:48 PM (15 years ago)
- Location:
- trunk/Cosmo/RadioBeam
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/RadioBeam/README
r3793 r3825 22 22 - syncube.cc : Synchrotron 3D temperature cube from HASLAM 400 MHz map 23 23 - srcat2cube.cc : radio source 3D temperature cube from NVSS catalog 24 - gsm2cube.cc : Computes 3D temperature cube from a set of GSM (Global Sky Model) healpix PPF maps 24 25 - tjyk.cc : test de la classe H21Conversions 25 26 -
trunk/Cosmo/RadioBeam/calcpk.cc
r3789 r3825 53 53 bool fgaddnoise=false; 54 54 if (narg>4) { 55 pixsignoise=atof(arg[ 3]);55 pixsignoise=atof(arg[4]); 56 56 fgaddnoise=true; 57 57 } -
trunk/Cosmo/RadioBeam/cubedef.h
r3796 r3825 16 16 static double PhiSizeDegre = 30.; // Taille de la carte en degre selon delta (axe Y) 17 17 18 /* --- Parametres avec generation Reza from HASLAM + NVSS */ 18 19 static double Freq0MHz = 875.; // premiere frequence 19 20 static double FreqSizeMHz = 70.4; // Taille de la carte en MHz (axe Z) 20 21 21 / *z = 0.56, freq_center=910 MHz , dA_comov ~= 2060 Mpc ,22 5 arcmin -> 3 Mpc , 0.275 MHz -> 3 Mpc (H(ze) ~ 94 km/s/Mpc */ 22 // z = 0.56, freq_center=910 MHz , dA_comov ~= 2060 Mpc , 23 // 5 arcmin -> 3 Mpc , 0.500 MHz -> 3 Mpc (H(ze) ~ 94 km/s/Mpc) 23 24 // Taille de cellule pour le calcul du spectre de puissance 3D 24 25 static double ComovDA = 2060.; … … 26 27 static double YCellSizeMpc = 3.; 27 28 static double ZCellSizeMpc = 1.5; 29 30 /* --- Parametres pour utilisation des cartes GSM 31 static double Freq0MHz = 820.; // premiere frequence 32 static double FreqSizeMHz = 128.; // Taille de la carte en MHz (axe Z) 33 34 // z = 0.6, freq_center=884 MHz , dA_comov ~= 2185 Mpc , 35 // 5 arcmin -> 3 Mpc , 0.550 MHz -> 3 Mpc (H(ze) ~ 96 km/s/Mpc) 36 // Taille de cellule pour le calcul du spectre de puissance 3D 37 static double ComovDA = 2185.; 38 static double XCellSizeMpc = 3.; 39 static double YCellSizeMpc = 3.; 40 static double ZCellSizeMpc = 3.; 41 */ 42 28 43 29 44 //--- Parametres des lois de puissance en frequence -
trunk/Cosmo/RadioBeam/makefile
r3792 r3825 6 6 include $(SOPHYABASE)/include/sophyamake.inc 7 7 8 all : pknoise repicon calcpk calcpk2 syncube srcat2cube tjyk applobe 8 all : pknoise repicon calcpk calcpk2 syncube srcat2cube tjyk applobe gsm2cube 9 9 10 10 clean : … … 29 29 syncube : Objs/syncube 30 30 echo 'makefile : syncube made' 31 32 gsm2cube : Objs/gsm2cube 33 echo 'makefile : gsm2cube made' 31 34 32 35 srcat2cube : Objs/srcat2cube … … 95 98 $(CXXCOMPILE) -o Objs/applobe.o applobe.cc 96 99 100 ### programme gsm2cube 101 Objs/gsm2cube : Objs/gsm2cube.o $(PKGOLIST) 102 $(CXXLINK) -o Objs/gsm2cube Objs/gsm2cube.o $(PKGOLIST) $(SOPHYAEXTSLBLIST) 103 104 Objs/gsm2cube.o : gsm2cube.cc $(PKGHLIST) 105 $(CXXCOMPILE) -o Objs/gsm2cube.o gsm2cube.cc 97 106 98 107 ### les classes / fonctions -
trunk/Cosmo/RadioBeam/specpk.cc
r3787 r3825 46 46 { 47 47 typ_=typ; 48 SetRenormFac(); 48 49 } 49 50 … … 52 53 { 53 54 wk/=DeuxPI; 55 double retv=1.; 54 56 switch (typ_) 55 57 { 56 58 case 1: 57 ret urnPnu1(wk);59 retv=Pnu1(wk); 58 60 break; 59 61 case 2: 60 ret urnPnu2(wk);62 retv=Pnu2(wk); 61 63 break; 62 64 case 3: 63 ret urnPnu3(wk);65 retv=Pnu3(wk); 64 66 break; 65 67 case 4: 66 ret urnPnu4(wk);68 retv=Pnu4(wk); 67 69 break; 68 70 default : … … 83 85 } 84 86 } 85 return csp; 86 } 87 break; 88 } 87 retv=csp; 88 } 89 break; 90 } 91 return retv*renorm_fac; 89 92 } 90 93 // Return a vector representing the power spectrum (for checking) … … 97 100 } 98 101 102 double SpectralShape::Sommek2Pk(double kmax, int n) 103 { 104 double dk=kmax/(double)n; 105 double s=0.; 106 for(int i=1; i<=n; i++) { 107 double ck=(double)i*dk; 108 s += Value(ck)*ck*ck; 109 } 110 return s*dk*4.*M_PI; 111 } 99 112 //-------------------------------------------------- 100 113 // -- Four2DResponse class : test P(k) class -
trunk/Cosmo/RadioBeam/specpk.h
r3769 r3825 30 30 inline double Value(double wk) { return((*this)(wk)); } 31 31 // Return a vector representing the power spectrum (for checking) 32 Histo GetPk(int n=256); 32 Histo GetPk(int n=256); 33 double Sommek2Pk(double kmax=1000., int n=5000); 34 inline void SetRenormFac(double f=1.) { renorm_fac=f; } 33 35 int typ_; 36 double renorm_fac; 34 37 }; 35 38 -
trunk/Cosmo/RadioBeam/srcat2cube.cc
r3785 r3825 72 72 sa_size_t idxd = nvss.IndexNom("C_DEJ2000"); 73 73 sa_size_t idxf = nvss.IndexNom("S1_4"); 74 cout << " ... Index Alpha: " << idxa << " Delta: " << idxd << " Flux: " << idxf << endl; 74 sa_size_t idxmajax = nvss.IndexNom("MajAxis"); 75 sa_size_t idxminax = nvss.IndexNom("MinAxis"); 76 77 cout << " ... Index Alpha: " << idxa << " Delta: " << idxd << " Flux: " << idxf 78 << " MajAxis: " << idxmajax << " MajAxis: " << idxminax << endl; 75 79 76 80 TArray<r_4> omap(NPhi,NTheta); … … 83 87 84 88 sa_size_t srccnt=0; 89 sa_size_t extendedsrccnt=0; 90 85 91 double meanflx=0.; 86 92 double flxmin=9.e99; … … 89 95 double dtet = ThetaSizeDegre/(double)NTheta; 90 96 double dphi = PhiSizeDegre/(double)NPhi; 97 double mpixsizarcmin = 0.5*(dtet+dphi)*60.; 98 91 99 for (sa_size_t n=0; n<nvss.NRows(); n++) { 92 100 r_8* pline=nvss.GetLineD(n); … … 94 102 double delta=pline[idxd]; // delta en degre 95 103 double flx=pline[idxf]*1.e-3; // flux en Jy 104 double srcszarcmin=0.5*(pline[idxmajax]+pline[idxminax])/60.; // taille (extension de la source en arcmin 105 if (srcszarcmin<1.) srcszarcmin=1.; 96 106 double tet = 90.-delta; 97 107 double phi = alpha; … … 100 110 if ((i<0)||(i>=omap.SizeX())) continue; 101 111 if ((j<0)||(j>=omap.SizeY())) continue; 102 omap(i,j) += flx; 112 double srat = (4.*srcszarcmin*srcszarcmin)/(mpixsizarcmin*mpixsizarcmin); 113 if (srcszarcmin<(0.5*mpixsizarcmin)) { // Toute l'energie dans un seul pixel 114 omap(i,j) += flx*srat; 115 } 116 else { // on repartit l'energie de la source dans plusieurs pixels 117 extendedsrccnt++; 118 for(int bi=-1;bi<=1;bi++) { 119 for(sa_size_t bj=-1; bj<=1; bj++) { 120 sa_size_t ii = (phi-phi0+bi*srcszarcmin/60.)/dphi; 121 sa_size_t jj = (tet-tet0+bj*srcszarcmin/60.)/dtet; 122 if ((ii<0)||(ii>=omap.SizeX())) continue; 123 if ((jj<0)||(jj>=omap.SizeY())) continue; 124 if ((bi==0)&&(bj==0)) omap(ii,jj) += flx*srat*0.3; 125 else omap(ii,jj) += flx*srat*0.7/8.; 126 } 127 } 128 } 103 129 srccnt++; meanflx+=flx; 104 130 if (flx<flxmin) flxmin=flx; … … 108 134 cout << "srccat2cube[3]: Output rectangular map computed " << endl; 109 135 meanflx /= (double)srccnt; 110 cout << " SrcCount in map: " << srccnt << " -> meanFlx=" << meanflx << " min=" << flxmin 136 cout << " SrcCount in map: " << srccnt << " extended=" << extendedsrccnt 137 << " -> meanFlx=" << meanflx << " min=" << flxmin 111 138 << " max=" << flxmax << " Jy" << endl; 112 139 113 140 double mean, sigma; 141 r_4 mintemp, maxtemp; 142 omap.MinMax(mintemp, maxtemp); 114 143 MeanSigma(omap, mean, sigma); 115 144 cout << " Src Map : Mean=" << mean << " Sigma=" << sigma << " Jy - Sizes:" << endl; -
trunk/Cosmo/RadioBeam/subtractradsrc.cmd
r3796 r3825 9 9 # 1.a/ Run SimLSS 10 10 csh> ~/Objs/exe/cmvginit3df -a -1 -2 -C -G 0. -F 0 -x 360,3 -y 360,3 -z 256,1.5 -Z 0.56 -8 1. -n 10000 -O 0,2 -o lssz056 -T 2 11 # 1.b/ Change the X and Z axis of the cube to adapt it to RadioBeam package convention 11 # 1.b/ To run SimLSS with GSM map parameters (DeltaFreq=500 MHz) 12 csh> ~/Objs/exe/cmvginit3df -a -1 -2 -C -G 0. -F 0 -x 360,3 -y 360,3 -z 256,3 -Z 0.60 -8 1. -n 10000 -O 0,2 -o lssz060 -T 2 13 14 # 1.c/ Change the X and Z axis of the cube to adapt it to RadioBeam package convention 12 15 # SimLSS output : the radial (redshift) direction along X axis of the cube (TArray) 13 16 # RadioBeam cubes : the radial (redshift) direction along Z axis of the cube (TArray) … … 27 30 KeepObj(omap); 28 31 29 print omap 30 saveppf omap lsscube.ppf 32 rename omap lsscube 33 print lsscube 34 # expmeansig lsscube val 35 saveppf lsscube lsscube.ppf 31 36 32 37 csh> spiapp -term -exec racube.pic 38 33 39 34 40 ## Step 2/ Produce synchrotron and radio source sky cubes (cube unit is Temparature- Kelvin) … … 69 75 # with the lobe effect 70 76 csh> ./Objs/calcpk lsscube_lobe.ppf lsspklobe.ppf 0.2 77 csh> ./Objs/calcpk lsscube_lobe.ppf lsspklobewn.ppf 0.2 0.35 71 78 csh> ./Objs/calcpk lsscube_corlobe.ppf lsspkcorlobe.ppf 0.2 72 79 … … 78 85 # 4.c/ Extract LSS P(k) from Foreground+LSS+noise , after cleaning/subtraction without beam 79 86 csh> ./Objs/calcpk2 lsscube.ppf 0.2 fgndcube.ppf 1000 subpk.ppf 0.35 50. 0. 0. 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 50. 130. 3. 87 # 4.d / Extract LSS P(k) from Foreground+LSS+noise and beam effect, without beam correction 88 csh> ./Objs/calcpk2 lsscube_lobe.ppf 0.2 fgndcube_lobe.ppf 1000 subpklobe.ppf 0.35 50. 0. 3. 89 # 4.e / Extract LSS P(k) from Foreground+LSS+noise and beam effect - correcting to a beam of Diam/Lambda = 130 90 csh> ./Objs/calcpk2 lsscube_lobe.ppf 0.2 fgndcube_lobe.ppf 1000 subpkcorlobe.ppf 0.35 50. 130. 3. 82 91 83 92 ### Step 5 / Check the results using spiapp 93 setaxesatt 'font=helvetica,bold,16 fixedfontsize minorticks' 84 94 delobjs * 85 95 openppf fgndpk.ppf 86 disp fgndpk 'logx logy'87 # Adjust the limits88 96 openppf fgndpklobe.ppf 89 disp fgndpklobe 'same red'90 disp fgndpklobe 'same red nsta'91 97 openppf fgndpkcorlobe.ppf 92 disp fgndpkcorlobe 'same magenta nsta'93 98 openppf lsspk.ppf 94 disp lsspk 'same gold nsta'95 99 openppf lsspklobe.ppf 96 disp lsspklobe 'same green nsta' 100 openppf lsspklobewn.ppf 97 101 openppf subpklobe.ppf 98 disp subpklobe 'same blue nsta' 102 openppf subpkcorlobe.ppf 103 104 openppf subpknolss.ppf 105 106 disp lsspk 'logx logy nsta xylimits=0.005,2.,4e-11,8e-6 gold' 107 disp lsspklobe 'same nsta orange' 108 disp lsspklobewn 'same nsta siennared' 109 110 disp fgndpk 'logx logy nsta xylimits=0.005,2.,1e-10,1. navyblue' 111 disp fgndpklobe 'same nsta blue' 112 disp fgndpkcorlobe 'same nsta skyblue' 113 disp lsspk 'same nsta gold' 114 disp lsspklobewn 'same nsta siennared' 115 settitle 'Pk[LSS] , Pk[Foreground] and lobe effect (Dish D=50 m)' ' ' 'font=helvetica,bold,18' 116 set lines ( 'Pk[Foreground]' 'Pk[fgnd]*Lobe' 'Pk[fgnd]*Lobe/Corrected' 'Pk[LSS]' 'Pk[LSS]*Lobe+Noise' ) 117 set cols ( navyblue blue skyblue gold siennared ) 118 textdrawer lines cols 'font=helvetica,bold,16 frame' 119 120 disp lsspk 'logx logy nsta xylimits=0.005,2.,4e-9,4e-5 gold' 121 disp lsspklobewn 'same nsta siennared' 122 disp subpkcorlobe 'same nsta red' 123 disp subpknolsslobe 'same nsta green' 124 125 settitle 'Recovered Pk[LSS] from LSS+Foreground(GSM) (Dish D=50 m)' ' ' 'font=helvetica,bold,18' 126 set lines ( 'Pk[LSS]' 'Pk[LSS*lobe+noise]' 'Pk[ExtractedLSS]' 'Pk[residual,NoLSS]' ) 127 set cols ( gold siennared red green ) 128 textdrawer lines cols 'font=helvetica,bold,16 frame'
Note:
See TracChangeset
for help on using the changeset viewer.