Changeset 3351 in Sophya


Ignore:
Timestamp:
Oct 12, 2007, 7:45:12 PM (18 years ago)
Author:
cmv
Message:

suite des modifs importantes , cmv 12/10/2007

Location:
trunk/Cosmo/SimLSS
Files:
3 edited

Legend:

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

    r3350 r3351  
    4141      <<"   \'M\' : en distance (pour X-Y-Z) : resolution et largeur Mpc"<<endl
    4242      <<"----------------"<<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
     43      <<" -K k,dk,pk : k(Mpc^-1) dk(Mpc^-1) pk(a z=0 en Mpc^-3) pour estimer la variance cosmique"<<endl
    4444      <<"----------------"<<endl
    4545      <<" -O surf,tobs : surface effective (m^2) et temps d\'observation (s)"<<endl
     
    146146    break;
    147147  case 'K' :
    148     sscanf(optarg,"%lf,%lf,%lf",&kcosm,&pkcosm,&dkcosm);
     148    sscanf(optarg,"%lf,%lf,%lf",&kcosm,&dkcosm,&pkcosm);
    149149    break;
    150150  case 'h' :
     
    252252     <<"  dy = "<<dy<<" Mpc,  tylarg = "<<tylarg<<" Mpc com, ny = "<<ny<<" pix"<<endl;
    253253 cout<<"---- Npix total = "<<Npix<<" -> "<<Npix*sizeof(double)/1.e6<<" Mo"<<endl;
     254 cout<<"     Volume pixel = "<<dx*dy*dz<<" Mpc^3"<<endl;
     255 cout<<"     Volume total = "<<Npix*dx*dy*dz<<" Mpc^3"<<endl;
    254256
    255257 // --- Cosmolographie Transverse
     
    308310 // --- Variance cosmique
    309311 //                      cosmique                    poisson
    310  // (sigma/P)^2 = 2*(2Pi)^3 / (4Pi dk Vsurvey) * [(1+n*P)/(n*P)]^2
     312 // (sigma/P)^2 = 2*(2Pi)^3 / (4Pi k^2 dk Vsurvey) * [(1+n*P)/(n*P)]^2
    311313 // nombre de mode = 1/2 * Vsurvey/(2Pi)^3 * 4Pi*k^2*dk
    312314 if(kcosm>0. && pkcosm>0.) {
     
    322324   dk.push_back(dk_x); dk.push_back(dk_y); dk.push_back(dk_z);
    323325   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) );
     326     double vcosm = sqrt( 2.*pow(2.*M_PI,3.)/(4.*M_PI*pow(kcosm,2.)*dk[i]*vol) );
    325327     double nmode = 0.5*vol/pow(2.*M_PI,3.) * 4.*M_PI*pow(kcosm,2.)*dk[i];
    326328     cout<<"  pour dk = "<<dk[i]<<" Mpc^-1:  sigma/P = "<<vcosm
  • trunk/Cosmo/SimLSS/cmvobserv3d.cc

    r3349 r3351  
    3939     <<"           typevol=2 noise evolved with distance to middle of Z planes"<<endl
    4040     <<" -2 : compute also 2D spectrum (default: no)"<<endl
    41      <<" -N scalecube,offsetcube: normalize cube before doing final spectrum (default: automatic)"<<endl
     41     <<" -N scalemass: facteur d\'unite pour la masse (default: 1)"<<endl
     42     <<"               ex: si on veut unites 10^8 Msol -> scalemass=1.e-8"<<endl
     43     <<"               si <0 alors facteur=-scalemass*Mpix"<<endl
    4244     <<" -M schmin,schmax,nsch : min,max mass and nb points for schechter HI"<<endl
    4345     <<"                         If nsch<0 alors no,bre de points par decade"<<endl
     
    9799 bool no_poisson = false;
    98100
     101 double scalemass = 1.;
     102
    99103 // *** Niveau de bruit
    100104 double snoise= 0.;   // en equivalent MSol
     
    118122 bool wslice = false;
    119123 bool compvarreal = false;
    120  double scalecube = -1., offsetcube = 0.;
    121124
    122125 // --- Decodage arguments
     
    165168    break;
    166169  case 'N' :
    167     sscanf(optarg,"%lf,%lf",&scalecube,&offsetcube);
     170    sscanf(optarg,"%lf",&scalemass);
     171    if(scalemass==0.) scalemass = 1.;
    168172    break;
    169173  case 'M' :
     
    223227 if(no_poisson) cout<<"No poisson fluctuation, direct conversion to HI mass"<<endl;
    224228 cout<<"snoise="<<snoise<<" equivalent Msol, evolution="<<noise_evol<<endl;
    225  cout<<"scalecube="<<scalecube<<", offsetcube="<<offsetcube<<endl;
     229 cout<<"scalemass="<<scalemass<<endl;
    226230 ////if(do_agn)
    227231 ////  cout<<"AGN: <log10(Jy)>="<<lfjy_agn<<" , sigma="<<lsigma_agn
     
    364368 cout<<endl; fluct3d.Print();
    365369 cout<<"\nMean number of galaxies per pixel = "<<ngal_by_mpc3*fluct3d.GetDVol()<<endl;
    366  cout<<"Mean mass per pixel = "<<mass_by_mpc3*fluct3d.GetDVol()<<endl;
     370 double mass_by_pixel = mass_by_mpc3 * fluct3d.GetDVol();
     371 cout<<"Mean mass per pixel = "<<mass_by_pixel<<endl;
    367372
    368373 double dkmin = fluct3d.GetKincMin();
     
    536541 if(no_poisson) {
    537542   cout<<"\n--- Converting !!!DIRECTLY!!! mass into HI mass: mass per pixel ="
    538        <<mass_by_mpc3*fluct3d.GetDVol()<<endl;
    539    rm = fluct3d.TurnMass2MeanNumber(mass_by_mpc3);
     543       <<mass_by_pixel<<endl;
     544   rm = fluct3d.TurnMass2MeanNumber(mass_by_mpc3); // ici on doit donner Msol/Mpc^3
    540545 } else {
    541546   cout<<"\n--- Converting mass into galaxy number: gal per pixel ="
     
    581586 }
    582587
     588 //-----------------------------------------------------------------
    583589 if(wfits) {
    584590   fluct3d.WriteFits("!cmvobserv3d_r.fits");
     
    613619 }
    614620
    615 
    616  //-----------------------------------------------------------------
    617  if(scalecube!=0.) {  // Si scalecube==0 pas de normalisation
    618    cout<<"\n--- Scale cube rs2ref="<<rs2ref<<endl;
    619    if(scalecube<0. && rs2ref>0.) {  // si negatif on scale automatiquement
     621 //-----------------------------------------------------------------
     622 if(scalemass!=0. && scalemass!=1.) {  // Si scalemass==0 pas de normalisation
     623   if(scalemass<0.) scalemass = 1. / (-scalemass * mass_by_pixel);
     624   cout<<"\n--- Scale cube scale="<<scalemass<<endl;
     625   fluct3d.ScaleOffset(scalemass);
     626   snoisesave *= scalemass;
    620627     nm = fluct3d.MeanSigma2(rm,rs2);
    621      if(rs2>0.) {scalecube=sqrt(rs2ref)/sqrt(rs2); offsetcube=-rm;}
    622    }
    623    cout<<"...scale="<<scalecube<<" offset="<<offsetcube<<endl;
    624    if(scalecube>0.) {
    625      fluct3d.ScaleOffset(scalecube,offsetcube);
    626      snoisesave *= scalecube;
    627    }
    628628   PrtTim(">>>> End Scale cube");
    629629 }
    630  
     630
     631 //-----------------------------------------------------------------
    631632 if(wfits) {
    632633   fluct3d.WriteFits("!cmvobserv3d_rf.fits");
  • trunk/Cosmo/SimLSS/genefluct3d.cc

    r3349 r3351  
    961961 }
    962962 herr.ToVariance();
     963 for(int i=0;i<herr.NBins();i++) herr(i) += sigma2;
    963964
    964965 // renormalize to directly compare to original spectrum
     
    10071008 }
    10081009 herr.ToVariance();
     1010 for(int i=0;i<herr.NBinX();i++)
     1011    for(int j=0;j<herr.NBinY();j++) herr(i,j) += sigma2;
    10091012
    10101013 // renormalize to directly compare to original spectrum
Note: See TracChangeset for help on using the changeset viewer.