Changeset 3157 in Sophya for trunk/Cosmo/SimLSS/cmvobserv3d.cc
- Timestamp:
- Jan 25, 2007, 6:04:48 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvobserv3d.cc
r3155 r3157 12 12 13 13 #include "constcosmo.h" 14 #include "cosmocalc.h" 14 15 #include "schechter.h" 15 16 #include "geneutils.h" … … 23 24 <<" -a : init auto de l aleatoire"<<endl 24 25 <<" -0 : use methode ComputeFourier0"<<endl 26 <<" -G : compute Pk(z=0) and apply growth factor in real space"<<endl 25 27 <<" -x nx,dx : taille en x (npix,Mpc)"<<endl 26 28 <<" -y ny,dy : taille en y (npix,Mpc)"<<endl … … 46 48 47 49 // *** Cosmography definition (WMAP) 50 unsigned short flat = 0; 48 51 double ob0 = 0.0444356; 49 52 double h100=0.71, om0=0.267804, or0=7.9e-05, ol0=0.73,w0=-1.; 50 53 double zref = 0.5; 54 double perc=0.01,dzinc=-1.,dzmax=5.; unsigned short glorder=4; 51 55 52 56 // *** Spectrum and variance definition … … 75 79 // *** type de generation 76 80 bool computefourier0=false; 81 bool use_growth_factor = false; 77 82 unsigned short nthread=4; 78 83 … … 86 91 87 92 char c; 88 while((c = getopt(narg,arg,"ha0PWV2 x:y:z:s:Z:")) != -1) {93 while((c = getopt(narg,arg,"ha0PWV2Gx:y:z:s:Z:")) != -1) { 89 94 switch (c) { 90 95 case 'a' : … … 93 98 case '0' : 94 99 computefourier0 = true; 100 break; 101 case 'G' : 102 use_growth_factor = true; 95 103 break; 96 104 case 'x' : … … 142 150 143 151 //----------------------------------------------------------------- 144 cout<<endl<<"\n--- Create Spectrum and mass function"<<endl; 152 cout<<endl<<"\n--- Create Cosmology"<<endl; 153 154 CosmoCalc univ(flat,true,zref+1.); 155 univ.SetInteg(perc,dzinc,dzmax,glorder); 156 univ.SetDynParam(h100,om0,or0,ol0,w0); 157 univ.Print(); 158 double loscomref = univ.Dloscom(zref); 159 cout<<"zref = "<<zref<<" -> dloscom = "<<loscomref<<" Mpc"<<endl; 160 161 //----------------------------------------------------------------- 162 cout<<endl<<"\n--- Create Spectrum and mass function"<<endl; 145 163 146 164 InitialSpectrum pkini(ns,as); … … 149 167 //tf.SetNoOscEnv(2); 150 168 151 GrowthFactor d1(om0,ol0);169 GrowthFactor growth(om0,ol0); 152 170 153 171 PkSpectrum0 pk0(pkini,tf); 154 172 155 PkSpectrumZ pkz(pk0, d1,zref);173 PkSpectrumZ pkz(pk0,growth,zref); 156 174 157 175 Schechter sch(nstar,mstar,alpha); … … 223 241 cout<<endl<<"\n--- Initialisation de GeneFluct3D"<<endl; 224 242 225 pkz.SetZ(zref);226 243 TArray< complex<r_8> > pkgen; 227 244 GeneFluct3D fluct3d(pkgen); … … 229 246 fluct3d.SetNThread(nthread); 230 247 fluct3d.SetSize(nx,ny,nz,dx,dy,dz); 248 fluct3d.SetObservator(zref,nz/2.); 249 fluct3d.SetCosmology(univ); 250 fluct3d.SetGrowthFactor(growth); 251 fluct3d.LosComRedshift(0.001); 231 252 TArray<r_8>& rgen = fluct3d.GetRealArray(); 232 fluct3d.Print();253 cout<<endl; fluct3d.Print(); 233 254 234 255 double dkmin = fluct3d.GetKincMin(); … … 246 267 <<" max="<<ktnyqmax<<","<<kznyqmax<<" n="<<nherrt<<","<<nherrz<<endl; 247 268 269 //----------------------------------------------------------------- 248 270 cout<<"\n--- Computing spectra variance up to Kmax at z="<<pkz.GetZ()<<endl; 249 271 // En fait on travaille sur un cube inscrit dans la sphere de rayon kmax: … … 258 280 PrtTim(">>>> End Initialisation de GeneFluct3D"); 259 281 282 //----------------------------------------------------------------- 260 283 cout<<"\n--- Computing a realization in Fourier space"<<endl; 284 if(use_growth_factor) pkz.SetZ(0.); else pkz.SetZ(zref); 285 cout<<"Power spectrum set at redshift: "<<pkz.GetZ()<<endl; 261 286 if(computefourier0) fluct3d.ComputeFourier0(pkz); 262 287 else fluct3d.ComputeFourier(pkz); … … 326 351 } 327 352 353 //----------------------------------------------------------------- 328 354 cout<<"\n--- Computing a realization in real space"<<endl; 329 355 fluct3d.ComputeReal(); 330 356 double rmin,rmax; rgen.MinMax(rmin,rmax); 331 357 cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl; 332 PrtTim(">>>> End Computing a realization in real space"); 358 PrtTim(">>>> End Computing a realization in real space"); 359 360 if(use_growth_factor) { 361 cout<<"\n--- Apply Growth factor"<<endl; 362 cout<<"...D(z=0)="<<growth(0.)<<" D(z="<<zref<<")="<<growth(zref)<<endl; 363 fluct3d.ApplyGrowthFactor(-1); 364 rmin,rmax; rgen.MinMax(rmin,rmax); 365 cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl; 366 PrtTim(">>>> End Applying growth factor"); 367 } 333 368 334 369 if(wfits) {
Note:
See TracChangeset
for help on using the changeset viewer.