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


Ignore:
Timestamp:
Mar 21, 2007, 7:18:25 PM (19 years ago)
Author:
cmv
Message:

petis changements cmv 21/03/2007

File:
1 edited

Legend:

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

    r3182 r3193  
    3131     <<" -s snoise : sigma du bruit en Msol"<<endl
    3232     <<" -2 : compute 2D spectrum"<<endl
    33      <<" -F : write cube in FITS format"<<endl
     33     <<" -M schmin,schmax,nsch : min,max mass and nb points for schechter HI"<<endl
     34     <<" -W : write cube in FITS format"<<endl
    3435     <<" -P : write cube in PPF format"<<endl
    3536     <<" -V : compute variance from real space"<<endl
     
    6566
    6667 // *** Schechter mass function definition
    67  double h75 = 0.71 / 0.75;
    68  double nstar = 0.006*pow(h75,3.); 
     68 double h75 = h100 / 0.75;
     69 double nstar = 0.006*pow(h75,3.);
    6970 double mstar = pow(10.,9.8/(h75*h75));  // MSol
    7071 double alpha = -1.37;
     
    7273 double schmin=1e8, schmax=1e12;
    7374 int schnpt = 1000;
    74  double lschmin=log10(schmin), lschmax=log10(schmax), dlsch=(lschmax-lschmin)/schnpt;
    7575
    7676 // *** Niveau de bruit
     
    9191
    9292 char c;
    93  while((c = getopt(narg,arg,"ha0PWV2Gx:y:z:s:Z:")) != -1) {
     93 while((c = getopt(narg,arg,"ha0PWV2Gx:y:z:s:Z:M:")) != -1) {
    9494  switch (c) {
    9595  case 'a' :
     
    119119  case '2' :
    120120    comp2dspec = true;
     121    break;
     122  case 'M' :
     123    sscanf(optarg,"%lf,%lf,%d",&schmin,&schmax,&schnpt);
    121124    break;
    122125  case 'V' :
     
    134137  }
    135138 }
     139
     140 double lschmin=log10(schmin), lschmax=log10(schmax), dlsch=(lschmax-lschmin)/schnpt;
    136141
    137142 string tagobs = "cmvobserv3d.ppf";
     
    157162 univ.Print();
    158163 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;
     164 cout<<"\nzref = "<<zref<<" -> dloscom = "<<loscomref<<" Mpc"<<endl;
     165 univ.Print(zref);
     166
     167 //-----------------------------------------------------------------
     168 cout<<endl<<"\n--- Create Spectrum"<<endl;
    163169
    164170 InitialSpectrum pkini(ns,as);
     
    168174
    169175 GrowthFactor growth(om0,ol0);
     176 // GrowthFactor growth(1.,0.); // D(z) = 1/(1+z)
    170177
    171178 PkSpectrum0 pk0(pkini,tf);
     
    173180 PkSpectrumZ pkz(pk0,growth,zref);
    174181 
     182 //-----------------------------------------------------------------
     183 cout<<endl<<"\n--- Create mass function"<<endl;
     184
    175185 Schechter sch(nstar,mstar,alpha);
     186 sch.Print();
    176187
    177188 //-----------------------------------------------------------------
     
    234245 double mass_by_mpc3 = IntegrateFuncLog(sch,lschmin,lschmax,0.01,dlsch,10.*dlsch,4);
    235246 cout<<"Galaxy mass density= "<<mass_by_mpc3<<" Msol/Mpc^3 between limits"<<endl;
     247 cout<<"Omega_HI at z=0 is "<<mass_by_mpc3/(univ.Rhoc(0.)*GCm3toMsolMpc3_Cst)<<endl
     248     <<"         at z="<<zref<<" is "<<mass_by_mpc3/(univ.Rhoc(zref)*GCm3toMsolMpc3_Cst)<<endl;
    236249
    237250 PrtTim(">>>> End of definition");
     
    463476 }
    464477
    465  cout<<"\n--- Add noise to HI Flux snoise="<<snoise<<endl;
    466  fluct3d.AddNoise2Real(snoise);
    467  nm = fluct3d.MeanSigma2(rm,rs2);
    468  cout<<"HI mass with noise: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
    469      <<rs2<<" -> "<<sqrt(rs2)<<endl;
    470  PrtTim(">>>> End Add noise");
     478 if(snoise>0.) {
     479   cout<<"\n--- Add noise to HI Flux snoise="<<snoise<<endl;
     480   fluct3d.AddNoise2Real(snoise);
     481   nm = fluct3d.MeanSigma2(rm,rs2);
     482   cout<<"HI mass with noise: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
     483       <<rs2<<" -> "<<sqrt(rs2)<<endl;
     484   PrtTim(">>>> End Add noise");
     485 }
    471486
    472487 //-----------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.