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


Ignore:
Timestamp:
Aug 6, 2007, 6:20:25 PM (18 years ago)
Author:
cmv
Message:

petites mises en formes cmv 06/08/2007

File:
1 edited

Legend:

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

    r3285 r3289  
    2525     <<" -G : compute Pk(z=0) and apply growth factor in real space"<<endl
    2626     <<"      (default: no, spectrum Pk(z=z_median) for all cube)"<<endl
     27     <<" -F : filter spectrum by pixel shape (0=no 1=yes(default)"<<endl
    2728     <<" -x nx,dx : size along x axis (npix,Mpc)"<<endl
    2829     <<" -y ny,dy : size along y axis (npix,Mpc)"<<endl
     
    9495 bool use_growth_factor = false;
    9596 unsigned short nthread=0;
     97 int filter_by_pixel = 1;
    9698
    9799 // *** What to do
     
    109111
    110112 char c;
    111  while((c = getopt(narg,arg,"ha0PWSV2Gx:y:z:s:Z:M:A:T:")) != -1) {
     113 while((c = getopt(narg,arg,"ha0PWSV2GF:x:y:z:s:Z:M:A:T:")) != -1) {
    112114  int nth = 0;
    113115  switch (c) {
     
    121123    use_growth_factor = true;
    122124    break;
     125  case 'F' :
     126    sscanf(optarg,"%d",&filter_by_pixel);
     127    break;
    123128  case 'x' :
    124129    sscanf(optarg,"%ld,%lf",&nx,&dx);
     
    177182 cout<<"kmin="<<kmin<<" ("<<lkmin<<"), kmax="<<kmax<<" ("<<lkmax<<") Mpc^-1"
    178183     <<", npt="<<npt<<endl;
     184 cout<<"Filter by pixel = "<<filter_by_pixel<<endl;
    179185 cout<<"R="<<R<<" Rg="<<Rg<<" Mpc, sigmaR="<<sigmaR<<endl;
    180186 cout<<"nstar= "<<nstar<<"  mstar="<<mstar<<"  alpha="<<alpha<<endl;
     
    337343 PrtTim(">>>> End Computing a realization in Fourier space");
    338344
    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");
    350354
    351355 if(comp2dspec) {
     
    361365 }
    362366
    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  ??????
    364371   cout<<"\n--- Computing convolution by pixel shape"<<endl;
    365372   fluct3d.FilterByPixel();
    366373   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
    379375   cout<<"\n--- Checking realization spectra after pixel shape convol."<<endl;
    380376   HistoErr hpkgenf(0.,knyqmax,nherr);
     
    386382   }
    387383   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");
    398395   }
    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");
    400405 }
    401406
     
    414419   cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl;
    415420   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
    417425
    418426 if(wfits) {
     
    431439 int_8 nm;
    432440 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");
    439445
    440446 if(compvarreal) {
     
    549555 // -- NE PAS FAIRE CA SI ON VEUT CONTINUER LA SIMULATION -> d_rho/rho ecrase
    550556 
    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");
    556560
    557561 if(wfits) {
     
    564568 }
    565569
    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");
    575577
    576578 if(comp2dspec) {
Note: See TracChangeset for help on using the changeset viewer.