Changeset 3289 in Sophya for trunk/Cosmo/SimLSS
- Timestamp:
- Aug 6, 2007, 6:20:25 PM (18 years ago)
- Location:
- trunk/Cosmo/SimLSS
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvconcherr.cc
r3284 r3289 307 307 openppf cmvconcherr.ppf 308 308 309 c++exec int i = 700; \ 310 cout<<i<<" "<<herrconc.BinCenter(i)<<" "<<herrconc(i)<<" "<<herrconc.Error2(i)<<" "<<herrconc.NEntBin(i)<<endl; 311 309 312 zone 2 2 310 313 disp herrconc "hbincont err" -
trunk/Cosmo/SimLSS/cmvobserv3d.cc
r3285 r3289 25 25 <<" -G : compute Pk(z=0) and apply growth factor in real space"<<endl 26 26 <<" (default: no, spectrum Pk(z=z_median) for all cube)"<<endl 27 <<" -F : filter spectrum by pixel shape (0=no 1=yes(default)"<<endl 27 28 <<" -x nx,dx : size along x axis (npix,Mpc)"<<endl 28 29 <<" -y ny,dy : size along y axis (npix,Mpc)"<<endl … … 94 95 bool use_growth_factor = false; 95 96 unsigned short nthread=0; 97 int filter_by_pixel = 1; 96 98 97 99 // *** What to do … … 109 111 110 112 char c; 111 while((c = getopt(narg,arg,"ha0PWSV2G x:y:z:s:Z:M:A:T:")) != -1) {113 while((c = getopt(narg,arg,"ha0PWSV2GF:x:y:z:s:Z:M:A:T:")) != -1) { 112 114 int nth = 0; 113 115 switch (c) { … … 121 123 use_growth_factor = true; 122 124 break; 125 case 'F' : 126 sscanf(optarg,"%d",&filter_by_pixel); 127 break; 123 128 case 'x' : 124 129 sscanf(optarg,"%ld,%lf",&nx,&dx); … … 177 182 cout<<"kmin="<<kmin<<" ("<<lkmin<<"), kmax="<<kmax<<" ("<<lkmax<<") Mpc^-1" 178 183 <<", npt="<<npt<<endl; 184 cout<<"Filter by pixel = "<<filter_by_pixel<<endl; 179 185 cout<<"R="<<R<<" Rg="<<Rg<<" Mpc, sigmaR="<<sigmaR<<endl; 180 186 cout<<"nstar= "<<nstar<<" mstar="<<mstar<<" alpha="<<alpha<<endl; … … 337 343 PrtTim(">>>> End Computing a realization in Fourier space"); 338 344 339 if(1) { 340 cout<<"\n--- Checking realization spectra"<<endl; 341 HistoErr hpkgen(0.,knyqmax,nherr); 342 hpkgen.ReCenterBin(); hpkgen.Zero(); 343 hpkgen.Show(); 344 fluct3d.ComputeSpectrum(hpkgen); 345 { 346 tagobs = "hpkgen"; posobs.PutObject(hpkgen,tagobs); 347 } 348 PrtTim(">>>> End Checking realization spectra"); 349 } 345 cout<<"\n--- Checking realization spectra"<<endl; 346 HistoErr hpkgen(0.,knyqmax,nherr); 347 hpkgen.ReCenterBin(); hpkgen.Zero(); 348 hpkgen.Show(); 349 fluct3d.ComputeSpectrum(hpkgen); 350 { 351 tagobs = "hpkgen"; posobs.PutObject(hpkgen,tagobs); 352 } 353 PrtTim(">>>> End Checking realization spectra"); 350 354 351 355 if(comp2dspec) { … … 361 365 } 362 366 363 if(1) { 367 if(filter_by_pixel!=0) { 368 // A_FAIRE (???) ne faut-il pas dans le cas ou on demande 369 // use_growth_factor filtrer uniquement apres avoir appliquer 370 // le facteur de croissance ?????? 364 371 cout<<"\n--- Computing convolution by pixel shape"<<endl; 365 372 fluct3d.FilterByPixel(); 366 373 PrtTim(">>>> End Computing convolution by pixel shape"); 367 } 368 369 if(wfits) { 370 fluct3d.WriteFits("!cmvobserv3d_k0.fits"); 371 PrtTim(">>>> End WriteFits"); 372 } 373 if(wppf) { 374 fluct3d.WritePPF("cmvobserv3d_k0.ppf",false); 375 PrtTim(">>>> End WritePPF"); 376 } 377 378 if(1) { 374 379 375 cout<<"\n--- Checking realization spectra after pixel shape convol."<<endl; 380 376 HistoErr hpkgenf(0.,knyqmax,nherr); … … 386 382 } 387 383 PrtTim(">>>> End Checking realization spectra"); 388 } 389 390 if(comp2dspec) { 391 cout<<"\n--- Checking realization 2D spectra after pixel shape convol."<<endl; 392 Histo2DErr hpkgenf2(0.,ktnyqmax,nherrt,0.,kznyqmax,nherrz); 393 hpkgenf2.ReCenterBin(); hpkgenf2.Zero(); 394 hpkgenf2.Show(); 395 fluct3d.ComputeSpectrum2D(hpkgenf2); 396 { 397 tagobs = "hpkgenf2"; posobs.PutObject(hpkgenf2,tagobs); 384 385 if(comp2dspec) { 386 cout<<"\n--- Checking realization 2D spectra after pixel shape convol."<<endl; 387 Histo2DErr hpkgenf2(0.,ktnyqmax,nherrt,0.,kznyqmax,nherrz); 388 hpkgenf2.ReCenterBin(); hpkgenf2.Zero(); 389 hpkgenf2.Show(); 390 fluct3d.ComputeSpectrum2D(hpkgenf2); 391 { 392 tagobs = "hpkgenf2"; posobs.PutObject(hpkgenf2,tagobs); 393 } 394 PrtTim(">>>> End Checking realization 2D spectra"); 398 395 } 399 PrtTim(">>>> End Checking realization 2D spectra"); 396 } 397 398 if(wfits) { 399 fluct3d.WriteFits("!cmvobserv3d_k0.fits"); 400 PrtTim(">>>> End WriteFits"); 401 } 402 if(wppf) { 403 fluct3d.WritePPF("cmvobserv3d_k0.ppf",false); 404 PrtTim(">>>> End WritePPF"); 400 405 } 401 406 … … 414 419 cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl; 415 420 PrtTim(">>>> End Applying growth factor"); 416 } 421 // A_FAIRE (???) ne faut-il pas maintenant retourner dans fourier 422 // appliquer les filtre des pixels et re-retourner dans reel ? 423 } 424 417 425 418 426 if(wfits) { … … 431 439 int_8 nm; 432 440 double rm,rs2; 433 if(1) { 434 cout<<"\n--- Check mean and variance in real space"<<endl; 435 fluct3d.NumberOfBad(-1.,1e+200); 436 nm = fluct3d.MeanSigma2(rm,rs2); 437 PrtTim(">>>> End Check mean and variance in real space"); 438 } 441 cout<<"\n--- Check mean and variance in real space"<<endl; 442 fluct3d.NumberOfBad(-1.,1e+200); 443 nm = fluct3d.MeanSigma2(rm,rs2); 444 PrtTim(">>>> End Check mean and variance in real space"); 439 445 440 446 if(compvarreal) { … … 549 555 // -- NE PAS FAIRE CA SI ON VEUT CONTINUER LA SIMULATION -> d_rho/rho ecrase 550 556 551 if(1) { 552 cout<<endl<<"\n--- ReComputing spectrum from real space"<<endl; 553 fluct3d.ReComputeFourier(); 554 PrtTim(">>>> End ReComputing spectrum"); 555 } 557 cout<<endl<<"\n--- ReComputing spectrum from real space"<<endl; 558 fluct3d.ReComputeFourier(); 559 PrtTim(">>>> End ReComputing spectrum"); 556 560 557 561 if(wfits) { … … 564 568 } 565 569 566 if(1) { 567 cout<<endl<<"\n--- Computing final spectrum"<<endl; 568 HistoErr hpkrec(0.,knyqmax,nherr); 569 hpkrec.ReCenterBin(); 570 hpkrec.Show(); 571 fluct3d.ComputeSpectrum(hpkrec); 572 tagobs = "hpkrec"; posobs.PutObject(hpkrec,tagobs); 573 PrtTim(">>>> End Computing final spectrum"); 574 } 570 cout<<endl<<"\n--- Computing final spectrum"<<endl; 571 HistoErr hpkrec(0.,knyqmax,nherr); 572 hpkrec.ReCenterBin(); 573 hpkrec.Show(); 574 fluct3d.ComputeSpectrum(hpkrec); 575 tagobs = "hpkrec"; posobs.PutObject(hpkrec,tagobs); 576 PrtTim(">>>> End Computing final spectrum"); 575 577 576 578 if(comp2dspec) { -
trunk/Cosmo/SimLSS/cmvtstagn.cc
r3260 r3289 104 104 sumn += n; sumn2 += n*n; 105 105 double fsum = 0.; unsigned long nf = 0; 106 for( long j=0;j<n;j++) {106 for(unsigned long j=0;j<n;j++) { 107 107 double f = agn.FluxJY(); 108 108 hlflux.Add(log10(f)); -
trunk/Cosmo/SimLSS/genefluct3d.cc
r3284 r3289 462 462 S.ReSize(Nx_,Ny_); 463 463 if(s==0) l=0; else if(s==1) l=(Nz_+1)/2; else l=Nz_-1; 464 sprintf(str,"z% d",l);464 sprintf(str,"z%ld",l); 465 465 for(i=0;i<Nx_;i++) for(j=0;j<Ny_;j++) S(i,j)=data_[IndexR(i,j,l)]; 466 466 pos<<PPFNameTag(str)<<S; S.RenewObjId(); … … 471 471 S.ReSize(Nz_,Nx_); 472 472 if(s==0) j=0; else if(s==1) j=(Ny_+1)/2; else j=Ny_-1; 473 sprintf(str,"y% d",j);473 sprintf(str,"y%ld",j); 474 474 for(i=0;i<Nx_;i++) for(l=0;l<Nz_;l++) S(l,i)=data_[IndexR(i,j,l)]; 475 475 pos<<PPFNameTag(str)<<S; S.RenewObjId(); … … 480 480 S.ReSize(Nz_,Ny_); 481 481 if(s==0) i=0; else if(s==1) i=(Nx_+1)/2; else i=Nx_-1; 482 sprintf(str,"x% d",i);482 sprintf(str,"x%ld",i); 483 483 for(j=0;j<Ny_;j++) for(l=0;l<Nz_;l++) S(l,j)=data_[IndexR(i,j,l)]; 484 484 pos<<PPFNameTag(str)<<S; S.RenewObjId(); -
trunk/Cosmo/SimLSS/genefluct3d.h
r3283 r3289 3 3 4 4 #include "machdefs.h" 5 #include <math.h> 5 6 #include "genericfunc.h" 6 7 #include "tarray.h" … … 67 68 double GetKincMin(void) 68 69 {vector<r_8>::const_iterator it = min_element(Dk_.begin(), Dk_.end()); return *it;} 70 double GetKincMax(void) 71 {vector<r_8>::const_iterator it = max_element(Dk_.begin(), Dk_.end()); return *it;} 69 72 double GetKTincMin(void) {return min(Dk_[0],Dk_[1]);} 73 double GetKTincMax(void) {return max(Dk_[0],Dk_[1]);} 70 74 71 75 void ComputeFourier0(GenericFunc& pk_at_z);
Note:
See TracChangeset
for help on using the changeset viewer.