Changeset 3154 in Sophya for trunk/Cosmo/SimLSS/cmvobserv3d.cc


Ignore:
Timestamp:
Jan 19, 2007, 5:19:49 PM (19 years ago)
Author:
cmv
Message:

modifs d'options de cmvobserv3d.cc
creation de init_fftw() et deplacement a l'initialisation
creation de SetObservator pour positionner l'observateur + ecriture FITS et PPF

(mais le codage des distance/redshift reste a coder)

cmv 19/01/2007

File:
1 edited

Legend:

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

    r3150 r3154  
    2828     <<" -Z zref : redshift median"<<endl
    2929     <<" -s snoise : sigma du bruit en Msol"<<endl
     30     <<" -2 : compute 2D spectrum"<<endl
     31     <<" -F : write cube in FITS format"<<endl
     32     <<" -P : write cube in PPF format"<<endl
     33     <<" -V : compute variance from real space"<<endl
    3034     <<endl;
    3135}
     
    7377 unsigned short nthread=4;
    7478
     79 // *** What to do
     80 bool comp2dspec = false;
     81 bool wfits = false;
     82 bool wppf = false;
     83 bool compvarreal = false;
     84
    7585 // --- Decodage arguments
    7686
    7787 char c;
    78  while((c = getopt(narg,arg,"ha0x:y:z:s:Z:")) != -1) {
     88 while((c = getopt(narg,arg,"ha0PWV2x:y:z:s:Z:")) != -1) {
    7989  switch (c) {
    8090  case 'a' :
     
    98108  case 'Z' :
    99109    sscanf(optarg,"%lf",&zref);
     110    break;
     111  case '2' :
     112    comp2dspec = true;
     113    break;
     114  case 'V' :
     115    compvarreal = true;
     116    break;
     117  case 'W' :
     118    wfits = true;
     119    break;
     120  case 'P' :
     121    wppf = true;
    100122    break;
    101123  case 'h' :
     
    185207
    186208 //-----------------------------------------------------------------
    187  cout<<endl<<"\n--- Compute galaxies density number"<<endl;
     209 cout<<endl<<"\n--- Compute galaxy density number"<<endl;
    188210
    189211 sch.SetOutValue(0);
     
    249271 }
    250272
    251  if(1) {
     273 if(comp2dspec) {
    252274   cout<<"\n--- Checking realization 2D spectra"<<endl;
    253275   Histo2DErr hpkgen2(0.,ktnyqmax,nherrt,0.,kznyqmax,nherrz);
     
    265287 }
    266288
    267  if(1) fluct3d.WriteFits("!cmvobserv3d_k.fits");
    268  if(1) fluct3d.WritePPF("cmvobserv3d_k.ppf",false);
     289 if(wfits) fluct3d.WriteFits("!cmvobserv3d_k0.fits");
     290 if(wppf) fluct3d.WritePPF("cmvobserv3d_k0.ppf",false);
    269291
    270292 if(1) {
     
    279301 }
    280302
    281  if(1) {
     303 if(comp2dspec) {
    282304   cout<<"\n--- Checking realization 2D spectra after pixel shape convol."<<endl;
    283305   Histo2DErr hpkgenf2(0.,ktnyqmax,nherrt,0.,kznyqmax,nherrz);
     
    295317 cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl;
    296318
    297  if(1) fluct3d.WriteFits("!cmvobserv3d_r0.fits");
    298  if(1) fluct3d.WritePPF("cmvobserv3d_r0.ppf",true);
     319 if(wfits) fluct3d.WriteFits("!cmvobserv3d_r0.fits");
     320 if(wppf) fluct3d.WritePPF("cmvobserv3d_r0.ppf",true);
    299321
    300322 int_8 nm;
     
    308330 }
    309331
    310  if(1) {
     332 if(compvarreal) {
    311333   cout<<"\n--- Check variance sigmaR in real space"<<endl;
    312334   double varr;
     
    336358     <<rs2<<" -> "<<sqrt(rs2)<<endl;
    337359
    338  cout<<"\n--- Apply poisson on galaxie number"<<endl;
     360 cout<<"\n--- Apply poisson on galaxy number"<<endl;
    339361 nm = fluct3d.ApplyPoisson();
    340362 cout<<nm<<" galaxies into survey after poisson"<<endl;
     
    343365     <<rs2<<" -> "<<sqrt(rs2)<<endl;
    344366
    345  cout<<"\n--- Convert Galaxies number to HI mass"<<endl;
     367 cout<<"\n--- Convert Galaxy number to HI mass"<<endl;
    346368 long nhmdndm = long( (lschmax-lschmin+1.)*100. + 0.5);
    347369 Histo hmdndm(lschmin,lschmax,nhmdndm);
     
    368390     <<rs2<<" -> "<<sqrt(rs2)<<endl;
    369391
    370  if(1) fluct3d.WriteFits("!cmvobserv3d_r.fits");
    371  if(1) fluct3d.WritePPF("cmvobserv3d_r.ppf",true);
     392 if(wfits) fluct3d.WriteFits("!cmvobserv3d_r.fits");
     393 if(wppf) fluct3d.WritePPF("cmvobserv3d_r.ppf",true);
    372394
    373395 cout<<"\n--- Add noise to HI Flux snoise="<<snoise<<endl;
     
    384406   fluct3d.ReComputeFourier();
    385407 }
     408
     409 if(wfits) fluct3d.WriteFits("!cmvobserv3d_k.fits");
     410 if(wppf) fluct3d.WritePPF("cmvobserv3d_k.ppf",false);
    386411
    387412 if(1) {
     
    394419 }
    395420
    396  if(1) {
     421 if(comp2dspec) {
    397422   cout<<"\n--- Computing final 2D spectrum"<<endl;
    398423   Histo2DErr hpkrec2(0.,ktnyqmax,nherrt,0.,kznyqmax,nherrz);
     
    410435/*
    411436######################################################
     437readfits cmvobserv3d_k0.fits
    412438readfits cmvobserv3d_k.fits
    413439readfits cmvobserv3d_r0.fits
    414440readfits cmvobserv3d_r.fits
    415441
     442openppf cmvobserv3d_k0.ppf
    416443openppf cmvobserv3d_k.ppf
    417444openppf cmvobserv3d_r0.ppf
Note: See TracChangeset for help on using the changeset viewer.