Changeset 3350 in Sophya for trunk/Cosmo/SimLSS/cmvdefsurv.cc
- Timestamp:
- Oct 11, 2007, 6:07:47 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvdefsurv.cc
r3347 r3350 8 8 #include <unistd.h> 9 9 10 #include <vector> 11 10 12 #include "constcosmo.h" 11 13 #include "cosmocalc.h" 12 14 #include "geneutils.h" 13 15 #include "schechter.h" 16 #include "pkspectrum.h" 14 17 #include "planckspectra.h" 15 18 … … 27 30 void usage(void); 28 31 void usage(void) { 29 cout<<"cmvdefsurv [ -r] -x adtx,atxlarg[,unit_x] -y adty,atylarg[,unit_y] -z dred,redlarg[,unit_z] redshift"<<endl32 cout<<"cmvdefsurv [options] -x adtx,atxlarg[,unit_x] -y adty,atylarg[,unit_y] -z dred,redlarg[,unit_z] redshift"<<endl 30 33 <<"----------------"<<endl 31 34 <<" -x adtx,atxlarg : resolution et largeur dans le plan transverse selon X"<<endl … … 37 40 <<" \'F\' : en frequence (pour Z) : resolution et largeur MHz"<<endl 38 41 <<" \'M\' : en distance (pour X-Y-Z) : resolution et largeur Mpc"<<endl 42 <<"----------------"<<endl 43 <<" -K k,pk,dk : k(Mpc^-1) dk(Mpc^-1) pk(a z=0 en Mpc^-3) pour estimer la variance cosmique"<<endl 39 44 <<"----------------"<<endl 40 45 <<" -O surf,tobs : surface effective (m^2) et temps d\'observation (s)"<<endl … … 82 87 double redshift = 0.; 83 88 double tobs = 6000., surfeff = 400000.; 89 // variance cosmique (default = standard SDSSII) 90 double kcosm = 0.05, dkcosm = -1., pkcosm = 40000.; 84 91 // taille du lobe d'observation en arcmin pour la frequence 85 92 double lobewidth0 = -1., lobefreq0 = Fr_HyperFin_Par*1.e3; … … 96 103 // --- Decodage arguments 97 104 char c; 98 while((c = getopt(narg,arg,"h2x:y:z:N:S:O:M:F:V:U:L:A: ")) != -1) {105 while((c = getopt(narg,arg,"h2x:y:z:N:S:O:M:F:V:U:L:A:K:")) != -1) { 99 106 switch (c) { 100 107 case 'x' : … … 137 144 case 'A' : 138 145 sscanf(optarg,"%lf",&lflux_agn); 146 break; 147 case 'K' : 148 sscanf(optarg,"%lf,%lf,%lf",&kcosm,&pkcosm,&dkcosm); 139 149 break; 140 150 case 'h' : … … 158 168 univ.Print(0.); 159 169 univ.Print(redshift); 170 GrowthFactor growth(om0,ol0); 171 double grothfac = growth(redshift); 172 cout<<"Facteur de croissance lineaire = "<<grothfac 173 <<" ^2 , ( 1/(1+z)="<<1./(1.+redshift)<<" )"<<endl; 160 174 161 175 double dang = univ.Dang(redshift); … … 291 305 cout<<"Resolution: dk_z = "<<dk_z<<" Mpc^-1 (2Pi/dk_z="<<2.*M_PI/dk_z<<" Mpc)"<<endl; 292 306 cout<<"Nyquist: kz = "<<knyq_z<<" Mpc^-1 (2Pi/knyq_z="<<2.*M_PI/knyq_z<<" Mpc)"<<endl; 307 308 // --- Variance cosmique 309 // cosmique poisson 310 // (sigma/P)^2 = 2*(2Pi)^3 / (4Pi dk Vsurvey) * [(1+n*P)/(n*P)]^2 311 // nombre de mode = 1/2 * Vsurvey/(2Pi)^3 * 4Pi*k^2*dk 312 if(kcosm>0. && pkcosm>0.) { 313 double pk = pkcosm*pow(grothfac,2.); 314 cout<<"\n>>>>\n>>>> variance cosmique pour k="<<kcosm<<" Mpc^-1, pk(z=0)=" 315 <<pkcosm<<", pk(z="<<redshift<<")="<<pk<<"\n>>>>"<<endl; 316 for(int i=0;i<3;i++) { // la correction de variance du au bruit de poisson 317 double v = 1.1; if(i==1) v=1.5; if(i==2) v=2.0; 318 double ngal = 1./(v-1.)/pk; 319 cout<<" pour "<<ngal<<" gal/Mpc^3 on multiplie par "<<v<<" sigma/P"<<endl; 320 } 321 vector<double> dk; if(dkcosm>0.) dk.push_back(dkcosm); 322 dk.push_back(dk_x); dk.push_back(dk_y); dk.push_back(dk_z); 323 for(int i=0;i<(int)dk.size();i++) { // la variance cosmique pure 324 double vcosm = sqrt( 2.*pow(2.*M_PI,3.)/(4.*M_PI*dk[i]*vol) ); 325 double nmode = 0.5*vol/pow(2.*M_PI,3.) * 4.*M_PI*pow(kcosm,2.)*dk[i]; 326 cout<<" pour dk = "<<dk[i]<<" Mpc^-1: sigma/P = "<<vcosm 327 <<" , Nmode = "<<nmode<<endl; 328 } 329 } 293 330 294 331 // --- Masse de HI
Note:
See TracChangeset
for help on using the changeset viewer.