Changeset 3583 in Sophya for trunk/Cosmo


Ignore:
Timestamp:
Feb 26, 2009, 5:24:08 PM (17 years ago)
Author:
cmv
Message:
  • ajout de l'option -O a,b,c,d,e pour selectionner l'ecriture sur disque du cube reel ou fourier.
  • Enleve option -D et -d (fgrzproc) de Reza, il faut maintenant utiliser le flag adequat avec l'option -O

cmv 26/02/2009

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/SimLSS/cmvobserv3d.cc

    r3565 r3583  
    5353     <<" -W : write cube in FITS format (complex cube is coded as real cube)"<<endl
    5454     <<" -P : write cube in PPF format"<<endl
     55     <<" -O a,b,c,d,e : tell what you want to write (with the -W and -P options)"<<endl
     56     <<"              a=1 : write generated fourier cube (_k0)"<<endl
     57     <<"              b=1 : write real space cube dRho/Rho at z (_r0)"<<endl
     58     <<"              c=1 : write real space cube conv to gal,poiss,mass etc... (_r)"<<endl
     59     <<"              d=1 : write previous real space cube + noise (_rf)"<<endl
     60     <<"              e=1 : write fourier transform of previous cube (_k)"<<endl
    5561     <<" -S : write cube slices in PPF format"<<endl
    5662     <<" -V : compute variance from real space (for check, default: no)"<<endl
    5763     <<" -T nth : nombre de threads (si compil multi-thread, default: 0)"<<endl
    58      <<" -D fileName : write only real cube d_rho/rho in FITS format and exit "<<endl
    59      <<" -d fileName : write only real cube d_rho/rho in PPF format and exit "<<endl
    60 
    6164     <<endl;
    6265     ////<<" -A <log10(S_agn in Jy at 1.4 GHz)>,sigma,powlaw :"<<endl
     
    129132 bool wslice = false;
    130133 bool compvarreal = false;
    131  //Ajoute par Reza : Ecriture d_rho/rho en fits ou PPF et
    132  bool fgrzproc = false;
    133  string rzppfname = "";
    134  string rzfitsname = "";
    135  
     134 unsigned short whattowrt[5] = {1,1,1,1,1};
     135
    136136 unsigned long ntnent = 10000;  // 0 = do not fill NTuple
    137137
     
    144144
    145145 char c;
    146  while((c = getopt(narg,arg,"ha0PWSB2U:G:F:x:y:z:s:Z:M:A:T:N:Q:R:8:D:d")) != -1) {
     146 while((c = getopt(narg,arg,"ha0PWSV2U:G:F:x:y:z:s:Z:M:A:T:N:Q:R:8:O:")) != -1) {
    147147  int nth = 0;
    148148  switch (c) {
     
    210210    wppf = true;
    211211    break;
     212  case 'O' :
     213    sscanf(optarg,"%hu,%hu,%hu,%hu,%hu"
     214          ,&whattowrt[0],&whattowrt[1],&whattowrt[2],&whattowrt[3],&whattowrt[4]);
     215    break;
    212216  case 'S' :
    213217    wslice = true;
    214     break;
    215   case 'd' :
    216     fgrzproc = true;
    217     rzppfname = optarg;
    218     break;
    219   case 'D' :
    220     fgrzproc = true;
    221     rzfitsname = optarg;
    222218    break;
    223219  case 'T' :
     
    256252 ////  cout<<"AGN: <log10(Jy)>="<<lfjy_agn<<" , sigma="<<lsigma_agn
    257253 ////      <<" , powlaw="<<powlaw_agn<<endl;
     254 cout<<"wfits="<<wfits<<" wppf="<<wppf<<" wslice="<<wslice<<" what?="
     255     <<whattowrt[0]<<","<<whattowrt[1]<<","<<whattowrt[2]<<","<<whattowrt[3]<<","
     256     <<whattowrt[4]<<endl;
    258257
    259258 string tagobs = "cmvobserv3d.ppf";
     
    395394 fluct3d.SetGrowthFactor(growth);
    396395 fluct3d.LosComRedshift(0.001,-1);
    397  TArray< complex<GEN3D_TYPE> >& pkgen = fluct3d.GetComplexArray();
    398  TArray<GEN3D_TYPE>& rgen = fluct3d.GetRealArray();
     396 //TArray< complex<GEN3D_TYPE> >& pkgen = fluct3d.GetComplexArray();
     397 //TArray<GEN3D_TYPE>& rgen = fluct3d.GetRealArray();
    399398 cout<<endl; fluct3d.Print();
    400399 cout<<"\nMean number of galaxies per pixel = "<<ngal_by_mpc3*fluct3d.GetDVol()<<endl;
     
    505504 }
    506505
     506 if(whattowrt[0]==1) {
    507507 if(wfits) {
    508508   fluct3d.WriteFits("!cmvobserv3d_k0.fits");
     
    512512   fluct3d.WritePPF("cmvobserv3d_k0.ppf",false);
    513513   PrtTim(">>>> End WritePPF");
     514 }
    514515 }
    515516
     
    539540 PrtTim(">>>> End Computing reference variance in real space");
    540541
     542 if(whattowrt[1]==1) {
    541543 if(wfits) {
    542544   fluct3d.WriteFits("!cmvobserv3d_r0.fits");
     
    550552   fluct3d.WriteSlicePPF("cmvobserv3d_s_r0.ppf");
    551553   PrtTim(">>>> End WriteSlicePPF");
     554 }
    552555 }
    553556
     
    567570   PrtTim(">>>> End Check variance sigmaR in real space");
    568571 }
    569  if(fgrzproc) {
    570    cout << "--- Flag -d/-D specified, saving d_rho/rho and exiting ..." << endl;
    571    if (rzfitsname.length()>0) {
    572          cout<<" Writing d_rho/rho to fits file " << rzfitsname << endl;
    573      fluct3d.WriteFits(rzfitsname);
    574    }
    575    if (rzppfname.length()>0) {
    576          cout<<" Writing d_rho/rho to PPF file " << rzppfname << endl;
    577      fluct3d.WritePPF(rzppfname);
    578    }
    579    PrtTim(">>>> End WriteFits/PPF_d_rho/rho");
    580    cout<<"-------------------- END ------------------"<<endl;
    581    return 0;
    582  }
     572
    583573 //-----------------------------------------------------------------
    584574 if(no_poisson_type!=0) {
     
    640630
    641631 //-----------------------------------------------------------------
     632 if(whattowrt[2]==1) {
    642633 if(wfits) {
    643634   fluct3d.WriteFits("!cmvobserv3d_r.fits");
     
    651642   fluct3d.WriteSlicePPF("cmvobserv3d_s_r.ppf");
    652643   PrtTim(">>>> End WriteSlicePPF");
     644 }
    653645 }
    654646
     
    686678
    687679 //-----------------------------------------------------------------
     680 if(whattowrt[3]==1) {
    688681 if(wfits) {
    689682   fluct3d.WriteFits("!cmvobserv3d_rf.fits");
     
    697690   fluct3d.WriteSlicePPF("cmvobserv3d_s_rf.ppf");
    698691   PrtTim(">>>> End WriteSlicePPF");
     692 }
    699693 }
    700694
     
    707701 PrtTim(">>>> End ReComputing spectrum");
    708702
     703 if(whattowrt[4]==1) {
    709704 if(wfits) {
    710705   fluct3d.WriteFits("!cmvobserv3d_k.fits");
     
    714709   fluct3d.WritePPF("cmvobserv3d_k.ppf",false);
    715710   PrtTim(">>>> End WritePPF");
     711 }
    716712 }
    717713
Note: See TracChangeset for help on using the changeset viewer.