Changeset 3924 in Sophya for trunk/Cosmo
- Timestamp:
- Dec 10, 2010, 4:38:23 PM (15 years ago)
- Location:
- trunk/Cosmo/SimLSS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvginit3d.cc
r3908 r3924 27 27 { 28 28 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 30 42 <<" -G typevol: compute Pk(z=0) and apply growth factor in real space"<<endl 31 43 <<" typevol=1 evolved with distance / observateur (def)"<<endl 32 44 <<" typevol=2 evolved with distance to middle of Z planes"<<endl 33 45 <<" 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 35 51 <<" -K : modify spectrum with Kaiser redshift distortion (default=no)"<<endl 36 <<" - x nx,dx : size along x axis (npix,Mpc)"<<endl37 <<" -y ny,dy : size along y axis (npix,Mpc)"<<endl38 <<" if ny or dy <=0 take same value as for x"<<endl39 <<" - z nz,dz : size along z axis (redshift axis, npix,Mpc)"<<endl40 <<" - Z zref : redshift for the center of the simulation cube"<<endl41 <<" -f cambspec.dat,h100tab,ztab : use CAMB file (def: Eisenstein spectrum)"<<endl52 <<" -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 42 58 <<" -1 : compute 1D spectrum (default: no)"<<endl 43 59 <<" -2 : compute 2D spectrum (default: no)"<<endl 44 60 <<" -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"<<endl46 <<" (default sigmaR=1, R=8/h100 Mpc)"<<endl47 <<" -v temp_file.ppf: generate los velocity cube"<<endl48 <<" temporary save cube in temp_file.ppf"<<endl49 61 <<" -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 50 65 <<" -O a,b : tell what you want to write"<<endl 51 66 <<" a : write generated fourier cube (_k0)"<<endl … … 53 68 <<" a,b= 0 no write, 1 ppf write, 2 fits write, 3 ppf+fits write"<<endl 54 69 <<" -S : write cube slices in PPF format"<<endl 55 <<" -o out_base_name : base string for output file name (def: cmvginit3d)"<<endl56 <<" -V : compute variance from real space (for check, default: no)"<<endl57 <<" -T nth : nombre de threads (si compil multi-thread, default: 0)"<<endl58 70 <<endl; 59 71 } … … 93 105 unsigned short nthread=0; 94 106 int filter_by_pixel = 1; 95 bool kaiser_modify = false; 96 97 // *** What to do 107 108 // *** traitement des distorsions de redshift 98 109 bool comptransveloc = false; 99 110 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 100 116 // compute: 1=1D spectra, 2=2D spectra, 101 117 // 4=recompute spectra after real space generation … … 122 138 // --- Decodage des arguments 123 139 char c; 124 while((c = getopt(narg,arg,"haG:F:K x: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) { 125 141 int nth = 0; 126 142 switch (c) { … … 135 151 break; 136 152 case 'K' : 137 kaiser_modify = true; 153 kaiser_modify = true; 154 break; 155 case 'B' : 156 sscanf(optarg,"%d,%lf",&type_beta,&fixed_beta); 138 157 break; 139 158 case 'x' : … … 206 225 if(kaiser_modify) cout<<"Modify spectrum with Kaiser redshift distorted formula"<<endl; 207 226 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; 208 230 if(cambfread.size()>0) cout<<"use CAMB file: cambfread="<<cambfread<<endl; 209 231 cout<<"R="<<R<<" Rg="<<Rg<<" Mpc, sigmaR="<<sigmaR<<endl; … … 414 436 if(kaiser_modify) { 415 437 cout<<"\n--- Modify spectrum coeff with Kaiser redshift distorted formula"<<endl; 416 fluct3d.ToRedshiftSpace( );438 fluct3d.ToRedshiftSpace(type_beta,fixed_beta); 417 439 spec_is_modified = true; 418 440 PrtTim(">>>> End Computing Modify spectrum coeff with Kaiser"); … … 571 593 //----------------------------------------------------------------- 572 594 cout<<"\n--- Modifying cube for Transverse velocity"<<endl; 573 fluct3d.ToVelLoS( );595 fluct3d.ToVelLoS(type_beta,fixed_beta); 574 596 fluct3d.NTupleCheck(posobs,string("ntpvgenf"),ntnent); 575 597 PrtTim(">>>> End Modifying cube for Transverse velocity"); … … 614 636 cout<<"\n--- Apply Growth factor for transverse velocity"<<endl; 615 637 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); 617 639 fluct3d.MinMax(vdum1,vdum2); 618 640 fluct3d.MeanSigma2(vdum1,vdum2); … … 637 659 } 638 660 639 } 661 } //// Fin de Transverse velocity space computation 640 662 641 663 //----------------------------------------------------------------- -
trunk/Cosmo/SimLSS/genefluct3d.cc
r3908 r3924 904 904 905 905 //------------------------------------------------------------------- 906 void GeneFluct3D::ToRedshiftSpace( void)906 void GeneFluct3D::ToRedshiftSpace(int type_beta,double fixed_beta) 907 907 // 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 909 916 { 910 917 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 914 932 check_array_alloc(); 915 933 … … 929 947 930 948 //------------------------------------------------------------------- 931 void GeneFluct3D::ToVelLoS( void)949 void GeneFluct3D::ToVelLoS(int type_beta,double fixed_beta) 932 950 /* 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 933 955 ---- Vitesse particuliere 934 956 Un atome au redshift "z" emet a la longueur d'onde "Le" si il est au repos … … 948 970 { 949 971 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 953 989 check_array_alloc(); 954 990 … … 1019 1055 1020 1056 //------------------------------------------------------------------- 1021 void GeneFluct3D::ApplyVelLosGrowthFactor(int type_evol )1057 void GeneFluct3D::ApplyVelLosGrowthFactor(int type_evol,int type_beta,double fixed_beta) 1022 1058 // 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 1025 1066 check_array_alloc(); 1026 1067 … … 1036 1077 double zpk = compute_pk_redsh_ref_; 1037 1078 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; 1040 1088 1041 1089 InterpFunc interpinv(loscom2zred_min_,loscom2zred_max_,loscom2zred_); … … 1052 1100 double z = interpinv(dz); // interpolation par morceau 1053 1101 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 } 1055 1110 int_8 ip = IndexR(i,j,l); 1056 1111 // on remet le beta au bon z -
trunk/Cosmo/SimLSS/genefluct3d.h
r3805 r3924 118 118 void ComputeFourier(PkSpectrum& pk_at_z); 119 119 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.); 122 122 123 123 void ComputeReal(void); 124 124 void ApplyGrowthFactor(int type_evol=1); 125 125 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.); 127 127 128 128 void ReComputeFourier(void);
Note:
See TracChangeset
for help on using the changeset viewer.