Changeset 3930 in Sophya for trunk/Cosmo/RadioBeam/specpk.cc


Ignore:
Timestamp:
Dec 23, 2010, 12:49:22 AM (15 years ago)
Author:
ansari
Message:

ajout config double hexagon + programme calcul pknoise a partir du resultat de repicon.cc, Reza 22/12/2010

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/RadioBeam/specpk.cc

    r3825 r3930  
    1 //  Classes to compute 3D power spectrum
    2 // R. Ansari - Nov 2008, May 2010
     1
     2/*  ------------------------ Projet BAORadio --------------------
     3    Classes to compute 3D power spectrum and noise power spectrum
     4    R. Ansari - Nov 2008 ... Dec 2010
     5---------------------------------------------------------------  */
    36
    47#include "specpk.h"
    58#include "randr48.h"     
     9#include "ctimer.h"     
    610
    711//------------------------------------
     
    154158    }
    155159  }
    156   if (prtlev_>0)
     160  if (prtlev_>2)
    157161    cout << " Four3DPk::ComputeFourierAmp() done ..." << endl;
    158162}
     
    182186    }
    183187  }
    184   if (prtlev_>1)  fourAmp.Show();
     188  if (prtlev_>2)  fourAmp.Show();
    185189  if (crmask) {
    186190    POutPersist po("mask.ppf");
     
    233237void Four3DPk::ComputePkCumul(HProf& hp, double s2cut)
    234238{
    235 
     239  uint_8 nmodeok=0;
    236240  // fourAmp represent 3-D fourier transform of a real input array.
    237241  // The second half of the array along Y and Z contain negative frequencies
     
    251255        if ((s2cut>1.e-9)&&(amp2>s2cut))  continue;
    252256        hp.Add(wk, amp2);
     257        nmodeok++;
    253258      }
    254259    }
    255260  }
     261  if (prtlev_>1) {
     262    cout << " Four3DPk::ComputePkCumul/Info : NModeOK=" << nmodeok << " / NMode=" << fourAmp.Size()
     263         << " -> " << 100.*(double)nmodeok/(double)fourAmp.Size() << "%" << endl;
     264  }
    256265  return;
    257266}
    258267
     268//-----------------------------------------------------
     269// -- MassDist2D class :  2D mass distribution
     270// --- PkNoiseCalculator : Classe de calcul du spectre de bruit PNoise(k)
     271// determine par une reponse 2D de l'instrument
     272//-----------------------------------------------------
     273PkNoiseCalculator::PkNoiseCalculator(Four3DPk& pk3, Four2DResponse& rep, double s2cut, int ngen,
     274                                     const char* tit)
     275  : pkn3d(pk3), frep(rep), S2CUT(s2cut), NGEN(ngen), title(tit)
     276{
     277  SetPrtLevel();
     278}
     279
     280HProf PkNoiseCalculator::Compute()
     281{
     282  Timer tm(title.c_str());
     283  tm.Nop();
     284  HProf hnd;
     285  cout << "PkNoiseCalculator::Compute() " << title << "  NGEN=" << NGEN << " S2CUT=" << S2CUT << endl;
     286  for(int igen=0; igen<NGEN; igen++) {
     287    pkn3d.ComputeNoiseFourierAmp(frep);
     288    if (igen==0) hnd = pkn3d.ComputePk(S2CUT);
     289    else pkn3d.ComputePkCumul(hnd,S2CUT);
     290    if ((prtlev_>0)&&(((igen+1)%prtmodulo_)==0))
     291      cout << " PkNoiseCalculator::Compute() - done igen=" << igen << " / MaxNGen=" << NGEN << endl;
     292  }
     293  return hnd;
     294}
    259295
    260296
Note: See TracChangeset for help on using the changeset viewer.