Changeset 3930 in Sophya for trunk/Cosmo/RadioBeam/specpk.cc
- Timestamp:
- Dec 23, 2010, 12:49:22 AM (15 years ago)
- 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 --------------------------------------------------------------- */ 3 6 4 7 #include "specpk.h" 5 8 #include "randr48.h" 9 #include "ctimer.h" 6 10 7 11 //------------------------------------ … … 154 158 } 155 159 } 156 if (prtlev_> 0)160 if (prtlev_>2) 157 161 cout << " Four3DPk::ComputeFourierAmp() done ..." << endl; 158 162 } … … 182 186 } 183 187 } 184 if (prtlev_> 1) fourAmp.Show();188 if (prtlev_>2) fourAmp.Show(); 185 189 if (crmask) { 186 190 POutPersist po("mask.ppf"); … … 233 237 void Four3DPk::ComputePkCumul(HProf& hp, double s2cut) 234 238 { 235 239 uint_8 nmodeok=0; 236 240 // fourAmp represent 3-D fourier transform of a real input array. 237 241 // The second half of the array along Y and Z contain negative frequencies … … 251 255 if ((s2cut>1.e-9)&&(amp2>s2cut)) continue; 252 256 hp.Add(wk, amp2); 257 nmodeok++; 253 258 } 254 259 } 255 260 } 261 if (prtlev_>1) { 262 cout << " Four3DPk::ComputePkCumul/Info : NModeOK=" << nmodeok << " / NMode=" << fourAmp.Size() 263 << " -> " << 100.*(double)nmodeok/(double)fourAmp.Size() << "%" << endl; 264 } 256 265 return; 257 266 } 258 267 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 //----------------------------------------------------- 273 PkNoiseCalculator::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 280 HProf 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 } 259 295 260 296
Note:
See TracChangeset
for help on using the changeset viewer.