Changeset 3924 in Sophya


Ignore:
Timestamp:
Dec 10, 2010, 4:38:23 PM (15 years ago)
Author:
cmv
Message:

intro choix dabs calcul de beta pour les redshift-distorsions, cmv 10/12/2010

Location:
trunk/Cosmo/SimLSS
Files:
3 edited

Legend:

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

    r3908 r3924  
    2727{
    2828 cout<<"cmvginit3d [...options...]"<<endl
    29      <<" -a : auto init random seed (needed for multiple simul)"<<endl
     29     <<"-- redshift"<<endl
     30     <<" -Z zref : redshift for the center of the simulation cube"<<endl
     31     <<"-- geometry"<<endl
     32     <<" -x nx,dx : size along x axis (npix,Mpc)"<<endl
     33     <<" -y ny,dy : size along y axis (npix,Mpc)"<<endl
     34     <<"            if ny or dy <=0 take same value as for x"<<endl
     35     <<" -z nz,dz : size along z axis (redshift axis, npix,Mpc)"<<endl
     36     <<"-- input spectra"<<endl
     37     <<" -8 sigmaR,R : normalisation du spectre de puissance, R en Mpc"<<endl
     38     <<"               (default sigmaR=1, R=8/h100 Mpc)"<<endl
     39     <<" -f cambspec.dat,h100tab,ztab : use CAMB file (def: Eisenstein spectrum)"<<endl
     40     <<" -F : filter spectrum by pixel shape (0=no 1=yes(default)"<<endl
     41     <<"-- redshift evolution"<<endl
    3042     <<" -G typevol: compute Pk(z=0) and apply growth factor in real space"<<endl
    3143     <<"       typevol=1 evolved with distance / observateur (def)"<<endl
    3244     <<"       typevol=2 evolved with distance to middle of Z planes"<<endl
    3345     <<"       else : no evol, spectrum Pk(z=z_median) for all cube (def)"<<endl
    34      <<" -F : filter spectrum by pixel shape (0=no 1=yes(default)"<<endl
     46     <<"-- redshift distorsions"<<endl
     47     <<" -B type,fixed_beta : redshift distorted P(k)_z = P(k)*(1+beta*mu^2)^2"<<endl
     48     <<"      type=0 : compute beta = -(1+z)*D'/D (default)"<<endl
     49     <<"      type>0 : compute beta = OmegaM(z)^fixed_beta"<<endl
     50     <<"      type<0 : use beta = fixed_beta"<<endl
    3551     <<" -K : modify spectrum with Kaiser redshift distortion (default=no)"<<endl
    36      <<" -x nx,dx : size along x axis (npix,Mpc)"<<endl
    37      <<" -y ny,dy : size along y axis (npix,Mpc)"<<endl
    38      <<"            if ny or dy <=0 take same value as for x"<<endl
    39      <<" -z nz,dz : size along z axis (redshift axis, npix,Mpc)"<<endl
    40      <<" -Z zref : redshift for the center of the simulation cube"<<endl
    41      <<" -f cambspec.dat,h100tab,ztab : use CAMB file (def: Eisenstein spectrum)"<<endl
     52     <<" -v temp_file.ppf: generate los velocity cube"<<endl
     53     <<"                   temporary save cube in temp_file.ppf"<<endl
     54     <<"-- program init and efficiency"<<endl
     55     <<" -a : auto init random seed (needed for multiple simul)"<<endl
     56     <<" -T nth : nombre de threads (si compil multi-thread, default: 0)"<<endl
     57     <<"-- check by re-computing Pk spectra, ntuple"<<endl
    4258     <<" -1 : compute 1D spectrum (default: no)"<<endl
    4359     <<" -2 : compute 2D spectrum (default: no)"<<endl
    4460     <<" -C : go back to cube in FT space and compute P(k) for check (def: do nothing)"<<endl
    45      <<" -8 sigmaR,R : normalisation du spectre de puissance, R en Mpc"<<endl
    46      <<"               (default sigmaR=1, R=8/h100 Mpc)"<<endl
    47      <<" -v temp_file.ppf: generate los velocity cube"<<endl
    48      <<"                   temporary save cube in temp_file.ppf"<<endl
    4961     <<" -n nent : fill control ntuple with nent entries (def: do not fill)"<<endl
     62     <<" -V : compute variance from real space (for check, default: no)"<<endl
     63     <<"-- output type selection"<<endl
     64     <<" -o out_base_name : base string for output file name (def: cmvginit3d)"<<endl
    5065     <<" -O a,b : tell what you want to write"<<endl
    5166     <<"      a : write generated fourier cube (_k0)"<<endl
     
    5368     <<"      a,b= 0 no write, 1 ppf write, 2 fits write, 3 ppf+fits write"<<endl
    5469     <<" -S : write cube slices in PPF format"<<endl
    55      <<" -o out_base_name : base string for output file name (def: cmvginit3d)"<<endl
    56      <<" -V : compute variance from real space (for check, default: no)"<<endl
    57      <<" -T nth : nombre de threads (si compil multi-thread, default: 0)"<<endl
    5870     <<endl;
    5971}
     
    93105 unsigned short nthread=0;
    94106 int filter_by_pixel = 1;
    95  bool kaiser_modify = false;
    96 
    97  // *** What to do
     107
     108 // *** traitement des distorsions de redshift
    98109 bool comptransveloc = false;
    99110 string temporay_file = "cmvginit3d_tmp.ppf";
     111 bool kaiser_modify = false;
     112 int type_beta = 0;
     113 double fixed_beta = 0.6;
     114
     115 // *** What to do
    100116 // compute: 1=1D spectra,  2=2D spectra,
    101117 //          4=recompute spectra after real space generation
     
    122138 // --- Decodage des arguments
    123139 char c;
    124  while((c = getopt(narg,arg,"haG:F:Kx:y:z:Z:128:v:n:CO:So:VT:f:")) != -1) {
     140 while((c = getopt(narg,arg,"haG:F:KB:x:y:z:Z:128:v:n:CO:So:VT:f:")) != -1) {
    125141  int nth = 0;
    126142  switch (c) {
     
    135151    break;
    136152  case 'K' :
    137     kaiser_modify =  true;
     153    kaiser_modify = true;
     154    break;
     155  case 'B' :
     156    sscanf(optarg,"%d,%lf",&type_beta,&fixed_beta);
    138157    break;
    139158  case 'x' :
     
    206225 if(kaiser_modify) cout<<"Modify spectrum with Kaiser redshift distorted formula"<<endl;
    207226 if(comptransveloc) cout<<"Tansverse velocity generation requested"<<endl;
     227 if(type_beta>0) cout<<"Beta: Pk factor is (1 + OmegaM^"<<fixed_beta<<" * mu^2)^2"<<endl;
     228   else if(type_beta<0) cout<<"Beta: Pk factor is (1 + "<<fixed_beta<<" * mu^2)^2"<<endl;
     229     else cout<<"Beta: automatically computed with dD/dEta"<<endl;
    208230 if(cambfread.size()>0) cout<<"use CAMB file: cambfread="<<cambfread<<endl;
    209231 cout<<"R="<<R<<" Rg="<<Rg<<" Mpc, sigmaR="<<sigmaR<<endl;
     
    414436 if(kaiser_modify) {
    415437   cout<<"\n--- Modify spectrum coeff with Kaiser redshift distorted formula"<<endl;
    416    fluct3d.ToRedshiftSpace();
     438   fluct3d.ToRedshiftSpace(type_beta,fixed_beta);
    417439   spec_is_modified = true;
    418440   PrtTim(">>>> End Computing Modify spectrum coeff with Kaiser");
     
    571593   //-----------------------------------------------------------------
    572594   cout<<"\n--- Modifying cube for Transverse velocity"<<endl;
    573    fluct3d.ToVelLoS();
     595   fluct3d.ToVelLoS(type_beta,fixed_beta);
    574596   fluct3d.NTupleCheck(posobs,string("ntpvgenf"),ntnent);
    575597   PrtTim(">>>> End Modifying cube for Transverse velocity");
     
    614636      cout<<"\n--- Apply Growth factor for transverse velocity"<<endl;
    615637      cout<<"...D(z=0)="<<growth(0.)<<"  D(z="<<zref<<")="<<growth(zref)<<endl;
    616       fluct3d.ApplyVelLosGrowthFactor(use_growth_factor);
     638      fluct3d.ApplyVelLosGrowthFactor(use_growth_factor,type_beta,fixed_beta);
    617639      fluct3d.MinMax(vdum1,vdum2);
    618640      fluct3d.MeanSigma2(vdum1,vdum2);
     
    637659    }
    638660
    639  }
     661 }  //// Fin de Transverse velocity space computation
    640662
    641663 //-----------------------------------------------------------------
  • trunk/Cosmo/SimLSS/genefluct3d.cc

    r3908 r3924  
    904904
    905905//-------------------------------------------------------------------
    906 void GeneFluct3D::ToRedshiftSpace(void)
     906void GeneFluct3D::ToRedshiftSpace(int type_beta,double fixed_beta)
    907907// Apply redshift distortion corrections
    908 // ---- ATTENTION: Le spectre Pk doit etre (dRho/Rho)(k)
     908// P(k)_z = P(k) * ( 1 + beta * mu^2 )^2
     909// type_beta: =0 compute factor automatically with beta=-(1+z)/D*dD/z
     910//            >0 compute factor with fix beta=Omega^fixed_beta
     911//            <0 compute factor with fix beta=fixed_beta
     912// ---- ATTENTION:
     913// 1- Le spectre Pk doit etre (dRho/Rho)(k)
     914// 2- pas d'evolution en redhsuft possible,
     915//    le spectre doit etre calcule au redshift final de la boite
    909916{
    910917 double zpk = compute_pk_redsh_ref_;
    911  double beta = -(1.+zpk) * growth_->DsDz(zpk,good_dzinc_) / (*growth_)(zpk);
    912  if(lp_>0) cout<<"--- ToRedshiftSpace --- at z="<<zpk<<", Beta="<<beta
    913                <<" (comp. for dz="<<good_dzinc_<<")"<<endl;
     918 if(lp_>0) cout<<"--- ToRedshiftSpace --- at z="<<zpk<<", type_beta="<<type_beta<<endl;
     919
     920 double beta = 0.;
     921 if(type_beta>0) {
     922   double omegam = cosmo_->Omatter(zpk); beta = pow(omegam,fixed_beta);
     923   if(lp_>0) cout<<"...beta = OmegaM^expo = "<<omegam<<"^"<<fixed_beta<<" = "<<beta<<endl;
     924 } else if(type_beta<0) {
     925   beta = fixed_beta;
     926   if(lp_>0) cout<<"...beta = "<<beta<<endl;
     927 } else {
     928   beta = -(1.+zpk) * growth_->DsDz(zpk,good_dzinc_) / (*growth_)(zpk);
     929   if(lp_>0) cout<<"...beta = -(1+z)*D'/D = "<<beta<<endl;
     930 }
     931
    914932 check_array_alloc();
    915933
     
    929947
    930948//-------------------------------------------------------------------
    931 void GeneFluct3D::ToVelLoS(void)
     949void GeneFluct3D::ToVelLoS(int type_beta,double fixed_beta)
    932950/*
     951// P(k)_z = P(k) * ( 1 + beta * mu^2 )^2
     952// type_beta: =0 compute factor automatically with beta=-(1+z)/D*dD/z
     953//            >0 compute factor with fix beta=Omega^fixed_beta
     954//            <0 compute factor with fix beta=fixed_beta
    933955---- Vitesse particuliere
    934956Un atome au redshift "z" emet a la longueur d'onde "Le" si il est au repos
     
    948970{
    949971 double zpk = compute_pk_redsh_ref_;
    950  double dpsd = -cosmo_->H(zpk) * (1.+zpk) * growth_->DsDz(zpk,good_dzinc_) / (*growth_)(zpk);
    951  if(lp_>0) cout<<"--- ToVelLoS --- at z="<<zpk<<", -H*(1+z)*D'/D="<<dpsd
    952                <<" (km/s)/Mpc (comp. for dz="<<good_dzinc_<<")"<<endl;
     972 if(lp_>0) cout<<"--- ToVelLoS --- at z="<<zpk<<", type_beta="<<type_beta<<endl;
     973
     974 double beta = 0;
     975 if(type_beta>0) {
     976   double omegam = cosmo_->Omatter(zpk);
     977   beta = pow(omegam,fixed_beta);
     978   if(lp_>0) cout<<"...beta = OmegaM^expo = "<<omegam<<"^"<<fixed_beta<<"="<<beta<<endl;
     979 } else if(type_beta<0) {
     980   beta = fixed_beta;
     981   if(lp_>0) cout<<"...beta="<<beta<<endl;
     982 } else {
     983   beta = -(1.+zpk) * growth_->DsDz(zpk,good_dzinc_) / (*growth_)(zpk);
     984   if(lp_>0) cout<<"...beta = -(1+z)*D'/D = "<<beta<<endl;
     985 }
     986 double dpsd = cosmo_->H(zpk) * beta;
     987 if(lp_>0) cout<<"......H*beta = "<<dpsd<<" (km/s)/Mpc"<<endl;
     988
    953989 check_array_alloc();
    954990
     
    10191055
    10201056//-------------------------------------------------------------------
    1021 void GeneFluct3D::ApplyVelLosGrowthFactor(int type_evol)
     1057void GeneFluct3D::ApplyVelLosGrowthFactor(int type_evol,int type_beta,double fixed_beta)
    10221058// Apply Growth(z) to transverse velocity real space cube
    1023 {
    1024  if(lp_>0) cout<<"--- ApplyVelLosGrowthFactor: evol="<<type_evol<<endl;
     1059// P(k)_z = P(k) * ( 1 + beta * mu^2 )^2
     1060// type_beta: =0 compute factor automatically with beta=-(1+z)/D*dD/z
     1061//            >0 compute factor with fix beta=Omega^fixed_beta
     1062//            <0 compute factor with fix beta=fixed_beta
     1063{
     1064 if(lp_>0) cout<<"--- ApplyVelLosGrowthFactor: evol="<<type_evol<<", type_beta="<<type_beta<<endl;
     1065
    10251066 check_array_alloc();
    10261067
     
    10361077 double zpk = compute_pk_redsh_ref_;
    10371078 double grw_orig = (*growth_)(zpk);
    1038  double dpsd_orig = - cosmo_->H(zpk) * (1.+zpk) * growth_->DsDz(zpk,good_dzinc_) / grw_orig;
    1039  if(lp_>0) cout<<"    original growth="<<grw_orig<<" dpsd="<<dpsd_orig<<" computed at z="<<zpk<<endl;
     1079 double beta_orig = 0.;
     1080 if(type_beta>0) {double omegam = cosmo_->Omatter(zpk); beta_orig = pow(omegam,fixed_beta);}
     1081 else if(type_beta<0) beta_orig = fixed_beta;
     1082 else beta_orig = -(1.+zpk) * growth_->DsDz(zpk,good_dzinc_) / (*growth_)(zpk);
     1083 double dpsd_orig = cosmo_->H(zpk) * beta_orig;
     1084 if(lp_>0) cout<<"...original at z="<<zpk<<": growth="<<grw_orig<<" beta="<<beta_orig
     1085               <<" H*beta="<<dpsd_orig<<" (km/s)/Mpc"<<endl;
     1086
     1087 if(type_beta<0) cout<<"***WARNING: type_beta<0 , no evolution used for beta !!!"<<endl;
    10401088
    10411089 InterpFunc interpinv(loscom2zred_min_,loscom2zred_max_,loscom2zred_);
     
    10521100       double z = interpinv(dz);   // interpolation par morceau
    10531101       double grw = (*growth_)(z);
    1054        double dpsd = interdpd(z);
     1102       double dpsd = 0;
     1103       if(type_beta>0) {
     1104         dpsd = cosmo_->H(z) * pow(cosmo_->Omatter(z),fixed_beta);
     1105       } else if(type_beta<0) {
     1106         dpsd = cosmo_->H(z) * fixed_beta;
     1107       } else {
     1108         dpsd = interdpd(z); // interpole -H(z)*(1+z)*D'(z)/D(z)
     1109       }
    10551110       int_8 ip = IndexR(i,j,l);
    10561111       // on remet le beta au bon z
  • trunk/Cosmo/SimLSS/genefluct3d.h

    r3805 r3924  
    118118  void ComputeFourier(PkSpectrum& pk_at_z);
    119119  void FilterByPixel(void);
    120   void ToRedshiftSpace(void);
    121   void ToVelLoS(void);
     120  void ToRedshiftSpace(int type_beta=0,double fixed_beta=0.);
     121  void ToVelLoS(int type_beta=0,double fixed_beta=0.);
    122122
    123123  void ComputeReal(void);
    124124  void ApplyGrowthFactor(int type_evol=1);
    125125  void ApplyRedshiftSpaceGrowthFactor(void);
    126   void ApplyVelLosGrowthFactor(int type_evol=1);
     126  void ApplyVelLosGrowthFactor(int type_evol=1,int type_beta=0,double fixed_beta=0.);
    127127
    128128  void ReComputeFourier(void);
Note: See TracChangeset for help on using the changeset viewer.