source: Sophya/trunk/Cosmo/SimLSS/cmvdefsurv.cc@ 3287

Last change on this file since 3287 was 3287, checked in by cmv, 18 years ago

introduction utnies pour arguments cmv 31/07/2007

File size: 17.6 KB
Line 
1#include "sopnamsp.h"
2#include "machdefs.h"
3#include <iostream>
4#include <stdlib.h>
5#include <stdio.h>
6#include <string.h>
7#include <math.h>
8#include <unistd.h>
9
10#include "constcosmo.h"
11#include "cosmocalc.h"
12#include "geneutils.h"
13#include "schechter.h"
14#include "planckspectra.h"
15
16/* --- Check Peterson at al. astro-ph/0606104 v1
17cmvdefsurv -z 0.0025 -x 1 -U 0.75,0.3,0.7,-1,1 -V 300 -O 400000,6000 -N 75 -M 6.156e9 -F 3 -2 1.5
18 --- */
19
20inline double rad2deg(double trad) {return trad/M_PI*180.;}
21inline double rad2min(double trad) {return trad/M_PI*180.*60.;}
22inline double rad2sec(double trad) {return trad/M_PI*180.*3600.;}
23inline double deg2rad(double tdeg) {return tdeg*M_PI/180.;}
24inline double min2rad(double tmin) {return tmin*M_PI/(180.*60.);}
25inline double sec2rad(double tsec) {return tsec*M_PI/(180.*3600.);}
26
27void usage(void);
28void usage(void) {
29 cout<<"cmvdefsurv [-r] -x adtx,atxlarg[,unit_x] -y adty,atylarg[,unit_y] -z dred,redlarg[,unit_z] redshift"<<endl
30 <<"----------------"<<endl
31 <<" -x adtx,atxlarg : resolution et largeur dans le plan transverse selon X"<<endl
32 <<" -y adty,atylarg : idem selon Y, si <=0 meme que X"<<endl
33 <<" -z dred,redlarg : resolution et largeursur la ligne de visee"<<endl
34 <<"-- Unites pour X-Y:"<<endl
35 <<" \'A\' : en angles (pour X-Y) : resolution=ArcMin, largeur=Degre (defaut)"<<endl
36 <<" \'Z\' : en redshift (pour Z) : resolution et largeur en redshift (defaut)"<<endl
37 <<" \'F\' : en frequence (pour Z) : resolution et largeur MHz"<<endl
38 <<" \'M\' : en distance (pour X-Y-Z) : resolution et largeur Mpc"<<endl
39 <<"----------------"<<endl
40 <<" -L lobewidth : taille du lobe d\'observation (FWHM) en arcmin (def= 1\')"<<endl
41 <<" Si <=0 alors angle solide du lobe = celui du pixel"<<endl
42 <<" -O surf,tobs : surface effective (m^2) et temps d\'observation (s)"<<endl
43 <<" -N Tsys : temperature du system (K)"<<endl
44 <<" -2 : two polarisations measured"<<endl
45 <<" -M : masse de HI de reference (MSol), si <=0 mean schechter in pixel"<<endl
46 <<" -F : HI flux factor to be applied for our redshift"<<endl
47 <<" -V Vrot : largeur en vitesse (km/s) pour l\'elargissement doppler (def=300km/s)"<<endl
48 <<"----------------"<<endl
49 <<" -S Tsynch,indnu : temperature (K) synch a 408 Mhz, index d\'evolution"<<endl
50 <<" (indnu==0 no evolution with freq.)"<<endl
51 <<"----------------"<<endl
52 <<" -U h100,om0,ol0,w0,or0,flat : cosmology"<<endl
53 <<"----------------"<<endl
54 <<" -A <log10(S_agn)> : moyenne du flux AGN en Jy dans le pixel"<<endl
55 <<" redshift : redshift moyen du survey"<<endl
56 <<endl;
57}
58
59int main(int narg,char *arg[])
60{
61 // --- Valeurs fixes
62 // WMAP
63 unsigned short flat = 0;
64 double h100=0.71, om0=0.267804, or0=7.9e-05*0., ol0=0.73,w0=-1.;
65 // Schechter
66 double h75 = h100 / 0.75;
67 double nstar = 0.006*pow(h75,3.); //
68 double mstar = pow(10.,9.8/(h75*h75)); // MSol
69 double alpha = -1.37;
70 cout<<"nstar= "<<nstar<<" mstar="<<mstar<<" alpha="<<alpha<<endl;
71
72 // --- Arguments
73 double adtx=0., atxlarg=0., dx=0.,txlarg=0.;
74 int nx=0; char unit_x = 'A';
75 double adty=-1., atylarg=-1., dy=0.,tylarg=0.;
76 int ny=0; char unit_y = 'A';
77 double dred=0., redlarg=0., dz=0.,tzlarg=0.;
78 int nz=0; char unit_z = 'Z';
79 double redshift = 0.;
80 double tobs = 6000., surfeff = 400000.;
81 double lobewidth = 1.; // taille du lobe d'observation en arcmin
82 double Tsys=75.;
83 // a 408 MHz (Haslam) + evol index a -2.6
84 double Tsynch408=60., nuhaslam=0.408, indnu = -2.6;
85 double mhiref = -1.; // reference Mass en HI (def integ schechter)
86 double hifactor = 1.;
87 double vrot = 300.; // largeur en vitesse (km/s) pour elargissement doppler
88 double facpolar = 0.5; // si on ne mesure les 2 polars -> 1.0
89 double lflux_agn = -3.;
90
91 // --- Decodage arguments
92 char c;
93 while((c = getopt(narg,arg,"h2x:y:z:N:S:O:M:F:V:U:L:A:")) != -1) {
94 switch (c) {
95 case 'x' :
96 sscanf(optarg,"%lf,%lf,%c",&adtx,&atxlarg,&unit_x);
97 break;
98 case 'y' :
99 sscanf(optarg,"%lf,%lf,%c",&adty,&atylarg,&unit_y);
100 break;
101 case 'z' :
102 sscanf(optarg,"%lf,%lf,%c",&dred,&redlarg,&unit_z);
103 break;
104 case 'O' :
105 sscanf(optarg,"%lf,%lf",&surfeff,&tobs);
106 break;
107 case 'L' :
108 sscanf(optarg,"%lf",&lobewidth);
109 break;
110 case 'N' :
111 sscanf(optarg,"%lf",&Tsys);
112 break;
113 case 'S' :
114 sscanf(optarg,"%lf,%lf",&Tsynch408,&indnu);
115 break;
116 case 'M' :
117 sscanf(optarg,"%lf",&mhiref);
118 break;
119 case 'F' :
120 sscanf(optarg,"%lf",&hifactor);
121 break;
122 case 'V' :
123 sscanf(optarg,"%lf",&vrot);
124 break;
125 case 'U' :
126 sscanf(optarg,"%lf,%lf,%lf,%lf,%hu",&h100,&om0,&ol0,&w0,&flat);
127 break;
128 case '2' :
129 facpolar = 1.0;
130 break;
131 case 'A' :
132 sscanf(optarg,"%lf",&lflux_agn);
133 break;
134 case 'h' :
135 default :
136 usage(); return -1;
137 }
138 }
139 if(optind>=narg) {usage(); return-1;}
140 sscanf(arg[optind],"%lf",&redshift);
141 if(redshift<=0.) {cout<<"Redshift "<<redshift<<" should be >0"<<endl; return -2;}
142
143 // --- Initialisation de la Cosmologie
144 cout<<"\n>>>>\n>>>> Cosmologie generale\n>>>>"<<endl;
145 cout<<"h100="<<h100<<" Om0="<<om0<<" Or0="<<or0<<" Or0="
146 <<or0<<" Ol0="<<ol0<<" w0="<<w0<<" flat="<<flat<<endl;
147 cout<<"--- Cosmology for z = "<<redshift<<endl;
148 CosmoCalc univ(flat,true,2.*redshift);
149 double perc=0.01,dzinc=redshift/100.,dzmax=dzinc*10.; unsigned short glorder=4;
150 univ.SetInteg(perc,dzinc,dzmax,glorder);
151 univ.SetDynParam(h100,om0,or0,ol0,w0);
152 univ.Print(0.);
153 univ.Print(redshift);
154
155 double dang = univ.Dang(redshift);
156 double dtrcom = univ.Dtrcom(redshift);
157 double dlum = univ.Dlum(redshift);
158 double dloscom = univ.Dloscom(redshift);
159 double dlosdz = univ.Dhubble()/univ.E(redshift);
160 cout<<"dang="<<dang<<" dlum="<<dlum<<" dtrcom="<<dtrcom
161 <<" dloscom="<<dloscom<<" dlosdz="<<dlosdz<<" Mpc"<<endl;
162
163 cout<<"\n1\" -> "<<dang*sec2rad(1.)<<" Mpc = "<<dtrcom*sec2rad(1.)<<" Mpc com"<<endl;
164 cout<<"1\' -> "<<dang*min2rad(1.)<<" Mpc = "<<dtrcom*min2rad(1.)<<" Mpc com"<<endl;
165 cout<<"1d -> "<<dang*deg2rad(1.)<<" Mpc = "<<dtrcom*deg2rad(1.)<<" Mpc com"<<endl;
166
167 cout<<"dz=1 -> "<<dlosdz<<" Mpc com"<<endl;
168
169 cout<<"1 Mpc los com -> dz = "<<1./dlosdz<<endl;
170 cout<<"1 Mpc transv com -> "<<rad2sec(1./dtrcom)<<"\" = "
171 <<rad2min(1./dtrcom)<<" \' = "<<rad2deg(1./dtrcom)<<" d"<<endl;
172
173 // --- Mise en forme dans les unites appropriees
174 cout<<"\n>>>>\n>>>> Geometrie\n>>>>"<<endl;
175 if(adty<=0. || atylarg<=0.) {adty=adtx; atylarg=atxlarg; unit_y=unit_x;}
176 cout<<"X values: resolution="<<adtx<<" largeur="<<atxlarg<<" unite="<<unit_x<<endl;
177 if(unit_x == 'A') {
178 nx = int(atxlarg*60./adtx+0.5);
179 adtx = min2rad(adtx); atxlarg = deg2rad(atxlarg);
180 dx = adtx*dtrcom; txlarg = dx*nx;
181 } else if(unit_x == 'M') {
182 nx = int(atxlarg/adtx+0.5);
183 dx = adtx; txlarg = atxlarg;
184 adtx = dx/dtrcom; atxlarg = adtx*nx;
185 } else {
186 cout<<"Unknown unit_x = "<<unit_x<<endl;
187 }
188 cout<<"Y values: resolution="<<adty<<" largeur="<<atylarg<<" unite="<<unit_y<<endl;
189 if(unit_y == 'A') {
190 ny = int(atylarg*60./adty+0.5);
191 adty = min2rad(adty); atylarg = deg2rad(atylarg);
192 dy = adty*dtrcom; tylarg = dy*ny;
193 } else if(unit_y == 'M') {
194 ny = int(atylarg/adty+0.5);
195 dy = adty; tylarg = atylarg;
196 adty = dy/dtrcom; atylarg = adty*ny;
197 } else {
198 cout<<"Unknown unit_y = "<<unit_y<<endl;
199 }
200 cout<<"Z values: resolution="<<dred<<" largeur="<<redlarg<<" unite="<<unit_z<<endl;
201 if(unit_z == 'Z') {
202 nz = int(redlarg/dred+0.5);
203 dz = dred*dlosdz; tzlarg = dz*nz;
204 } else if(unit_z == 'M') {
205 nz = int(redlarg/dred+0.5);
206 dz = dred; tzlarg = redlarg;
207 dred = dz/dlosdz; redlarg = dred*nz;
208 } else if(unit_z == 'F') {
209 nz = int(redlarg/dred+0.5);
210 dred = dred/(Fr_HyperFin_Par*1.e3)*pow(1.+redshift,2.); redlarg = dred*nz;
211 dz = dred*dlosdz; tzlarg = dz*nz;
212 } else {
213 cout<<"Unknown unit_z = "<<unit_z<<endl;
214 }
215
216 double Npix = (double)nx*(double)ny*(double)nz;
217 double redlim[2] = {redshift-redlarg/2.,redshift+redlarg/2.};
218 if(redlim[0]<=0.)
219 {cout<<"Lower redshift limit "<<redlim[0]<<" should be >0"<<endl; return -3;}
220 double dtrlim[2] = {univ.Dtrcom(redlim[0]),univ.Dtrcom(redlim[1])};
221 double loslim[2] = {univ.Dloscom(redlim[0]), univ.Dloscom(redlim[1])};
222 double dlumlim[2] = {univ.Dlum(redlim[0]),univ.Dlum(redlim[1])};
223
224 cout<<"---- Line of Sight: Redshift = "<<redshift<<endl
225 <<"dred = "<<dred<<" redlarg = "<<redlarg<<endl
226 <<" dz = "<<dz<<" Mpc redlarg = "<<tzlarg<<" Mpc com, nz = "<<nz<<" pix"<<endl;
227 cout<<"---- Transverse X:"<<endl
228 <<"adtx = "<<rad2min(adtx)<<"\', atxlarg = "<<rad2deg(atxlarg)<<" d"<<endl
229 <<" dx = "<<dx<<" Mpc, txlarg = "<<txlarg<<" Mpc com, nx = "<<nx<<" pix"<<endl;
230 cout<<"---- Transverse Y:"<<endl
231 <<"adty = "<<rad2min(adty)<<"\', atylarg = "<<rad2deg(atylarg)<<" d"<<endl
232 <<" dy = "<<dy<<" Mpc, tylarg = "<<tylarg<<" Mpc com, ny = "<<ny<<" pix"<<endl;
233 cout<<"---- Npix total = "<<Npix<<" -> "<<Npix*sizeof(double)/1.e6<<" Mo"<<endl;
234
235 // --- Cosmolographie Transverse
236 cout<<"\n>>>>\n>>>> Cosmologie & Geometrie transverse\n>>>>"<<endl;
237 cout<<"dang comoving = "<<dtrcom<<" Mpc (com) var_in_z ["
238 <<dtrlim[0]<<","<<dtrlim[1]<<"]"<<endl;
239
240 cout<<"... dx = "<<dx<<" Mpc (com), with angle "<<adtx*dtrcom<<endl
241 <<" with angle var_in_z ["<<adtx*dtrlim[0]<<","<<adtx*dtrlim[1]<<"]"<<endl;
242 cout<<"... largx = "<<txlarg<<" Mpc (com), with angle "<<atxlarg*dtrcom<<endl
243 <<" with angle var_in_z ["<<atxlarg*dtrlim[0]<<","<<atxlarg*dtrlim[1]<<"]"<<endl;
244
245 cout<<"... dy = "<<dy<<" Mpc (com), with angle "<<adty*dtrcom<<endl
246 <<" with angle var_in_z ["<<adty*dtrlim[0]<<","<<adty*dtrlim[1]<<"]"<<endl;
247 cout<<"... largy = "<<tylarg<<" Mpc (com), with angle "<<atylarg*dtrcom<<endl
248 <<" with angle var_in_z ["<<atylarg*dtrlim[0]<<","<<atylarg*dtrlim[1]<<"]"<<endl;
249
250 // --- Cosmolographie Line of sight
251 cout<<"\n>>>>\n>>>> Cosmologie & Geometrie ligne de visee\n>>>>"<<endl;
252 cout<<"los comoving distance = "<<dloscom<<" Mpc (com) in ["
253 <<loslim[0]<<","<<loslim[1]<<"]"<<endl
254 <<" diff = "
255 <<loslim[1]-loslim[0]<<" Mpc"<<endl;
256
257 cout<<"...dz = "<<dz<<" Mpc (com), with redshift approx "<<dred*dlosdz<<endl;
258 cout<<"...tzlarg = "<<tzlarg<<" Mpc (com), with redshift approx "<<redlarg*dlosdz<<endl;
259
260 // --- Solid Angle & Volume
261 cout<<"\n>>>>\n>>>> Angles solides et Volumes\n>>>>"<<endl;
262 cout<<"--- Solid angle"<<endl;
263 double angsol = AngSol(adtx/2.,adty/2.,M_PI/2.);
264 cout<<"Elementary solid angle = "<<angsol<<" sr = "<<angsol/(4.*M_PI)<<" *4Pi sr"<<endl;
265 double angsoltot = AngSol(atxlarg/2.,atylarg/2.,M_PI/2.);
266 cout<<"Total solid angle = "<<angsoltot<<" sr = "<<angsoltot/(4.*M_PI)<<" *4Pi sr"<<endl;
267
268 cout<<"\n--- Volume"<<endl;
269 double dvol = dx*dy*dz;
270 cout<<"Pixel volume comoving = "<<dvol<<" Mpc^3"<<endl;
271 double vol = univ.Vol4Pi(redlim[0],redlim[1])/(4.*M_PI)*angsoltot;
272 cout<<"Volume comoving = "<<vol<<" Mpc^3 = "<<vol/1.e9<<" Gpc^3"<<endl
273 <<"Pixel volume comoving = vol/Npix = "<<vol/Npix<<" Mpc^3"<<endl;
274
275 // --- Fourier space: k = omega = 2*Pi*Nu
276 cout<<"\n>>>>\n>>>> Geometrie dans l'espace de Fourier\n>>>>"<<endl;
277 cout<<"Array size: nx = "<<nx<<", ny = "<<ny<<", nz = "<<nz<<endl;
278 double dk_x = 2.*M_PI/(nx*dx), knyq_x = M_PI/dx;
279 double dk_y = 2.*M_PI/(nx*dy), knyq_y = M_PI/dy;
280 double dk_z = 2.*M_PI/(nz*dz), knyq_z = M_PI/dz;
281 cout<<"Resolution: dk_x = "<<dk_x<<" Mpc^-1 (2Pi/dk_x="<<2.*M_PI/dk_x<<" Mpc)"<<endl
282 <<" dk_y = "<<dk_y<<" Mpc^-1 (2Pi/dk_y="<<2.*M_PI/dk_y<<" Mpc)"<<endl;
283 cout<<"Nyquist: kx = "<<knyq_x<<" Mpc^-1 (2Pi/knyq_x="<<2.*M_PI/knyq_x<<" Mpc)"<<endl
284 <<" ky = "<<knyq_y<<" Mpc^-1 (2Pi/knyq_y="<<2.*M_PI/knyq_y<<" Mpc)"<<endl;
285 cout<<"Resolution: dk_z = "<<dk_z<<" Mpc^-1 (2Pi/dk_z="<<2.*M_PI/dk_z<<" Mpc)"<<endl;
286 cout<<"Nyquist: kz = "<<knyq_z<<" Mpc^-1 (2Pi/knyq_z="<<2.*M_PI/knyq_z<<" Mpc)"<<endl;
287
288 // --- Masse de HI
289 cout<<"\n>>>>\n>>>> Mass HI\n>>>>"<<endl;
290 Schechter sch(nstar,mstar,alpha);
291 sch.SetOutValue(1);
292 cout<<"nstar= "<<nstar<<" mstar="<<mstar<<" alpha="<<alpha<<endl;
293 cout<<"mstar*sch(mstar) = "<<sch(mstar)<<" Msol/Mpc^3/Msol"<<endl;
294 int npt = 10000;
295 double lnx1=log10(1e-6), lnx2=log10(1e+14), dlnx=(lnx2-lnx1)/npt;
296 double masshimpc3 = IntegrateFuncLog(sch,lnx1,lnx2,0.001,dlnx,10.*dlnx,6);
297 cout<<"Mass density: "<<masshimpc3<<" Msol/Mpc^3"<<endl;
298
299 double masshipix = masshimpc3*dvol;
300 double masshitot = masshimpc3*vol;
301 cout<<"Pixel mass = "<<masshipix<<" Msol"<<endl
302 <<"Total mass in survey = "<<masshitot<<" Msol"<<endl;
303 if(mhiref<=0.) mhiref = masshipix;
304
305 // --- Survey values
306 cout<<"\n>>>>\n>>>> Observations\n>>>>"<<endl;
307 double unplusz = 1.+redshift;
308 double nuhiz = Fr_HyperFin_Par / unplusz; // GHz
309 // dnu = NuHi/(1.+z0-dz/2) - NuHi/(1.+z0+dz/2)
310 // = NuHi*dz/(1.+z0)^2 * 1/[1-(dz/(2*(1+z0)))^2]
311 // ~= NuHi*dz/(1.+z0)^2
312 double dnuhiz = Fr_HyperFin_Par *dred/(unplusz*unplusz)
313 / (1.- pow(dred/.2/unplusz,2.));
314 cout<<" surf_eff="<<surfeff<<" m^2, tobs="<<tobs<<" s"<<endl
315 <<" nu="<<nuhiz<<" GHz, dnu="<<dnuhiz*1.e3<<" Mhz"<<endl;
316 cout<<"dang lumi = "<<dlum<<" in ["<<dlumlim[0]<<","<<dlumlim[1]<<"] Mpc"<<endl;
317
318 double slobe = lobewidth/2.35482; // sigma du lobe en arcmin
319 double lobecyl = sqrt(8.)*slobe; // diametre du lobe cylindrique equiv en arcmin
320 double lobearea = M_PI*lobecyl*lobecyl/4.; // en arcmin^2 (hypothese lobe gaussien)
321 double nlobes = rad2min(adtx)*rad2min(adty)/lobearea;
322 if(lobewidth<=0.) nlobes = 1.;
323 cout<<"\nBeam FWHM = "<<lobewidth<<"\' -> sigma = "<<slobe<<"\' -> "
324 <<" Dcyl = "<<lobecyl<<"\' -> area = "<<lobearea<<" arcmin^2"<<endl;
325 cout<<"Number of beams in one transversal pixel = "<<nlobes<<endl;
326
327 // --- Power emitted by HI
328 cout<<"\n--- Power from HI for M = "<<mhiref<<" Msol at "<<nuhiz<<" GHz"<<endl;
329 cout<<"flux factor = "<<hifactor<<" at redshift = "<<redshift<<endl;
330
331 double fhi = hifactor*Msol2FluxHI(mhiref,dlum);
332 cout<<"FluxHI("<<dlum<<" Mpc) all polar:"<<endl
333 <<" Flux= "<<fhi<<" W/m^2 = "<<fhi/Jansky2Watt_cst<<" Jy.Hz"<<endl
334 <<" in ["<<hifactor*Msol2FluxHI(mhiref,dlumlim[0])
335 <<","<<hifactor*Msol2FluxHI(mhiref,dlumlim[1])<<"] W/m^2"<<endl;
336 double sfhi = fhi / (dnuhiz*1e9) / Jansky2Watt_cst;
337 cout<<"If spread over pixel depth ("<<dnuhiz<<" GHz), flux density = "<<sfhi<<" Jy"<<endl;
338
339 // --- Signal analysis
340 cout<<"\n--- Signal analysis"<<endl;
341 cout<<"Facteur polar = "<<facpolar<<endl;
342
343 PlanckSpectra planck(T_CMB_Par);
344 planck.SetApprox(1); // Rayleigh spectra
345 planck.SetVar(0); // frequency
346 planck.SetUnitOut(0); // output en W/....
347 planck.SetTypSpectra(0); // radiance W/m^2/Sr/Hz
348
349 // Signal
350 double psig = facpolar * fhi * surfeff;
351 double tsig = psig / k_Boltzman_Cst / (dnuhiz*1e9);
352 double ssig = psig / surfeff / (dnuhiz*1e9) / Jansky2Watt_cst;
353 cout<<"Signal("<<mhiref<<" Msol): P="<<psig<<" W"<<endl;
354 cout<<" flux density = "<<ssig<<" Jy (for Dnu="<<dnuhiz<<" GHz)"<<endl;
355 cout<<" Antenna temperature: tsig="<<tsig<<" K"<<endl;
356
357 // Elargissement doppler de la raie a 21cm: dNu = vrot/C * Nu(21cm) / (1+z)
358 double doplarge = vrot / SpeedOfLight_Cst * nuhiz;
359 double dzvrot = vrot / SpeedOfLight_Cst * unplusz;
360 cout<<" Doppler width="<<doplarge*1.e3<<" MHz for rotation width of "<<vrot<<" km/s"<<endl
361 <<" dx= "<<dzvrot<<" a z="<<redshift<<endl;
362 if(doplarge>dnuhiz)
363 cout<<"Warning: doppler width "<<doplarge<<" GHz > "<<dnuhiz<<" GHz redshift bin width"<<endl;
364
365 // Synchrotron (T en -2.7 -> Flux en -0.7 dans l'approximation Rayleigh)
366 double tsynch = Tsynch408;
367 if(fabs(indnu)>1.e-50) tsynch *= pow(nuhiz/nuhaslam,indnu);
368 planck.SetTemperature(tsynch);
369 double psynch = facpolar * planck(nuhiz*1.e+9) * surfeff * angsol * (dnuhiz*1e9);
370 double ssynch = psynch / surfeff / (dnuhiz*1e9) / Jansky2Watt_cst;
371 cout<<"Synchrotron: T="<<Tsynch408<<" K ("<<nuhaslam<<" GHz), "
372 <<tsynch<<" K ("<<nuhiz<<" GHz)"<<endl
373 <<" P="<<psynch<<" W for pixel"<<endl;
374 cout<<" flux density = "<<ssynch<<" Jy for pixel solid angle"<<endl;
375
376 // CMB
377 double tcmb = T_CMB_Par;
378 planck.SetTemperature(tcmb);
379 double pcmb = facpolar * planck(nuhiz*1.e+9) * surfeff * angsol * (dnuhiz*1e9);
380 double scmb = pcmb / surfeff / (dnuhiz*1.e+9) / Jansky2Watt_cst;
381 cout<<"CMB: T="<<tcmb<<" K -> P="<<pcmb<<" W for pixel"<<endl;
382 cout<<" flux density = "<<scmb<<" Jy for pixel solid angle"<<endl;
383
384 // AGN
385 double flux_agn = pow(10.,lflux_agn);
386 double mass_agn = FluxHI2Msol(flux_agn*Jansky2Watt_cst,dlum);
387 cout<<"AGN: log10(S_agn)="<<lflux_agn<<" -> S_agn="
388 <<flux_agn<<" Jy -> "<<mass_agn<<" equiv. Msol/Hz"<<endl;
389 double flux_agn_pix = flux_agn*(dnuhiz*1e9);
390 double mass_agn_pix = FluxHI2Msol(flux_agn_pix*Jansky2Watt_cst,dlum);
391 double lmass_agn_pix = log10(mass_agn_pix);
392 cout<<"...pixel: f="<<flux_agn_pix<<" 10^-26 W/m^2"
393 <<" -> "<<mass_agn_pix<<" Msol -> log10 = "<<lmass_agn_pix<<endl;
394
395 // --- Noise analysis
396 cout<<"\n--- Noise analysis"<<endl;
397 double psys = k_Boltzman_Cst * Tsys * (dnuhiz*1.e+9);
398 cout<<"Noise: T="<<Tsys<<" K, P="<<psys<<" W (for Dnu="<<dnuhiz<<" GHz)"<<endl;
399
400 double slim = 2. * k_Boltzman_Cst * Tsys / surfeff
401 / sqrt(2.*(dnuhiz*1.e+9)*tobs) /Jansky2Watt_cst;
402 cout<<"Observation flux density limit: "<<slim<<" Jy (in 1 lobe)"<<endl;
403
404 double slim_nl = slim * sqrt(nlobes);
405 cout<<"Observation flux density limit: "<<slim_nl<<" Jy (in "<<nlobes<<" lobes)"<<endl;
406
407 double SsN = ssig/slim;
408 cout<<"\nSignal to noise ratio = "<<SsN<<" (1 lobe)"<<endl;
409 double SsN_nl = ssig/slim_nl;
410 cout<<"\nSignal to noise ratio = "<<SsN_nl<<" ("<<nlobes<<" lobes)"<<endl;
411
412 double smass = mhiref/ssig*slim;
413 cout<<"\nSigma noise equivalent = "<<smass<<" Msol (1 lobe)"<<endl;
414 double smass_nl = mhiref/ssig*slim_nl;
415 cout<<"\nSigma noise equivalent = "<<smass_nl<<" Msol ("<<nlobes<<" lobes)"<<endl;
416
417 return 0;
418}
Note: See TracBrowser for help on using the repository browser.