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

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

variation de la taille du lobe avec la frequence cmv 01/08/2007

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