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


Ignore:
Timestamp:
Oct 2, 2007, 3:11:22 PM (18 years ago)
Author:
cmv
Message:

mise en place evolution seulement sur distance au plan Z , cmv 02/10/2007

File:
1 edited

Legend:

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

    r3330 r3331  
    2323     <<" -a : auto init random seed (needed for multiple simul)"<<endl
    2424     <<" -0 : use ComputeFourier0 method (defaut: no, use normal way)"<<endl
    25      <<" -G : compute Pk(z=0) and apply growth factor in real space"<<endl
     25     <<" -G typevol: compute Pk(z=0) and apply growth factor in real space"<<endl
     26     <<"             typevol=1 noise evolved with distance / observateur (def)"<<endl
     27     <<"             typevol=2 noise evolved with distance to middle of Z planes"<<endl
    2628     <<"      (default: no, spectrum Pk(z=z_median) for all cube)"<<endl
    2729     <<" -F : filter spectrum by pixel shape (0=no 1=yes(default)"<<endl
     
    3234     <<" -z nz,dz : size along z axis (redshift axis, npix,Mpc)"<<endl
    3335     <<" -Z zref : redshift for the center of the simulation cube"<<endl
    34      <<" -s snoise,evol : gaussian noise sigma in equivalent Msol"<<endl
    35      <<"                  if evol>0 noise evolved with distance (def no)"<<endl
     36     <<" -s snoise,typevol : gaussian noise sigma in equivalent Msol"<<endl
     37     <<"           typevol=0 no evolution (def)"<<endl
     38     <<"           typevol=1 noise evolved with distance / observateur"<<endl
     39     <<"           typevol=2 noise evolved with distance to middle of Z planes"<<endl
    3640     <<" -2 : compute also 2D spectrum (default: no)"<<endl
    3741     <<" -N scalecube,offsetcube: normalize cube before doing final spectrum (default: automatic)"<<endl
     
    9599 // *** Niveau de bruit
    96100 double snoise= 0.;   // en equivalent MSol
    97  int isnoise_evol = 0;
     101 int noise_evol = 0;
    98102
    99103 // *** AGN
     
    104108 // *** type de generation
    105109 bool computefourier0=false;
    106  bool use_growth_factor = false;
     110 int use_growth_factor = 0;
    107111 unsigned short nthread=0;
    108112 int filter_by_pixel = 1;
     
    124128
    125129 char c;
    126  while((c = getopt(narg,arg,"ha0PWSV2GUF:x:y:z:s:Z:M:A:T:N:Q:R:")) != -1) {
     130 while((c = getopt(narg,arg,"ha0PWSV2UG:F:x:y:z:s:Z:M:A:T:N:Q:R:")) != -1) {
    127131  int nth = 0;
    128132  switch (c) {
     
    134138    break;
    135139  case 'G' :
    136     use_growth_factor = true;
     140    sscanf(optarg,"%d",&use_growth_factor);
    137141    break;
    138142  case 'U' :
     
    152156    break;
    153157  case 's' :
    154     sscanf(optarg,"%lf,%d",&snoise,&isnoise_evol);
     158    sscanf(optarg,"%lf,%d",&snoise,&noise_evol);
    155159    break;
    156160  case 'Z' :
     
    212216 cout<<"Filter by pixel = "<<filter_by_pixel<<endl;
    213217 cout<<"R="<<R<<" Rg="<<Rg<<" Mpc, sigmaR="<<sigmaR<<endl;
     218 cout<<"Use_growth_factor = "<<use_growth_factor<<endl;
    214219 cout<<"nstar= "<<nstar<<"  mstar="<<mstar<<"  alpha="<<alpha<<endl;
    215220 cout<<"schmin="<<schmin<<" ("<<lschmin
     
    217222     <<", schnpt="<<schnpt<<endl;
    218223 if(no_poisson) cout<<"No poisson fluctuation, direct conversion to HI mass"<<endl;
    219  cout<<"snoise="<<snoise<<" equivalent Msol, evolution="<<isnoise_evol<<endl;
     224 cout<<"snoise="<<snoise<<" equivalent Msol, evolution="<<noise_evol<<endl;
    220225 cout<<"scalecube="<<scalecube<<", offsetcube="<<offsetcube<<endl;
    221226 if(do_agn)
     
    385390 //-----------------------------------------------------------------
    386391 cout<<"\n--- Computing a realization in Fourier space"<<endl;
    387  if(use_growth_factor) pkz.SetZ(0.); else pkz.SetZ(zref);
     392 if(use_growth_factor>0) pkz.SetZ(0.); else pkz.SetZ(zref);
    388393 cout<<"Power spectrum set at redshift: "<<pkz.GetZ()<<endl;
    389394 if(computefourier0) fluct3d.ComputeFourier0(pkz);
     
    473478 PrtTim(">>>> End Computing a realization in real space");
    474479
    475  if(use_growth_factor) {
     480 if(use_growth_factor>0) {
    476481   cout<<"\n--- Apply Growth factor"<<endl;
    477482   cout<<"...D(z=0)="<<growth(0.)<<"  D(z="<<zref<<")="<<growth(zref)<<endl;
    478    fluct3d.ApplyGrowthFactor();
     483   fluct3d.ApplyGrowthFactor(use_growth_factor);
    479484   fluct3d.MinMax(rmin,rmax);
    480485   cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl;
     
    607612 double snoisesave = 0.;
    608613 if(snoise>0.) {
    609    cout<<"\n--- Add noise to HI Flux snoise="<<snoise<<", evolution="<<isnoise_evol<<endl;
    610    fluct3d.AddNoise2Real(snoise,(isnoise_evol>0? true:false));
     614   cout<<"\n--- Add noise to HI Flux snoise="<<snoise<<", evolution="<<noise_evol<<endl;
     615   fluct3d.AddNoise2Real(snoise,noise_evol);
    611616   snoisesave = snoise;
    612617     nm = fluct3d.MeanSigma2(rm,rs2);
Note: See TracChangeset for help on using the changeset viewer.