Changeset 3329 in Sophya for trunk/Cosmo/SimLSS/cmvobserv3d.cc
- Timestamp:
- Sep 27, 2007, 6:21:55 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvobserv3d.cc
r3323 r3329 26 26 <<" (default: no, spectrum Pk(z=z_median) for all cube)"<<endl 27 27 <<" -F : filter spectrum by pixel shape (0=no 1=yes(default)"<<endl 28 <<" -U : do not poisson fluctuate with Ngal, convert directly to HI mass"<<endl 28 29 <<" -x nx,dx : size along x axis (npix,Mpc)"<<endl 29 30 <<" -y ny,dy : size along y axis (npix,Mpc)"<<endl … … 90 91 bool recompute_schmassdist = true; 91 92 string schmassdistfile = ""; 93 bool no_poisson = false; 92 94 93 95 // *** Niveau de bruit … … 122 124 123 125 char c; 124 while((c = getopt(narg,arg,"ha0PWSV2G F:x:y:z:s:Z:M:A:T:N:Q:R:")) != -1) {126 while((c = getopt(narg,arg,"ha0PWSV2GUF:x:y:z:s:Z:M:A:T:N:Q:R:")) != -1) { 125 127 int nth = 0; 126 128 switch (c) { … … 133 135 case 'G' : 134 136 use_growth_factor = true; 137 break; 138 case 'U' : 139 no_poisson = true; 135 140 break; 136 141 case 'F' : … … 211 216 <<"), schmax="<<schmax<<" ("<<lschmax<<") Msol" 212 217 <<", schnpt="<<schnpt<<endl; 218 if(no_poisson) cout<<"No poisson fluctuation, direct conversion to HI mass"<<endl; 213 219 cout<<"snoise="<<snoise<<" equivalent Msol, evolution="<<isnoise_evol<<endl; 214 220 cout<<"scalecube="<<scalecube<<", offsetcube="<<offsetcube<<endl; … … 385 391 PrtTim(">>>> End Computing a realization in Fourier space"); 386 392 387 /*388 // CMVTEST389 for(int l=0;l<pkgen.SizeX();l++)390 for(int j=0;j<pkgen.SizeY();j++)391 for(int i=0;i<pkgen.SizeZ();i++) {392 double k2 = fluct3d.Kx(i)*fluct3d.Kx(i)393 +fluct3d.Ky(j)*fluct3d.Ky(j)394 +fluct3d.Kz(l)*fluct3d.Kz(l);395 double pk = (k2>0.)? 1./k2: 0.;396 //pkgen(l,j,i) = ComplexGaussRan(sqrt(pk/2.));397 //pkgen(l,j,i) = sqrt(pk/2.);398 pkgen(l,j,i) = 1.;399 }400 // CMVTEST401 */402 403 393 cout<<"\n--- Checking realization spectra"<<endl; 404 394 HistoErr hpkgen(0.,knyqmax,nherr); … … 512 502 } 513 503 514 //STOP_HERE_FOR QUICK_DEBUG515 // return -41;516 517 504 //----------------------------------------------------------------- 518 505 cout<<endl<<"\n--- Converting fluctuations into mass"<<endl; … … 521 508 PrtTim(">>>> End Converting fluctuations into mass"); 522 509 523 cout<<"\n--- Converting mass into galaxy number: gal per pixel =" 524 <<ngal_by_mpc3*fluct3d.GetDVol()<<endl; 525 rm = fluct3d.TurnMass2MeanNumber(ngal_by_mpc3); 526 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200); 527 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.); 528 PrtTim(">>>> End Converting mass into galaxy number"); 529 530 cout<<"\n--- Set negative and null pixels to BAD"<<endl; 531 nm = fluct3d.SetToVal(0.,1e+200,-999.); 532 PrtTim(">>>> End Set negative pixels to BAD etc..."); 533 534 cout<<"\n--- Apply poisson on galaxy number"<<endl; 535 fluct3d.ApplyPoisson(); 536 nm = fluct3d.MeanSigma2(rm,rs2,-998.,1e200); 537 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.); 538 double xgalmin,xgalmax; fluct3d.MinMax(xgalmin,xgalmax,0.1,1.e50); 539 PrtTim(">>>> End Apply poisson on galaxy number"); 540 if(wslice) { 541 fluct3d.WriteSlicePPF("cmvobserv3d_s_rn.ppf"); 542 PrtTim(">>>> End WriteSlicePPF"); 543 } 544 545 cout<<"\n--- Convert Galaxy number to HI mass"<<endl; 546 double mhi = 0.; 547 if(use_schmassdist) { 548 if(recompute_schmassdist) { 549 int ngalmax = int(xgalmax+0.5); 550 schmdist.SetNgalLim(ngalmax,1,naleagal); 551 PrtTim(">>>> End creating tabulated histograms for trials"); 510 if(no_poisson) { 511 512 cout<<"\n--- Converting !!!DIRECTLY!!! mass into HI mass: mass per pixel =" 513 <<mass_by_mpc3*fluct3d.GetDVol()<<endl; 514 rm = fluct3d.TurnMass2HIMass(mass_by_mpc3); 515 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200); 516 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.); 517 PrtTim(">>>> End Converting !!!DIRECTLY!!! mass into HI mass"); 518 519 } else { 520 521 cout<<"\n--- Converting mass into galaxy number: gal per pixel =" 522 <<ngal_by_mpc3*fluct3d.GetDVol()<<endl; 523 rm = fluct3d.TurnMass2MeanNumber(ngal_by_mpc3); 524 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200); 525 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.); 526 PrtTim(">>>> End Converting mass into galaxy number"); 527 528 cout<<"\n--- Set negative and null pixels to BAD"<<endl; 529 nm = fluct3d.SetToVal(0.,1e+200,-999.); 530 PrtTim(">>>> End Set negative pixels to BAD etc..."); 531 532 cout<<"\n--- Apply poisson on galaxy number"<<endl; 533 fluct3d.ApplyPoisson(); 534 nm = fluct3d.MeanSigma2(rm,rs2,-998.,1e200); 535 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.); 536 double xgalmin,xgalmax; fluct3d.MinMax(xgalmin,xgalmax,0.1,1.e50); 537 PrtTim(">>>> End Apply poisson on galaxy number"); 538 if(wslice) { 539 fluct3d.WriteSlicePPF("cmvobserv3d_s_rn.ppf"); 540 PrtTim(">>>> End WriteSlicePPF"); 552 541 } 553 mhi = fluct3d.TurnNGal2MassQuick(schmdist); 554 schmdist.PrintStatus(); 555 } else { 556 mhi = fluct3d.TurnNGal2Mass(tirhmdndm,true); 557 } 558 cout<<mhi<<" MSol in survey / "<<mass_by_mpc3*fluct3d.GetVol()<<endl; 559 nm = fluct3d.MeanSigma2(rm,rs2,-998.,1e200); 560 cout<<"Equivalent: "<<rm*nm/fluct3d.NPix()<<" Msol / pixels"<<endl; 561 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.); 562 PrtTim(">>>> End Convert Galaxy number to HI mass"); 563 564 cout<<"\n--- Set BAD pixels to Zero"<<endl; 565 nm = fluct3d.SetToVal(-998.,1e+200,0.); 566 PrtTim(">>>> End Set BAD pixels to Zero etc..."); 542 543 cout<<"\n--- Convert Galaxy number to HI mass"<<endl; 544 double mhi = 0.; 545 if(use_schmassdist) { 546 if(recompute_schmassdist) { 547 int ngalmax = int(xgalmax+0.5); 548 schmdist.SetNgalLim(ngalmax,1,naleagal); 549 PrtTim(">>>> End creating tabulated histograms for trials"); 550 } 551 mhi = fluct3d.TurnNGal2MassQuick(schmdist); 552 schmdist.PrintStatus(); 553 } else { 554 mhi = fluct3d.TurnNGal2Mass(tirhmdndm,true); 555 } 556 cout<<mhi<<" MSol in survey / "<<mass_by_mpc3*fluct3d.GetVol()<<endl; 557 nm = fluct3d.MeanSigma2(rm,rs2,-998.,1e200); 558 cout<<"Equivalent: "<<rm*nm/fluct3d.NPix()<<" Msol / pixels"<<endl; 559 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.); 560 PrtTim(">>>> End Convert Galaxy number to HI mass"); 561 562 cout<<"\n--- Set BAD pixels to Zero"<<endl; 563 nm = fluct3d.SetToVal(-998.,1e+200,0.); 564 PrtTim(">>>> End Set BAD pixels to Zero etc..."); 565 566 } 567 567 568 568 if(wfits) { … … 579 579 } 580 580 581 //----------------------------------------------------------------- 581 582 if(do_agn) { 582 583 cout<<"\n--- Add AGN: <log10(S Jy)>="<<lfjy_agn<<" , sigma="<<lsigma_agn … … 587 588 } 588 589 590 //----------------------------------------------------------------- 589 591 if(snoise>0.) { 590 592 cout<<"\n--- Add noise to HI Flux snoise="<<snoise<<", evolution="<<isnoise_evol<<endl;
Note:
See TracChangeset
for help on using the changeset viewer.