Changeset 3829 in Sophya for trunk/Cosmo
- Timestamp:
- Aug 3, 2010, 6:38:00 PM (15 years ago)
- Location:
- trunk/Cosmo/RadioBeam
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/RadioBeam/README
r3825 r3829 21 21 - applobe.cc : Antenna/array beam effect on 3D sky cube 22 22 - syncube.cc : Synchrotron 3D temperature cube from HASLAM 400 MHz map 23 - srcat2cube.cc : radio source 3D temperature cube from NVSS catalog23 - srcat2cube.cc : radio source 3D temperature cube from NVSS or North20cm catalogs 24 24 - gsm2cube.cc : Computes 3D temperature cube from a set of GSM (Global Sky Model) healpix PPF maps 25 25 - tjyk.cc : test de la classe H21Conversions -
trunk/Cosmo/RadioBeam/calcpk.cc
r3825 r3829 36 36 { 37 37 if (narg<3) { 38 cout << " Usage: calcpk In3DMap OutPk [InRenormFactor] [PixNoiseLevel]" << endl;38 cout << " Usage: calcpk In3DMap_PPFName OutPk_PPFName [InRenormFactor] [PixNoiseLevel] [Four3D_PPFName]" << endl; 39 39 return 1; 40 40 } … … 54 54 if (narg>4) { 55 55 pixsignoise=atof(arg[4]); 56 fgaddnoise=true;56 if (pixsignoise>1.e-9) fgaddnoise=true; 57 57 } 58 bool fgsavef3d=false; 59 string outf3dname="four3d.ppf"; 60 if (narg>5) { 61 outf3dname=arg[5]; 62 fgsavef3d=true; 63 } 64 58 65 59 66 cout << "calcpk[1] : reading 3D map from file " << inppfname << endl; … … 82 89 TArray< complex<r_4> > four3d; 83 90 ffts.FFTForward(inmap, four3d); 91 cout << " calcpk[2.b] inmap.Norm2()=" << inmap.Norm2() << " four3d.Norm2()=" << four3d.Norm2() << endl; 92 84 93 tm.Split(" After FFTForward "); 85 94 … … 92 101 pkc.SetCellSize(dkxmpc, dkympc, dkzmpc); 93 102 103 94 104 HProf hp = pkc.ComputePk(0.,256); 95 105 { … … 97 107 POutPersist po(outname); 98 108 po << hp; 99 outname = "f3d_" + outname; 100 cout << "calcpk[4.b] : writing four3d to PPF file " << outname << endl; 101 POutPersist pof(outname); 109 } 110 if (fgsavef3d) { 111 cout << "calcpk[4.b] : writing four3d to PPF file " << outf3dname << endl; 112 POutPersist pof(outf3dname); 102 113 pof << four3d; 103 114 } -
trunk/Cosmo/RadioBeam/cubedef.h
r3826 r3829 11 11 static sa_size_t NFreq = 256; 12 12 13 static double Theta0Degre = 75.; // -> Delta = +30 deg13 static double Theta0Degre = 65.; // -> Delta = +30 deg 14 14 static double Phi0Degre = 135.; // -> alpha = 9h00 15 15 static double ThetaSizeDegre = 30.; // Taille de la carte en degre selon alpha (axe X) … … 45 45 //--- Parametres des lois de puissance en frequence 46 46 static double AmpPL1 = 1.; // amp max PowerLaw 1 (synchrotron 47 static double PLidx1 = -2. 5; // index de la loi de puissance synchrotron47 static double PLidx1 = -2.8; // index de la loi de puissance synchrotron 48 48 static double sigPLidx1 = 0.1; // Sigma de la variation (gaussienne) de index1 49 49 // Amplitude max de la 2eme composante en loi de puissance (tirage plat 0 ... AmpPL2) -
trunk/Cosmo/RadioBeam/radutil.cc
r3783 r3829 10 10 setFrequency(freq); 11 11 setOmegaPix(opix); 12 setCosmoParam(); 12 13 } 13 14 … … 28 29 return jy*1e-26 / omegapix_ * lambda_ * lambda_ / 2. / k_Boltzman_Cst ; 29 30 } 31 32 33 double H21Conversions::setCosmoParam(double omegamatter, double omegabaryon, double h100, double fracHI) 34 { 35 OmegaMatter_=omegamatter; 36 OmegaBaryons_=omegabaryon; 37 h100_=h100; 38 fracHI_=fracHI; 39 OmegaLambda_=1.-OmegaMatter_; // Je neglige OmegaRadiation 40 return OmegaLambda_; 41 } 42 43 double H21Conversions::Mean21cmTemperature_mK() 44 { 45 double zz = 1.+z_; 46 double cc=zz*zz/sqrt(OmegaMatter_*zz*zz*zz+OmegaLambda_); 47 cc *= ((h100_/0.7)*(OmegaBaryons_/0.04)*(fracHI_/0.1)); 48 return (cc*0.57); 49 } -
trunk/Cosmo/RadioBeam/radutil.h
r3783 r3829 18 18 double toKelvin(double jy); // Conversion de Jansky en temperature (Kelvin) 19 19 20 double Mean21cmTemperature_mK(); // Temperature moyenne de l'emission a 21 cm en mK 21 inline double T21cm_Kelvin() { return Mean21cmTemperature_mK()/1000.; } 22 inline double T21cm_mK() { return Mean21cmTemperature_mK(); } 23 20 24 void setFrequency(double nu); // on definit la frequence en MHz 21 25 inline void setRedshift(double z) // on definit le redshift … … 31 35 { double cf=Angle(1.,Angle::ArcMin).ToRadian(); omegapix_ = opix*cf*cf; } 32 36 37 // Definition des parametres cosmologiques utiles pour le calcul de la temperature d'emission a 21 cm 38 // retourne la valeur de OmegaLambda (univers plat) 39 double setCosmoParam(double omegamatter=0.02581, double omegabaryon=0.0441, double h100=0.719, double fracHI=0.02); 40 inline void setFracHI(double fracHI=0.02) { fracHI_=fracHI; } 41 33 42 inline double getRedshift() { return z_; } 34 43 inline double getFrequency() { return freq_; } … … 42 51 { double cf=Angle(1.,Angle::Degree).ToRadian(); return omegapix_/cf/cf; } 43 52 53 44 54 static double SpeedOfLight_Cst; // Speed of light m/sec 45 55 static double Freq021cm_Cst; // Speed of light m/sec … … 50 60 double lambda_; 51 61 double omegapix_; 62 63 // Parametres cosmologiques pour calcul du coefficient de conversion Mass to T21 64 double OmegaMatter_; 65 double OmegaBaryons_; 66 double OmegaLambda_; 67 double h100_; 68 double fracHI_; 52 69 }; 53 70 -
trunk/Cosmo/RadioBeam/srcat2cube.cc
r3825 r3829 34 34 35 35 #include "cubedef.h" 36 37 //---------------- 38 int nvssTocube(DataTable& nvss, TArray<r_4>& omap, TArray<r_4>& cube); 39 int north20Tocube(DataTable& nor, TArray<r_4>& omap, TArray<r_4>& cube); 36 40 37 41 //---------------------------------------------------------------------------- … … 48 52 Timer tm("srcat2cube"); 49 53 50 if (narg < 3) {51 cout << "Usage: srccat2cube NVSS_CatalogFitsName Out3DPPFName [Out2DMapName]\n" << endl;54 if (narg < 4) { 55 cout << "Usage: srccat2cube -nvss/-north20 CatalogFitsName Out3DPPFName [Out2DMapName]\n" << endl; 52 56 return 1; 53 57 } … … 55 59 56 60 // decodage arguments 57 string outname = arg[2]; 58 string inname = arg[1]; 61 62 string copt=arg[1]; 63 string outname=arg[3]; 64 string inname=arg[2]; 59 65 int rc = 91; 60 66 61 cout << " ====== srccat2cube : Input NVSScatalog name= " << inname << " OutName=" << outname;67 cout << " ====== srccat2cube : Input catalog name= " << inname << " OutName=" << outname; 62 68 bool fginmap=true; 63 69 try { 64 DataTable nvss;65 cout << "srccat2cube[1]: reading NVSScatalog from " << inname << endl;70 DataTable cat; 71 cout << "srccat2cube[1]: reading source catalog from " << inname << endl; 66 72 { 67 73 FitsInOutFile fis(inname, FitsInOutFile::Fits_RO); 68 fis >> nvss; 69 } 70 cout << nvss; 71 sa_size_t idxa = nvss.IndexNom("C_RAJ2000"); 72 sa_size_t idxd = nvss.IndexNom("C_DEJ2000"); 73 sa_size_t idxf = nvss.IndexNom("S1_4"); 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; 79 74 fis >> cat; 75 } 76 cout << cat ; 80 77 TArray<r_4> omap(NPhi,NTheta); 81 double tet0 = Theta0Degre; 82 double phi0 = Phi0Degre; 83 double tetmax = tet0+ThetaSizeDegre; 84 double phimax = phi0+PhiSizeDegre; 85 86 cout << "srccat2cube[2]: projecting sources to map ..." << endl; 87 88 sa_size_t srccnt=0; 89 sa_size_t extendedsrccnt=0; 90 91 double meanflx=0.; 92 double flxmin=9.e99; 93 double flxmax=-9.e99; 94 95 double dtet = ThetaSizeDegre/(double)NTheta; 96 double dphi = PhiSizeDegre/(double)NPhi; 97 double mpixsizarcmin = 0.5*(dtet+dphi)*60.; 98 99 for (sa_size_t n=0; n<nvss.NRows(); n++) { 100 r_8* pline=nvss.GetLineD(n); 101 double alpha=pline[idxa]; // alpha en degre 102 double delta=pline[idxd]; // delta en degre 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.; 106 double tet = 90.-delta; 107 double phi = alpha; 108 sa_size_t i = (phi-phi0)/dphi; 109 sa_size_t j = (tet-tet0)/dtet; 110 if ((i<0)||(i>=omap.SizeX())) continue; 111 if ((j<0)||(j>=omap.SizeY())) continue; 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 } 129 srccnt++; meanflx+=flx; 130 if (flx<flxmin) flxmin=flx; 131 if (flx>flxmax) flxmax=flx; 132 } 133 134 cout << "srccat2cube[3]: Output rectangular map computed " << endl; 135 meanflx /= (double)srccnt; 136 cout << " SrcCount in map: " << srccnt << " extended=" << extendedsrccnt 137 << " -> meanFlx=" << meanflx << " min=" << flxmin 138 << " max=" << flxmax << " Jy" << endl; 139 140 double mean, sigma; 141 r_4 mintemp, maxtemp; 142 omap.MinMax(mintemp, maxtemp); 143 MeanSigma(omap, mean, sigma); 144 cout << " Src Map : Mean=" << mean << " Sigma=" << sigma << " Jy - Sizes:" << endl; 145 omap.Show(); 146 147 H21Conversions conv; 148 conv.setRedshift(0.); 149 conv.setOmegaPixDeg2(dphi*dtet); 150 cout << "srccat2cube[4] H21Conversions, OmegaPix=" << conv.getOmegaPix() << " srad" 151 << " toKelvin(1 Jy)= " << conv.toKelvin(1.) << endl; 152 omap *= (r_4)conv.toKelvin(1.); 153 MeanSigma(omap, mean, sigma); 154 cout << " After conversion : Mean=" << mean << " Sigma=" << sigma << " Kelvin " << endl; 78 TArray<r_4> ocube(NPhi,NTheta,NFreq); 79 if (copt=="-nvss") nvssTocube(cat, omap, ocube); 80 else north20Tocube(cat, omap, ocube); 155 81 156 if (narg > 3) { 157 string ppfname = arg[3]; 158 cout << " srccat2cube[4]: Saving inmap/outmap tp PPF file-> " << ppfname << endl; 159 POutPersist po(ppfname); 160 po << PPFNameTag("omap") << omap; 161 } 162 163 TArray<r_4> ocube(NPhi,NTheta,NFreq); 164 165 double infreq = 1420.; // frequence de reference du flux des sources 166 double freq0 = Freq0MHz; // Freq0 du cube de sortie 167 double dfreq = FreqSizeMHz/(double)NFreq; 168 169 ThSDR48RandGen rg; 170 for (sa_size_t j=0; j<ocube.SizeY(); j++) { 171 for (sa_size_t i=0; i<ocube.SizeX(); i++) { 172 double freqexpo = rg.Gaussian(sigPLidxSrc,PLidxSrc); 173 for (sa_size_t k=0; k<ocube.SizeZ(); k++) { 174 double rapfreq = pow((freq0+k*dfreq)/infreq, freqexpo); 175 ocube(i,j,k) = AmpPL1*omap(i,j)*rapfreq; 176 } 177 } 178 } 179 180 // On sauve le cube de sortie 181 { 182 cout << " srccat2cube[5]: Saving output cube to -> " << outname << endl; 82 { // On sauve le cube de sortie 83 cout << " srccat2cube[7]: Saving output cube to -> " << outname << endl; 183 84 POutPersist poc(outname); 184 85 poc << ocube; 185 86 } 186 87 88 if (narg > 4) { 89 string ppfname = arg[4]; 90 cout << " srccat2cube[8]: saving 2D source map to PPF file-> " << ppfname << endl; 91 POutPersist po(ppfname); 92 po << omap; 93 } 187 94 rc = 0; 188 95 } … … 206 113 207 114 115 116 /* -- Fonction -- */ 117 int nvssTocube(DataTable& nvss, TArray<r_4>& omap, TArray<r_4>& ocube) 118 { 119 sa_size_t idxa = nvss.IndexNom("C_RAJ2000"); 120 sa_size_t idxd = nvss.IndexNom("C_DEJ2000"); 121 sa_size_t idxf = nvss.IndexNom("S1_4"); 122 sa_size_t idxmajax = nvss.IndexNom("MajAxis"); 123 sa_size_t idxminax = nvss.IndexNom("MinAxis"); 124 125 cout << " NVSS catalog ... Index Alpha: " << idxa << " Delta: " << idxd << " Flux: " << idxf 126 << " MajAxis: " << idxmajax << " MajAxis: " << idxminax << endl; 127 128 double tet0 = Theta0Degre; 129 double phi0 = Phi0Degre; 130 double tetmax = tet0+ThetaSizeDegre; 131 double phimax = phi0+PhiSizeDegre; 132 133 cout << "srccat2cube/NVSS[2]: projecting sources to map ..." << endl; 134 135 sa_size_t srccnt=0; 136 sa_size_t extendedsrccnt=0; 137 138 double meanflx=0.; 139 double flxmin=9.e99; 140 double flxmax=-9.e99; 141 142 double dtet = ThetaSizeDegre/(double)NTheta; 143 double dphi = PhiSizeDegre/(double)NPhi; 144 double mpixsizarcmin = 0.5*(dtet+dphi)*60.; 145 146 for (sa_size_t n=0; n<nvss.NRows(); n++) { 147 r_8* pline=nvss.GetLineD(n); 148 double alpha=pline[idxa]; // alpha en degre 149 double delta=pline[idxd]; // delta en degre 150 double flx=pline[idxf]*1.e-3; // flux en Jy 151 double srcszarcmin=0.5*(pline[idxmajax]+pline[idxminax])/60.; // taille (extension de la source en arcmin 152 if (srcszarcmin<1.) srcszarcmin=1.; 153 double tet = 90.-delta; 154 double phi = alpha; 155 sa_size_t i = (phi-phi0)/dphi; 156 sa_size_t j = (tet-tet0)/dtet; 157 if ((i<0)||(i>=omap.SizeX())) continue; 158 if ((j<0)||(j>=omap.SizeY())) continue; 159 if (srcszarcmin<(0.5*mpixsizarcmin)) { // Toute l'energie dans un seul pixel 160 omap(i,j) += flx; 161 } 162 else { // on repartit l'energie de la source dans plusieurs pixels 163 extendedsrccnt++; 164 for(int bi=-1;bi<=1;bi++) { 165 for(sa_size_t bj=-1; bj<=1; bj++) { 166 sa_size_t ii = (phi-phi0+bi*srcszarcmin/60.)/dphi; 167 sa_size_t jj = (tet-tet0+bj*srcszarcmin/60.)/dtet; 168 if ((ii<0)||(ii>=omap.SizeX())) continue; 169 if ((jj<0)||(jj>=omap.SizeY())) continue; 170 if ((bi==0)&&(bj==0)) omap(ii,jj) += flx*0.3; 171 else omap(ii,jj) += flx*0.7/8.; 172 } 173 } 174 } 175 srccnt++; meanflx+=flx; 176 if (flx<flxmin) flxmin=flx; 177 if (flx>flxmax) flxmax=flx; 178 } 179 180 cout << "srccat2cube/NVSS[3]: Output rectangular map computed " << endl; 181 meanflx /= (double)srccnt; 182 cout << " SrcCount in map: " << srccnt << " extended=" << extendedsrccnt 183 << " -> meanFlx=" << meanflx << " min=" << flxmin 184 << " max=" << flxmax << " Jy" << endl; 185 186 double mean, sigma; 187 r_4 minjy, maxjy; 188 omap.MinMax(minjy, maxjy); 189 MeanSigma(omap, mean, sigma); 190 cout << " Src Map : Mean=" << mean << " Sigma=" << sigma << " Min=" << minjy << " Max=" << maxjy << " Jansky ; Sizes:" << endl; 191 omap.Show(); 192 193 H21Conversions conv; 194 conv.setRedshift(0.); 195 conv.setOmegaPixDeg2(dphi*dtet); 196 cout << "srccat2cube/NVSS[4] H21Conversions, OmegaPix=" << conv.getOmegaPix() << " srad" 197 << " toKelvin(1 Jy)= " << conv.toKelvin(1.) << endl; 198 omap *= (r_4)conv.toKelvin(1.); 199 MeanSigma(omap, mean, sigma); 200 r_4 minT, maxT; 201 omap.MinMax(minT, maxT); 202 cout << " NVSS/ After conversion : Mean=" << mean << " Sigma=" << sigma << " Min=" << minT 203 << " Max=" << maxT << " Kelvin " << endl; 204 205 double infreq = 1420.; // frequence de reference du flux des sources 206 double freq0 = Freq0MHz; // Freq0 du cube de sortie 207 double dfreq = FreqSizeMHz/(double)NFreq; 208 209 ThSDR48RandGen rg; 210 for (sa_size_t j=0; j<ocube.SizeY(); j++) { 211 for (sa_size_t i=0; i<ocube.SizeX(); i++) { 212 double freqexpo = rg.Gaussian(sigPLidxSrc,PLidxSrc); 213 for (sa_size_t k=0; k<ocube.SizeZ(); k++) { 214 double rapfreq = pow((freq0+k*dfreq)/infreq, freqexpo); 215 ocube(i,j,k) = AmpPL1*omap(i,j)*rapfreq; 216 } 217 } 218 } 219 cout << "srccat2cube/NVSS[5] data cube created from sources " << endl; 220 ocube.MinMax(minT, maxT); 221 MeanSigma(ocube, mean, sigma); 222 cout << "... Mean=" << mean << " Sigma=" << sigma << " Min=" << minT << " Max=" << maxT << " Kelvin" << endl; 223 224 return srccnt; 225 } 226 227 /* -- Fonction -- */ 228 int north20Tocube(DataTable& nor, TArray<r_4>& omap, TArray<r_4>& ocube) 229 { 230 231 sa_size_t idxa = nor.IndexNom("ra"); 232 sa_size_t idxd = nor.IndexNom("dec"); 233 sa_size_t idxf = nor.IndexNom("flux"); 234 sa_size_t idxslo = nor.IndexNom("SpLO"); 235 sa_size_t idxshi = nor.IndexNom("SpHI"); 236 237 cout << " North20cm catalog ... Index Alpha: " << idxa << " Delta: " << idxd << " Flux: " << idxf 238 << " SpLO: " << idxslo << " SpHI: " << idxshi << endl; 239 240 double tet0 = Theta0Degre; 241 double phi0 = Phi0Degre; 242 double tetmax = tet0+ThetaSizeDegre; 243 double phimax = phi0+PhiSizeDegre; 244 245 cout << "srccat2cube/North20[2]: projecting sources to map ..." << endl; 246 247 sa_size_t srccnt=0; 248 sa_size_t lowoksrccnt=0; 249 250 double meanflx=0.; 251 double flxmin=9.e99; 252 double flxmax=-9.e99; 253 254 double dtet = ThetaSizeDegre/(double)NTheta; 255 double dphi = PhiSizeDegre/(double)NPhi; 256 257 double infreq = 1420.; // frequence de reference du flux des sources 258 double freq0 = Freq0MHz; // Freq0 du cube de sortie 259 double dfreq = FreqSizeMHz/(double)NFreq; 260 261 for (sa_size_t n=0; n<nor.NRows(); n++) { 262 r_8* pline=nor.GetLineD(n); 263 double alpha=pline[idxa]; // alpha en degre 264 double delta=pline[idxd]; // delta en degre 265 double flx=pline[idxf]*1.e-3; // flux en Jy 266 double tet = 90.-delta; 267 double phi = alpha*360./24.; 268 sa_size_t i = (phi-phi0)/dphi; 269 sa_size_t j = (tet-tet0)/dtet; 270 if ((i<0)||(i>=omap.SizeX())) continue; 271 if ((j<0)||(j>=omap.SizeY())) continue; 272 omap(i,j) += flx; 273 srccnt++; meanflx+=flx; 274 if (flx<flxmin) flxmin=flx; 275 if (flx>flxmax) flxmax=flx; 276 double slo=pline[idxslo]; 277 if (slo<9.) { // source detected at 80 cm 278 lowoksrccnt++; 279 } 280 else slo=5.; 281 for (sa_size_t k=0; k<ocube.SizeZ(); k++) { 282 double rapfreq = pow((freq0+k*dfreq)/infreq, slo); 283 ocube(i,j,k) += flx*rapfreq; 284 } 285 } 286 287 cout << "srccat2cube/North20[3]: Output rectangular map computed " << endl; 288 meanflx /= (double)srccnt; 289 cout << " SrcCount in map: " << srccnt << " SpLowOK=" << lowoksrccnt 290 << " -> meanFlx=" << meanflx << " min=" << flxmin 291 << " max=" << flxmax << " Jy" << endl; 292 293 double mean, sigma; 294 r_4 minjy, maxjy; 295 omap.MinMax(minjy, maxjy); 296 MeanSigma(omap, mean, sigma); 297 cout << " Src Map : Mean=" << mean << " Sigma=" << sigma << " Min=" << minjy << " Max=" << maxjy << " Jansky" << endl; 298 299 ocube.MinMax(minjy, maxjy); 300 MeanSigma(ocube, mean, sigma); 301 cout << " Cube : Mean=" << mean << " Sigma=" << sigma << " Min=" << minjy << " Max=" << maxjy << " Jansky" << endl; 302 303 H21Conversions conv; 304 conv.setRedshift(0.); 305 conv.setOmegaPixDeg2(dphi*dtet); 306 cout << "srccat2cube/North20[4] H21Conversions, OmegaPix=" << conv.getOmegaPix() << " srad" 307 << " @1400MHz toKelvin(1 Jy)= " << conv.toKelvin(1.) << endl; 308 309 // Jansky to Kelvin conversion 310 for (sa_size_t k=0; k<ocube.SizeZ(); k++) { 311 conv.setFrequency(freq0+k*dfreq); 312 // cout << " DBG* Freq= " << freq0+k*dfreq << " -> toKelvin(1 Jy)= " << conv.toKelvin(1.) << endl; 313 ocube(Range::all(), Range::all(), Range(k)) *= (r_4)conv.toKelvin(1.); 314 } 315 cout << "srccat2cube/North20[5] data cube in Kelvin computed " << endl; 316 317 r_4 minT, maxT; 318 ocube.MinMax(minT, maxT); 319 MeanSigma(ocube, mean, sigma); 320 cout << "... Mean=" << mean << " Sigma=" << sigma << " Min=" << minT << " Max=" << maxT << " Kelvin" << endl; 321 322 return srccnt; 323 } -
trunk/Cosmo/RadioBeam/subtractradsrc.cmd
r3825 r3829 46 46 csh> cat > sumcubes.pic 47 47 openppf syncube.ppf 48 openppf nvsscube.ppf48 openppf srcnor3d.ppf 49 49 # expmeansig syncube val 50 # expmeansig nvsscubeval51 c++exec TArray<r_4> fgndcube = syncube+ nvsscube; KeepObj(fgndcube);50 # expmeansig srcnor3d val 51 c++exec TArray<r_4> fgndcube = syncube+srcnor3d; KeepObj(fgndcube); 52 52 print fgndcube 53 53 # expmeansig fgndcube val … … 89 89 # 4.e / Extract LSS P(k) from Foreground+LSS+noise and beam effect - correcting to a beam of Diam/Lambda = 130 90 90 csh> ./Objs/calcpk2 lsscube_lobe.ppf 0.2 fgndcube_lobe.ppf 1000 subpkcorlobe.ppf 0.35 50. 130. 3. 91 # 4.f / Estimate residual noise from Foreground removal : 92 csh> ./Objs/calcpk2 zerolss.ppf 0. fgndcube_lobe.ppf 1000 subpknolss.ppf 0.35 50. 130. 3. 93 csh> ./Objs/calcpk2 zerolss.ppf 0. fgndcube_lobe.ppf 1000 subpknolssnocor.ppf 0.35 50. 0. 3. 91 94 92 95 ### Step 5 / Check the results using spiapp … … 103 106 104 107 openppf subpknolss.ppf 108 openppf subpknolssnocor.ppf 105 109 106 110 disp lsspk 'logx logy nsta xylimits=0.005,2.,4e-11,8e-6 gold' 107 111 disp lsspklobe 'same nsta orange' 108 112 disp lsspklobewn 'same nsta siennared' 113 settitle ' Pk[LSS] - without normalisation' ' ' 'font=helvetica,bold,16 black' 114 115 # Calcul du volume total en Mpc^3 116 set VOL 3*3*3*360*360*256 117 plot2d lsspklobe x val*$VOL 1 'same nsta orange' 118 plot2d lsspklobe x val*$VOL 1 'same nsta orange' 109 119 110 120 disp fgndpk 'logx logy nsta xylimits=0.005,2.,1e-10,1. navyblue' … … 121 131 disp lsspklobewn 'same nsta siennared' 122 132 disp subpkcorlobe 'same nsta red' 123 disp subpknolss lobe'same nsta green'133 disp subpknolss 'same nsta green' 124 134 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 ) 135 # Calcul du volume total en Mpc^3 136 set VOL 3*3*3*360*360*256 137 plot2d lsspk x val*$VOL 1 'logx logy nsta xylimits=0.01,2.,10.,1e4 cpts marker=box,5 gold' 138 plot2d lsspklobewn x val*$VOL 1 'same nsta cpts marker=box,5 siennared' 139 plot2d subpkcorlobe x val*$VOL 1 'same nsta cpts marker=box,5 red' 140 plot2d subpklobe x val*$VOL 1 'same nsta cpts marker=box,5 blueviolet' 141 plot2d subpknolss x val*$VOL 1 'same nsta cpts marker=box,5 green' 142 143 settitle 'Recovered Pk[LSS] In=LSS+(Haslam+North20cm) (D=50 m)' ' ' 'font=helvetica,bold,18' 144 setaxelabels 'k (Mpc^-1) h=0.7' 'P(k) (mK^2 Mpc^3)' 'font=helvetica,bolditalic,16' 145 set lines ( 'Pk[LSS]' 'Pk[LSS*lobe+noise]' 'Pk[ExtractedLSS]' 'Pk[ExtLSS,NoBeamCor]' 'Pk[residual,NoLSS]' ) 146 set cols ( gold siennared red blueviolet green ) 128 147 textdrawer lines cols 'font=helvetica,bold,16 frame' 148 149 150 plot2d lsspk x val*$VOL 1 'logx logy nsta xylimits=0.01,2.,10.,1e4 cpts marker=box,5 gold' 151 plot2d lsspklobewn x val*$VOL 1 'same nsta cpts marker=box,5 red' 152 plot2d subpknolss x val*$VOL 1 'same nsta cpts marker=box,5 green' 153 plot2d subpknolssnocor x val*$VOL 1 'same nsta cpts marker=box,5 magenta' 154 setaxelabels 'k (Mpc^-1) h=0.7' 'P(k) (mK^2 Mpc^3)' 'font=helvetica,bolditalic,16' 155 settitle 'Recovered Pk[LSS] and residual systematics' ' ' 'font=helvetica,bold,18' 156 set lines ( 'Pk[LSS]' 'Pk[LSS*lobe+noise]' 'Pk[residual,NoLSS]' 'Pk[residual,NoLSS,NoBeamCorrection]' ) 157 set cols ( gold red green magenta ) 158 textdrawer lines cols 'font=helvetica,bold,16 frame' -
trunk/Cosmo/RadioBeam/tjyk.cc
r3787 r3829 25 25 << " MHz , Lambda=" << conv.getLambda() << " m , OmegaPix=" << conv.getOmegaPix() << " srad" << endl; 26 26 cout << " toKelvin(1 Jy)= " << conv.toKelvin(1.) << " toJansky(1 K)=" << conv.toJansky(1.) << endl; 27 cout << " Mean 21cm emission temperature= " << conv.T21cm_mK() << " milliKelvin " << endl; 27 28 cout << " --------------------------------------------------------------- " << endl; 28 29
Note:
See TracChangeset
for help on using the changeset viewer.