Changeset 3157 in Sophya for trunk/Cosmo/SimLSS/cmvobserv3d.cc


Ignore:
Timestamp:
Jan 25, 2007, 6:04:48 PM (19 years ago)
Author:
cmv
Message:

intro du facteur de croissance dans la simul cmv 25/01/2007

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/SimLSS/cmvobserv3d.cc

    r3155 r3157  
    1212
    1313#include "constcosmo.h"
     14#include "cosmocalc.h"
    1415#include "schechter.h"
    1516#include "geneutils.h"
     
    2324     <<" -a : init auto de l aleatoire"<<endl
    2425     <<" -0 : use methode ComputeFourier0"<<endl
     26     <<" -G : compute Pk(z=0) and apply growth factor in real space"<<endl
    2527     <<" -x nx,dx : taille en x (npix,Mpc)"<<endl
    2628     <<" -y ny,dy : taille en y (npix,Mpc)"<<endl
     
    4648
    4749 // *** Cosmography definition   (WMAP)
     50 unsigned short flat = 0;
    4851 double ob0 = 0.0444356;
    4952 double h100=0.71, om0=0.267804, or0=7.9e-05, ol0=0.73,w0=-1.;
    5053 double zref = 0.5;
     54 double perc=0.01,dzinc=-1.,dzmax=5.; unsigned short glorder=4;
    5155
    5256 // *** Spectrum and variance definition
     
    7579 // *** type de generation
    7680 bool computefourier0=false;
     81 bool use_growth_factor = false;
    7782 unsigned short nthread=4;
    7883
     
    8691
    8792 char c;
    88  while((c = getopt(narg,arg,"ha0PWV2x:y:z:s:Z:")) != -1) {
     93 while((c = getopt(narg,arg,"ha0PWV2Gx:y:z:s:Z:")) != -1) {
    8994  switch (c) {
    9095  case 'a' :
     
    9398  case '0' :
    9499    computefourier0 = true;
     100    break;
     101  case 'G' :
     102    use_growth_factor = true;
    95103    break;
    96104  case 'x' :
     
    142150
    143151 //-----------------------------------------------------------------
    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;
    145163
    146164 InitialSpectrum pkini(ns,as);
     
    149167 //tf.SetNoOscEnv(2);
    150168
    151  GrowthFactor d1(om0,ol0);
     169 GrowthFactor growth(om0,ol0);
    152170
    153171 PkSpectrum0 pk0(pkini,tf);
    154172
    155  PkSpectrumZ pkz(pk0,d1,zref);
     173 PkSpectrumZ pkz(pk0,growth,zref);
    156174 
    157175 Schechter sch(nstar,mstar,alpha);
     
    223241 cout<<endl<<"\n--- Initialisation de GeneFluct3D"<<endl;
    224242
    225  pkz.SetZ(zref);
    226243 TArray< complex<r_8> > pkgen;
    227244 GeneFluct3D fluct3d(pkgen);
     
    229246 fluct3d.SetNThread(nthread);
    230247 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);
    231252 TArray<r_8>& rgen = fluct3d.GetRealArray();
    232  fluct3d.Print();
     253 cout<<endl; fluct3d.Print();
    233254
    234255 double dkmin = fluct3d.GetKincMin();
     
    246267     <<" max="<<ktnyqmax<<","<<kznyqmax<<" n="<<nherrt<<","<<nherrz<<endl;
    247268
     269 //-----------------------------------------------------------------
    248270 cout<<"\n--- Computing spectra variance up to Kmax at z="<<pkz.GetZ()<<endl;
    249271 // En fait on travaille sur un cube inscrit dans la sphere de rayon kmax:
     
    258280 PrtTim(">>>> End Initialisation de GeneFluct3D");
    259281
     282 //-----------------------------------------------------------------
    260283 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;
    261286 if(computefourier0) fluct3d.ComputeFourier0(pkz);
    262287   else              fluct3d.ComputeFourier(pkz);
     
    326351 }
    327352
     353 //-----------------------------------------------------------------
    328354 cout<<"\n--- Computing a realization in real space"<<endl;
    329355 fluct3d.ComputeReal();
    330356 double rmin,rmax; rgen.MinMax(rmin,rmax);
    331357 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 }
    333368
    334369 if(wfits) {
Note: See TracChangeset for help on using the changeset viewer.