Changeset 3281 in Sophya for trunk/Cosmo/SimLSS


Ignore:
Timestamp:
Jul 10, 2007, 7:23:38 PM (18 years ago)
Author:
cmv
Message:

ecriture fichiers de tranches du cube cmv 10/07/2007

Location:
trunk/Cosmo/SimLSS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/SimLSS/Makefile

    r3196 r3281  
    1111
    1212MYEXTINC = ${EXTLIBDIR}/Include
    13 MYLIB = $(SOPHYAEXTSLBLIST) -L$(LIB) -lcmvsimbao -lfftw3 -lm
    14 #MYLIB = $(SOPHYAEXTSLBLIST) -L$(LIB) -lcmvsimbao -lfftw3_threads -lfftw3 -lm
     13#MYLIB = $(SOPHYAEXTSLBLIST) -L$(LIB) -lcmvsimbao -lfftw3 -lm
     14MYLIB = $(SOPHYAEXTSLBLIST) -L$(LIB) -lcmvsimbao -lfftw3_threads -lfftw3 -lm
    1515
    1616#---- Les programmes utilitaires de calcul de cartes
  • trunk/Cosmo/SimLSS/cmvobserv3d.cc

    r3271 r3281  
    3939     <<" -W : write cube in FITS format (complex cube is coded as real cube)"<<endl
    4040     <<" -P : write cube in PPF format"<<endl
     41     <<" -S : write cube slices in PPF format"<<endl
    4142     <<" -V : compute variance from real space (for check, default: no)"<<endl
     43     <<" -T nth : nombre de threads (si compil multi-thread, default: 0)"<<endl
    4244     <<endl;
    4345}
     
    9193 bool computefourier0=false;
    9294 bool use_growth_factor = false;
    93  unsigned short nthread=4;
     95 unsigned short nthread=0;
    9496
    9597 // *** What to do
     
    9799 bool wfits = false;
    98100 bool wppf = false;
     101 bool wslice = false;
    99102 bool compvarreal = false;
    100103
     
    106109
    107110 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;
    109113  switch (c) {
    110114  case 'a' :
     
    150154  case 'P' :
    151155    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;
    152163    break;
    153164  case 'h' :
     
    410421   PrtTim(">>>> End WritePPF");
    411422 }
     423 if(wslice) {
     424   fluct3d.WriteSlicePPF("cmvobserv3d_s_r0.ppf");
     425   PrtTim(">>>> End WriteSlicePPF");
     426 }
    412427
    413428 int_8 nm;
     
    448463   nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.);
    449464 PrtTim(">>>> End Apply poisson on galaxy number");
     465 if(wslice) {
     466   fluct3d.WriteSlicePPF("cmvobserv3d_s_rn.ppf");
     467   PrtTim(">>>> End WriteSlicePPF");
     468 }
    450469
    451470 cout<<"\n--- Convert Galaxy number to HI mass"<<endl;
     
    479498   PrtTim(">>>> End WritePPF");
    480499 }
     500 if(wslice) {
     501   fluct3d.WriteSlicePPF("cmvobserv3d_s_r.ppf");
     502   PrtTim(">>>> End WriteSlicePPF");
     503 }
    481504
    482505 if(do_agn) {
     
    502525   fluct3d.WritePPF("cmvobserv3d_rf.ppf",true);
    503526   PrtTim(">>>> End WritePPF");
     527 }
     528 if(wslice) {
     529   fluct3d.WriteSlicePPF("cmvobserv3d_s_rf.ppf");
     530   PrtTim(">>>> End WriteSlicePPF");
    504531 }
    505532
     
    591618
    592619######################################################
     620openppf cmvobserv3d_s_r0.ppf
     621openppf cmvobserv3d_s_rn.ppf
     622openppf cmvobserv3d_s_r.ppf
     623openppf cmvobserv3d_s_rf.ppf
     624
     625######################################################
    593626openppf cmvobserv3d.ppf
    594627
  • trunk/Cosmo/SimLSS/genefluct3d.cc

    r3271 r3281  
    2525#include "genefluct3d.h"
    2626
    27 //#define FFTW_THREAD
     27#define FFTW_THREAD
    2828
    2929#define MODULE2(_x_) ((double)((_x_).real()*(_x_).real() + (_x_).imag()*(_x_).imag()))
     
    437437   init_fftw();
    438438   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
     449void 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
    439487 } catch (PThrowable & exc) {
    440488   cout<<"Exception : "<<(string)typeid(exc).name()
  • trunk/Cosmo/SimLSS/genefluct3d.h

    r3271 r3281  
    100100  void WritePPF(string cfname,bool write_real=true);
    101101  void ReadPPF(string cfname);
     102  void WriteSlicePPF(string cfname);
    102103
    103104  void SetPrtLevel(int lp=0) {lp_ = lp;}
Note: See TracChangeset for help on using the changeset viewer.