Changeset 3281 in Sophya for trunk/Cosmo/SimLSS
- Timestamp:
- Jul 10, 2007, 7:23:38 PM (18 years ago)
- Location:
- trunk/Cosmo/SimLSS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/Makefile
r3196 r3281 11 11 12 12 MYEXTINC = ${EXTLIBDIR}/Include 13 MYLIB = $(SOPHYAEXTSLBLIST) -L$(LIB) -lcmvsimbao -lfftw3 -lm14 #MYLIB = $(SOPHYAEXTSLBLIST) -L$(LIB) -lcmvsimbao -lfftw3_threads -lfftw3 -lm13 #MYLIB = $(SOPHYAEXTSLBLIST) -L$(LIB) -lcmvsimbao -lfftw3 -lm 14 MYLIB = $(SOPHYAEXTSLBLIST) -L$(LIB) -lcmvsimbao -lfftw3_threads -lfftw3 -lm 15 15 16 16 #---- Les programmes utilitaires de calcul de cartes -
trunk/Cosmo/SimLSS/cmvobserv3d.cc
r3271 r3281 39 39 <<" -W : write cube in FITS format (complex cube is coded as real cube)"<<endl 40 40 <<" -P : write cube in PPF format"<<endl 41 <<" -S : write cube slices in PPF format"<<endl 41 42 <<" -V : compute variance from real space (for check, default: no)"<<endl 43 <<" -T nth : nombre de threads (si compil multi-thread, default: 0)"<<endl 42 44 <<endl; 43 45 } … … 91 93 bool computefourier0=false; 92 94 bool use_growth_factor = false; 93 unsigned short nthread= 4;95 unsigned short nthread=0; 94 96 95 97 // *** What to do … … 97 99 bool wfits = false; 98 100 bool wppf = false; 101 bool wslice = false; 99 102 bool compvarreal = false; 100 103 … … 106 109 107 110 char c; 108 while((c = getopt(narg,arg,"ha0PWV2Gx:y:z:s:Z:M:A:")) != -1) { 111 while((c = getopt(narg,arg,"ha0PWSV2Gx:y:z:s:Z:M:A:T:")) != -1) { 112 int nth = 0; 109 113 switch (c) { 110 114 case 'a' : … … 150 154 case 'P' : 151 155 wppf = true; 156 break; 157 case 'S' : 158 wslice = true; 159 break; 160 case 'T' : 161 sscanf(optarg,"%d",&nth); 162 nthread = (nth<1)? 0: nth; 152 163 break; 153 164 case 'h' : … … 410 421 PrtTim(">>>> End WritePPF"); 411 422 } 423 if(wslice) { 424 fluct3d.WriteSlicePPF("cmvobserv3d_s_r0.ppf"); 425 PrtTim(">>>> End WriteSlicePPF"); 426 } 412 427 413 428 int_8 nm; … … 448 463 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.); 449 464 PrtTim(">>>> End Apply poisson on galaxy number"); 465 if(wslice) { 466 fluct3d.WriteSlicePPF("cmvobserv3d_s_rn.ppf"); 467 PrtTim(">>>> End WriteSlicePPF"); 468 } 450 469 451 470 cout<<"\n--- Convert Galaxy number to HI mass"<<endl; … … 479 498 PrtTim(">>>> End WritePPF"); 480 499 } 500 if(wslice) { 501 fluct3d.WriteSlicePPF("cmvobserv3d_s_r.ppf"); 502 PrtTim(">>>> End WriteSlicePPF"); 503 } 481 504 482 505 if(do_agn) { … … 502 525 fluct3d.WritePPF("cmvobserv3d_rf.ppf",true); 503 526 PrtTim(">>>> End WritePPF"); 527 } 528 if(wslice) { 529 fluct3d.WriteSlicePPF("cmvobserv3d_s_rf.ppf"); 530 PrtTim(">>>> End WriteSlicePPF"); 504 531 } 505 532 … … 591 618 592 619 ###################################################### 620 openppf cmvobserv3d_s_r0.ppf 621 openppf cmvobserv3d_s_rn.ppf 622 openppf cmvobserv3d_s_r.ppf 623 openppf cmvobserv3d_s_rf.ppf 624 625 ###################################################### 593 626 openppf cmvobserv3d.ppf 594 627 -
trunk/Cosmo/SimLSS/genefluct3d.cc
r3271 r3281 25 25 #include "genefluct3d.h" 26 26 27 //#define FFTW_THREAD27 #define FFTW_THREAD 28 28 29 29 #define MODULE2(_x_) ((double)((_x_).real()*(_x_).real() + (_x_).imag()*(_x_).imag())) … … 437 437 init_fftw(); 438 438 SetObservator(zref,kzref); 439 } catch (PThrowable & exc) { 440 cout<<"Exception : "<<(string)typeid(exc).name() 441 <<" - Msg= "<<exc.Msg()<<endl; 442 return; 443 } catch (...) { 444 cout<<" some other exception was caught !"<<endl; 445 return; 446 } 447 } 448 449 void GeneFluct3D::WriteSlicePPF(string cfname) 450 // On ecrit 3 tranches du cube selon chaque axe 451 { 452 cout<<"--- GeneFluct3D::WriteSlicePPF: Writing Cube Slices"<<cfname<<endl; 453 try { 454 455 POutPersist pos(cfname.c_str()); 456 TMatrix<r_4> S; 457 char str[16]; 458 long i,j,l; 459 460 // Tranches en Z 461 for(int s=0;s<3;s++) { 462 S.ReSize(Nx_,Ny_); 463 if(s==0) l=0; else if(s==1) l=(Nz_+1)/2; else l=Nz_-1; 464 sprintf(str,"z%d",l); 465 for(i=0;i<Nx_;i++) for(j=0;j<Ny_;j++) S(i,j)=data_[IndexR(i,j,l)]; 466 pos<<PPFNameTag(str)<<S; S.RenewObjId(); 467 } 468 469 // Tranches en Y 470 for(int s=0;s<3;s++) { 471 S.ReSize(Nz_,Nx_); 472 if(s==0) j=0; else if(s==1) j=(Ny_+1)/2; else j=Ny_-1; 473 sprintf(str,"y%d",j); 474 for(i=0;i<Nx_;i++) for(l=0;l<Nz_;l++) S(l,i)=data_[IndexR(i,j,l)]; 475 pos<<PPFNameTag(str)<<S; S.RenewObjId(); 476 } 477 478 // Tranches en X 479 for(int s=0;s<3;s++) { 480 S.ReSize(Nz_,Ny_); 481 if(s==0) i=0; else if(s==1) i=(Nx_+1)/2; else i=Nx_-1; 482 sprintf(str,"x%d",i); 483 for(j=0;j<Ny_;j++) for(l=0;l<Nz_;l++) S(l,j)=data_[IndexR(i,j,l)]; 484 pos<<PPFNameTag(str)<<S; S.RenewObjId(); 485 } 486 439 487 } catch (PThrowable & exc) { 440 488 cout<<"Exception : "<<(string)typeid(exc).name() -
trunk/Cosmo/SimLSS/genefluct3d.h
r3271 r3281 100 100 void WritePPF(string cfname,bool write_real=true); 101 101 void ReadPPF(string cfname); 102 void WriteSlicePPF(string cfname); 102 103 103 104 void SetPrtLevel(int lp=0) {lp_ = lp;}
Note:
See TracChangeset
for help on using the changeset viewer.