Changeset 3351 in Sophya for trunk/Cosmo/SimLSS
- Timestamp:
- Oct 12, 2007, 7:45:12 PM (18 years ago)
- Location:
- trunk/Cosmo/SimLSS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvdefsurv.cc
r3350 r3351 41 41 <<" \'M\' : en distance (pour X-Y-Z) : resolution et largeur Mpc"<<endl 42 42 <<"----------------"<<endl 43 <<" -K k, pk,dk : k(Mpc^-1) dk(Mpc^-1) pk(a z=0 en Mpc^-3) pour estimer la variance cosmique"<<endl43 <<" -K k,dk,pk : k(Mpc^-1) dk(Mpc^-1) pk(a z=0 en Mpc^-3) pour estimer la variance cosmique"<<endl 44 44 <<"----------------"<<endl 45 45 <<" -O surf,tobs : surface effective (m^2) et temps d\'observation (s)"<<endl … … 146 146 break; 147 147 case 'K' : 148 sscanf(optarg,"%lf,%lf,%lf",&kcosm,& pkcosm,&dkcosm);148 sscanf(optarg,"%lf,%lf,%lf",&kcosm,&dkcosm,&pkcosm); 149 149 break; 150 150 case 'h' : … … 252 252 <<" dy = "<<dy<<" Mpc, tylarg = "<<tylarg<<" Mpc com, ny = "<<ny<<" pix"<<endl; 253 253 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; 254 256 255 257 // --- Cosmolographie Transverse … … 308 310 // --- Variance cosmique 309 311 // cosmique poisson 310 // (sigma/P)^2 = 2*(2Pi)^3 / (4Pi dk Vsurvey) * [(1+n*P)/(n*P)]^2312 // (sigma/P)^2 = 2*(2Pi)^3 / (4Pi k^2 dk Vsurvey) * [(1+n*P)/(n*P)]^2 311 313 // nombre de mode = 1/2 * Vsurvey/(2Pi)^3 * 4Pi*k^2*dk 312 314 if(kcosm>0. && pkcosm>0.) { … … 322 324 dk.push_back(dk_x); dk.push_back(dk_y); dk.push_back(dk_z); 323 325 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) ); 325 327 double nmode = 0.5*vol/pow(2.*M_PI,3.) * 4.*M_PI*pow(kcosm,2.)*dk[i]; 326 328 cout<<" pour dk = "<<dk[i]<<" Mpc^-1: sigma/P = "<<vcosm -
trunk/Cosmo/SimLSS/cmvobserv3d.cc
r3349 r3351 39 39 <<" typevol=2 noise evolved with distance to middle of Z planes"<<endl 40 40 <<" -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 42 44 <<" -M schmin,schmax,nsch : min,max mass and nb points for schechter HI"<<endl 43 45 <<" If nsch<0 alors no,bre de points par decade"<<endl … … 97 99 bool no_poisson = false; 98 100 101 double scalemass = 1.; 102 99 103 // *** Niveau de bruit 100 104 double snoise= 0.; // en equivalent MSol … … 118 122 bool wslice = false; 119 123 bool compvarreal = false; 120 double scalecube = -1., offsetcube = 0.;121 124 122 125 // --- Decodage arguments … … 165 168 break; 166 169 case 'N' : 167 sscanf(optarg,"%lf,%lf",&scalecube,&offsetcube); 170 sscanf(optarg,"%lf",&scalemass); 171 if(scalemass==0.) scalemass = 1.; 168 172 break; 169 173 case 'M' : … … 223 227 if(no_poisson) cout<<"No poisson fluctuation, direct conversion to HI mass"<<endl; 224 228 cout<<"snoise="<<snoise<<" equivalent Msol, evolution="<<noise_evol<<endl; 225 cout<<"scale cube="<<scalecube<<", offsetcube="<<offsetcube<<endl;229 cout<<"scalemass="<<scalemass<<endl; 226 230 ////if(do_agn) 227 231 //// cout<<"AGN: <log10(Jy)>="<<lfjy_agn<<" , sigma="<<lsigma_agn … … 364 368 cout<<endl; fluct3d.Print(); 365 369 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; 367 372 368 373 double dkmin = fluct3d.GetKincMin(); … … 536 541 if(no_poisson) { 537 542 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 540 545 } else { 541 546 cout<<"\n--- Converting mass into galaxy number: gal per pixel =" … … 581 586 } 582 587 588 //----------------------------------------------------------------- 583 589 if(wfits) { 584 590 fluct3d.WriteFits("!cmvobserv3d_r.fits"); … … 613 619 } 614 620 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; 620 627 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 }628 628 PrtTim(">>>> End Scale cube"); 629 629 } 630 630 631 //----------------------------------------------------------------- 631 632 if(wfits) { 632 633 fluct3d.WriteFits("!cmvobserv3d_rf.fits"); -
trunk/Cosmo/SimLSS/genefluct3d.cc
r3349 r3351 961 961 } 962 962 herr.ToVariance(); 963 for(int i=0;i<herr.NBins();i++) herr(i) += sigma2; 963 964 964 965 // renormalize to directly compare to original spectrum … … 1007 1008 } 1008 1009 herr.ToVariance(); 1010 for(int i=0;i<herr.NBinX();i++) 1011 for(int j=0;j<herr.NBinY();j++) herr(i,j) += sigma2; 1009 1012 1010 1013 // renormalize to directly compare to original spectrum
Note:
See TracChangeset
for help on using the changeset viewer.