Changeset 3261 in Sophya


Ignore:
Timestamp:
Jun 4, 2007, 7:02:03 PM (18 years ago)
Author:
cmv
Message:

add sigma computation with bad pixel cmv 04/06/2007

Location:
trunk/Cosmo/SimLSS
Files:
4 edited

Legend:

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

    r3252 r3261  
    301301     <<","<<hifactor*Msol2FluxHI(mhiref,dlumlim[1])<<"] W/m^2"<<endl;
    302302 double sfhi = fhi / (dnuhiz*1e9) / Jansky2Watt_cst;
    303  cout<<"If spread over "<<dnuhiz<<" GHz, flux density = "<<sfhi<<" Jy"<<endl;
     303 cout<<"If spread over pixel depth ("<<dnuhiz<<" GHz), flux density = "<<sfhi<<" Jy"<<endl;
    304304
    305305 // --- Signal analysis
     
    337337 cout<<"Synchrotron: T="<<Tsynch408<<" K ("<<nuhaslam<<" GHz), "
    338338     <<tsynch<<" K ("<<nuhiz<<" GHz)"<<endl
    339      <<"             P="<<psynch<<" W"<<endl;
    340  cout<<"             flux density = "<<ssynch<<" Jy"<<endl;
     339     <<"             P="<<psynch<<" W for pixel"<<endl;
     340 cout<<"             flux density = "<<ssynch<<" Jy for pixel solid angle"<<endl;
    341341
    342342 // CMB
     
    345345 double pcmb = facpolar * planck(nuhiz*1.e+9) * surfeff * angsol * (dnuhiz*1e9);
    346346 double scmb = pcmb / surfeff / (dnuhiz*1.e+9) / Jansky2Watt_cst;
    347  cout<<"CMB: T="<<tcmb<<" K -> P="<<pcmb<<" W"<<endl;
    348  cout<<"                       flux density = "<<scmb<<" Jy"<<endl;
     347 cout<<"CMB: T="<<tcmb<<" K -> P="<<pcmb<<" W for pixel"<<endl;
     348 cout<<"                       flux density = "<<scmb<<" Jy for pixel solid angle"<<endl;
    349349
    350350 // AGN
  • trunk/Cosmo/SimLSS/cmvobserv3d.cc

    r3252 r3261  
    435435 cout<<"1+rgen: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
    436436     <<rs2<<" -> "<<sqrt(rs2)<<endl;
     437 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.);
     438 cout<<"1+rgen with_neg_a_zero: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
     439     <<rs2<<" -> "<<sqrt(rs2)<<endl;
    437440 PrtTim(">>>> End Converting fluctuations into mass");
    438441
     
    441444 cout<<rm<<" galaxies put into survey"<<endl;
    442445 nm = fluct3d.MeanSigma2(rm,rs2,0.);
    443  cout<<"galaxy: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
     446 cout<<"galaxy mass: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
     447     <<rs2<<" -> "<<sqrt(rs2)<<endl;
     448 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.);
     449 cout<<"galaxy mass with_neg_a_zero: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
    444450     <<rs2<<" -> "<<sqrt(rs2)<<endl;
    445451 PrtTim(">>>> End Converting mass into galaxy number");
    446452
    447  cout<<"\n--- Set negative pixels to BAD"<<endl;
     453 cout<<"\n--- Set negative and null pixels to BAD"<<endl;
    448454 nm = fluct3d.SetToVal(0.,1e+200,-999.);
    449455 cout<<nm<<" negative in survey set to BAD"<<endl;
    450456 nm = fluct3d.MeanSigma2(rm,rs2,-998.);
    451  cout<<"galaxy: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
     457 cout<<"galaxy mass: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
    452458     <<rs2<<" -> "<<sqrt(rs2)<<endl;
    453459 PrtTim(">>>> End Set negative pixels to BAD etc...");
     
    457463 cout<<nm<<" galaxies into survey after poisson"<<endl;
    458464 nm = fluct3d.MeanSigma2(rm,rs2,-998.);
    459  cout<<"galaxy: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
     465 cout<<"galaxy number: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
     466     <<rs2<<" -> "<<sqrt(rs2)<<endl;
     467 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.);
     468 cout<<"galaxy number with_neg_a_zero: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
    460469     <<rs2<<" -> "<<sqrt(rs2)<<endl;
    461470 PrtTim(">>>> End Apply poisson on galaxy number");
     
    474483 double mhi = fluct3d.TurnNGal2Mass(tirhmdndm,true);
    475484 cout<<mhi<<" MSol in survey / "<<mass_by_mpc3*fluct3d.GetVol()<<endl;
    476  nm = fluct3d.MeanSigma2(rm,rs2,0.);
     485 nm = fluct3d.MeanSigma2(rm,rs2,-998.);
    477486 cout<<"HI mass: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
    478487     <<rs2<<" -> "<<sqrt(rs2)<<endl;
    479488 cout<<"Equivalent: "<<rm*nm/fluct3d.NPix()<<" Msol / pixels"<<endl;
     489 nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200,true,0.);
     490 cout<<"HI mass with_neg_a_zero: ("<<nm<<") Mean = "<<rm<<", Sigma^2 = "
     491     <<rs2<<" -> "<<sqrt(rs2)<<endl;
    480492 PrtTim(">>>> End Convert Galaxy number to HI mass");
    481493
  • trunk/Cosmo/SimLSS/genefluct3d.cc

    r3255 r3261  
    854854}
    855855
    856 int_8 GeneFluct3D::MeanSigma2(double& rm,double& rs2,double vmin,double vmax)
    857 // mean,sigma^2 pour pixels avec valeurs ]vmin,vmax[ extremites exclues
    858 //   -> mean and sigma^2 are NOT computed with pixels values vmin and vmax
    859 {
     856int_8 GeneFluct3D::MeanSigma2(double& rm,double& rs2,double vmin,double vmax
     857                             ,bool useout,double vout)
     858// Calcul de mean,sigma2 dans le cube reel avec valeurs ]vmin,vmax[ extremites exclues
     859// useout = false: ne pas utiliser les pixels hors limites pour calculer mean,sigma2
     860//          true : utiliser les pixels hors limites pour calculer mean,sigma2
     861//                 en remplacant leurs valeurs par "vout"
     862{
     863 bool tstval = (vmax>vmin)? true: false;
     864 if(lp_>0) {
     865   cout<<"--- MeanSigma2: ";
     866   if(tstval) cout<<"range=]"<<vmin<<","<<vmax<<"[";
     867   if(useout) cout<<", useout="<<useout<<" vout="<<vout;
     868   cout<<endl;
     869 }
    860870 check_array_alloc();
    861871
     
    866876   int_8 ip = IndexR(i,j,l);
    867877   double v = data_[ip];
    868    if(v<=vmin || v>=vmax) continue;
     878   if(tstval) {
     879     if(v<=vmin || v>=vmax) {if(useout) v=vout; else continue;}
     880   }
    869881   rm += v;
    870882   rs2 += v*v;
     
    877889 }
    878890
     891 if(lp_>0) cout<<"  n="<<n<<" m="<<rm<<" s2="<<rs2<<" s="<<sqrt(fabs(rs2))<<endl;
     892
    879893 return n;
    880894}
     
    882896int_8 GeneFluct3D::SetToVal(double vmin, double vmax,double val0)
    883897// set to "val0" if out of range ]vmin,vmax[ extremites exclues
    884 //     ->  vmin and vmax are set to val0
    885 {
     898// cad set to "val0" if in [vmin,vmax] -> vmin and vmax are set to val0
     899{
     900 if(lp_>0) cout<<"--- SetToVal set to="<<val0
     901               <<" when in range=["<<vmin<<","<<vmax<<"]"<<endl;
    886902 check_array_alloc();
    887903
  • trunk/Cosmo/SimLSS/genefluct3d.h

    r3199 r3261  
    7474
    7575  int_8 VarianceFrReal(double R,double& var);
    76   int_8 MeanSigma2(double& rm,double& rs2,double vmin=-1.e+150,double vmax=1.e+150);
     76  int_8 MeanSigma2(double& rm,double& rs2,double vmin=1.,double vmax=-1.
     77                  ,bool useout=false,double vout=0.);
    7778  int_8 NumberOfBad(double vmin=-1.e+150,double vmax=1.e+150);
    7879  int_8 SetToVal(double vmin, double vmax,double val0=0.);
Note: See TracChangeset for help on using the changeset viewer.