Changeset 3283 in Sophya for trunk/Cosmo


Ignore:
Timestamp:
Jul 25, 2007, 2:41:39 PM (18 years ago)
Author:
cmv
Message:

scale du spectre final cmv 24/07/2007

Location:
trunk/Cosmo/SimLSS
Files:
3 edited

Legend:

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

    r3281 r3283  
    208208 GrowthFactor growth(om0,ol0);
    209209 // GrowthFactor growth(1.,0.); // D(z) = 1/(1+z)
     210 double growth_at_z = growth(zref);
     211 cout<<"...Growth factor at z="<<zref<<" = "<<growth_at_z<<endl;
    210212
    211213 PkSpectrum0 pk0(pkini,tf);
     
    439441   double varr;
    440442   fluct3d.VarianceFrReal(R,varr);
     443   cout<<"...Computed variance = "<<varr
     444       <<" , Theorical variance at (z=0) = "<<pow(sigmaR,1.)
     445       <<" , at (z="<<zref<<") = "<<pow(sigmaR*growth_at_z,1.)<<endl;
    441446   PrtTim(">>>> End Check variance sigmaR in real space");
    442447 }
     
    511516 }
    512517
     518 double scalecube = -1., offsetcube=0.;
    513519 if(snoise>0.) {
    514520   cout<<"\n--- Add noise to HI Flux snoise="<<snoise<<", evolution="<<isnoise_evol<<endl;
    515521   fluct3d.AddNoise2Real(snoise,(isnoise_evol>0? true:false));
    516522     nm = fluct3d.MeanSigma2(rm,rs2);
     523     if(rs2>0. && sr2int>0.) scalecube = sqrt(sr2int)/sqrt(rs2);
     524     offsetcube = -rm;
    517525   PrtTim(">>>> End Add noise");
    518526 }
    519527
     528 if(scalecube>0.) {
     529   cout<<"\n--- Scale and offset scale="<<scalecube
     530       <<" off="<<offsetcube<<endl;
     531   fluct3d.ScaleOffset(scalecube,offsetcube);
     532 }
     533 
    520534 if(wfits) {
    521535   fluct3d.WriteFits("!cmvobserv3d_rf.fits");
  • trunk/Cosmo/SimLSS/genefluct3d.cc

    r3281 r3283  
    450450// On ecrit 3 tranches du cube selon chaque axe
    451451{
    452  cout<<"--- GeneFluct3D::WriteSlicePPF: Writing Cube Slices"<<cfname<<endl;
     452 cout<<"--- GeneFluct3D::WriteSlicePPF: Writing Cube Slices "<<cfname<<endl;
    453453 try {
    454454
     
    996996               <<" because out of range=]"<<vmin<<","<<vmax<<"["<<endl;
    997997 return nbad;
     998}
     999
     1000void GeneFluct3D::ScaleOffset(double scalecube,double offsetcube)
     1001// Replace  "V"  by  "scalecube * ( V + offsetcube )"
     1002{
     1003 if(lp_>0) cout<<"--- ScaleCube "<<scalecube<<endl;
     1004
     1005 for(long i=0;i<Nx_;i++) for(long j=0;j<Ny_;j++) for(long l=0;l<Nz_;l++) {
     1006   int_8 ip = IndexR(i,j,l);
     1007   data_[ip] = scalecube * ( data_[ip] + offsetcube );
     1008 }
     1009
     1010 return;
    9981011}
    9991012
  • trunk/Cosmo/SimLSS/genefluct3d.h

    r3281 r3283  
    8686  int_8 NumberOfBad(double vmin=-1.e+150,double vmax=1.e+150);
    8787  int_8 SetToVal(double vmin, double vmax,double val0=0.);
     88  void  ScaleOffset(double scalecube=1.,double offsetcube=0.);
    8889
    8990  void TurnFluct2Mass(void);
Note: See TracChangeset for help on using the changeset viewer.