Changeset 3800 in Sophya for trunk/Cosmo/SimLSS
- Timestamp:
- Jul 19, 2010, 5:05:40 PM (15 years ago)
- Location:
- trunk/Cosmo/SimLSS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvginit3d.cc
r3782 r3800 572 572 cout<<"\n--- Apply Growth factor"<<endl; 573 573 cout<<"...D(z=0)="<<growth(0.)<<" D(z="<<zref<<")="<<growth(zref)<<endl; 574 fluct3d.Apply DerGrowthFactor(use_growth_factor);574 fluct3d.ApplyVelLosGrowthFactor(use_growth_factor); 575 575 fluct3d.MinMax(rmin,rmax); 576 576 cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl; -
trunk/Cosmo/SimLSS/cmvrvloscor.cc
r3799 r3800 107 107 long nmax = max(Nx,max(Ny,Nz)); 108 108 cout<<"dmin="<<dmin<<" nmax="<<nmax<<endl; 109 Histo hmpc(-dmin*nmax ,dmin*nmax,4*nmax);109 Histo hmpc(-dmin*nmax/10.,dmin*nmax/10.,nmax); 110 110 111 111 POutPersist pos(fnppf.c_str()); … … 167 167 for(int i=0;i<Nx;i++) { 168 168 if(i%(Nx/10)==0) cout<<" i="<<i<<endl; 169 TMatrix<r_4> M2d, M2d c;169 TMatrix<r_4> M2d, M2dv, M2dc; 170 170 if(do2d && (i==0 || i==Nx/2 || i==Nx-1)) { 171 171 M2d.ReSize(Ny,Nz); M2d = 0.; 172 M2dv.ReSize(Ny,Nz); M2dv = 0.; 172 173 M2dc.ReSize(Ny,Nz); M2dc = 0.; 173 174 } … … 199 200 // On remplit eventuellement les matrices 2D 200 201 if(do2d && M2d.Size()>0) 201 for(int l=0;l<Nz;l++) {M2d(j,l) = R(l); M2d c(j,l) = Rdis(l);}202 for(int l=0;l<Nz;l++) {M2d(j,l) = R(l); M2dv(j,l) = V(l); M2dc(j,l) = Rdis(l);} 202 203 // On remplit le cube avec le champ R redshift distordu 203 204 if(fluct3d) for(int l=0;l<Nz;l++) (*rgen)(l,j,i) += Rdis(l); … … 240 241 sprintf(str,"mx_%d",i); 241 242 pos.PutObject(M2d,str); 243 sprintf(str,"mxv_%d",i); 244 pos.PutObject(M2dv,str); 242 245 sprintf(str,"mxc_%d",i); 243 246 pos.PutObject(M2dc,str); -
trunk/Cosmo/SimLSS/genefluct3d.cc
r3799 r3800 904 904 905 905 //------------------------------------------------------------------- 906 void GeneFluct3D::ToRedshiftSpace(void) 907 // Apply redshift distortion corrections 908 // ---- ATTENTION: Le spectre Pk doit etre (dRho/Rho)(k) 909 { 910 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 <<" (km/s)/Mpc (comp. for dz="<<good_dzinc_<<")"<<endl; 914 check_array_alloc(); 915 916 for(long i=0;i<Nx_;i++) { 917 double kx = Kx(i); 918 for(long j=0;j<Ny_;j++) { 919 double ky = Ky(j); 920 double kt2 = kx*kx + ky*ky; 921 for(long l=0;l<NCz_;l++) { 922 double kz = Kz(l); 923 if(l==0) continue; 924 T_(l,j,i) *= (1. + beta*kz*kz/(kt2 + kz*kz)); 925 } 926 } 927 } 928 } 929 930 //------------------------------------------------------------------- 906 931 void GeneFluct3D::ToVelLoS(void) 907 // Le spectre Pk doit etre (dRho/Rho)(k) 932 /* 933 ---- Vitesse particuliere 934 Un atome au redshift "z" emet a la longueur d'onde "Le" si il est au repos 935 Il a une vitesse (particuliere) "V" dans le referentiel comobile au redshift "z" 936 Dans le referentiel comobile au redshift "z", il emet a la longueur d'onde "Le*(1+V/C)" 937 L'observateur voit donc une longueur d'onde "Le*(1+V/C)*(1+z) = Le*[1+z+V/C*(1+z)]" 938 et croit que l'atome est au redshift "z' = z + V/C*(1+z)" 939 L'observateur observe donc une vitesse particuliere (1+z)*V/c 940 --> vitesse particuliere dans le repere comobile en z: V/C 941 vitesse particuliere dans le repere comobile de l'observateur: (1+z)*V/C 942 ---- ATTENTION: Le spectre Pk doit etre (dRho/Rho)(k) 943 ---- On genere la vitesse particuliere (dans le referentiel comobile au redshift "z") 944 Vlos(k) = i*Beta(z)*k(los)/k^2*(dRho/Rho)(k) 945 .avec Beta(z) = dln(D)/da = -(1+z)/D*dD/dz 946 .on convertit en vitesse en faisant Vlos(k)/H(z) 947 */ 908 948 { 909 949 double zpk = compute_pk_redsh_ref_; … … 931 971 //------------------------------------------------------------------- 932 972 void GeneFluct3D::ApplyGrowthFactor(int type_evol) 933 // Apply Growth to real space 973 // Apply Growth to real space d(Rho)/Rho cube 934 974 // Using the correspondance between redshift and los comoving distance 935 975 // describe in vector "zred_" "loscom_" … … 971 1011 972 1012 //------------------------------------------------------------------- 973 void GeneFluct3D::ApplyDerGrowthFactor(int type_evol) 974 // Apply Conformal derivative of Growth to real space for transverse velocity cube 975 { 976 if(lp_>0) cout<<"--- ApplyDerGrowthFactor: evol="<<type_evol<<endl; 1013 void GeneFluct3D::ApplyRedshiftSpaceGrowthFactor(void) 1014 // Apply Growth(z) to redshift-distorted real space cube 1015 { 1016 const char *bla = "GeneFluct3D::ApplyRedshiftSpaceGrowthFactor_Error: redshift evolution impossible because factor depen on k"; 1017 cout<<bla<<endl; throw ParmError(bla); 1018 } 1019 1020 //------------------------------------------------------------------- 1021 void GeneFluct3D::ApplyVelLosGrowthFactor(int type_evol) 1022 // Apply Growth(z) to transverse velocity real space cube 1023 { 1024 if(lp_>0) cout<<"--- ApplyVelLosGrowthFactor: evol="<<type_evol<<endl; 977 1025 check_array_alloc(); 978 1026 979 1027 if(growth_ == NULL) { 980 const char *bla = "GeneFluct3D::Apply GrowthFactor_Error: set GrowthFactor first";1028 const char *bla = "GeneFluct3D::ApplyVelLosGrowthFactor_Error: set GrowthFactor first"; 981 1029 cout<<bla<<endl; throw ParmError(bla); 982 1030 } 983 1031 if(type_evol<1 || type_evol>2) { 984 const char *bla = "GeneFluct3D::Apply GrowthFactor_Error: bad type_evol value";1032 const char *bla = "GeneFluct3D::ApplyVelLosGrowthFactor_Error: bad type_evol value"; 985 1033 cout<<bla<<endl; throw ParmError(bla); 986 1034 } -
trunk/Cosmo/SimLSS/genefluct3d.h
r3781 r3800 118 118 void ComputeFourier(PkSpectrumZ& pk_at_z); 119 119 void FilterByPixel(void); 120 void ToRedshiftSpace(void); 120 121 void ToVelLoS(void); 121 122 122 123 void ComputeReal(void); 123 124 void ApplyGrowthFactor(int type_evol=1); 124 void ApplyDerGrowthFactor(int type_evol=1); 125 void ApplyRedshiftSpaceGrowthFactor(void); 126 void ApplyVelLosGrowthFactor(int type_evol=1); 125 127 126 128 void ReComputeFourier(void);
Note:
See TracChangeset
for help on using the changeset viewer.