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