Changeset 3318 in Sophya for trunk/Cosmo/SimLSS/cmvtransf.cc
- Timestamp:
- Aug 28, 2007, 11:41:49 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvtransf.cc
r3115 r3318 14 14 15 15 void usage(void); 16 void usage(void) {cout<<"cmvtuniv [k1,k2,npt] [h100,Om0,Ob0,tcmb]"<<endl;} 16 void usage(void) { 17 cout 18 <<"cmvtransf [options]"<<endl 19 <<" -k k1,k2,npt : k range in Mpc^-1"<<endl 20 <<" -U h100,Om0,Ob0,tcmb : cosmology"<<endl 21 <<" -F filename : read also CMBFast file"<<endl 22 <<endl; 23 } 17 24 18 25 int main(int narg,char *arg[]) … … 20 27 double k1 = 1e-6, k2 = 10.; int_4 npt = 100; 21 28 double h100 = 0.71, Om0 = 0.267804, Ob0 = 0.0444356, tcmb = T_CMB_Par; 29 string fcmbfast = ""; 22 30 23 if(narg>1) sscanf(arg[1],"%lf,%lf,%d",&k1,&k2,&npt); 31 char c; 32 while((c = getopt(narg,arg,"hk:U:F:")) != -1) { 33 switch (c) { 34 case 'k' : 35 sscanf(optarg,"%d,%lf,%lf",&npt,&k1,&k2); 36 break; 37 case 'U' : 38 sscanf(optarg,"%lf,%lf,%lf,%lf",&h100,&Om0,&Ob0,&tcmb); 39 break; 40 case 'F' : 41 fcmbfast = optarg; 42 break; 43 case 'h' : 44 default : 45 usage(); return -1; 46 } 47 } 48 24 49 if(k1<=0.) {cout<<"k1 must be >0"<<endl; return -1;} 25 if(npt<=0) npt = 100; 50 if(npt<=0) npt = 1000; 51 if(k2<=k1) {k1=1.e-4; k2=1.e+2;} 26 52 cout<<"k1="<<k1<<" k2="<<k2<<" npt="<<npt<<endl; 27 if(narg>2) sscanf(arg[2],"%lf,%lf,%lf,%lf",&h100,&Om0,&Ob0,&tcmb);28 53 cout<<"h100="<<h100<<" Om0="<<Om0<<" Ob0="<<Ob0<<" Tcmb="<<tcmb<<endl; 54 cout<<"fcmbfast="<<fcmbfast<<endl; 29 55 30 56 cout<<"TransfertEisenstein with baryon"<<endl; … … 43 69 TransfertEisenstein tfnob(h100,Om0-Ob0,Ob0,tcmb,true); // No baryons 44 70 45 const int n = 5; 46 char *vname[n] = {"k","t","tnosc1","tnosc2","tnob"}; 71 TransfertTabulate tfcmbfast(h100,Om0-Ob0,Ob0); 72 bool cmbfastOK = false; 73 if(fcmbfast.size()>0) { 74 cout<<endl<<"TransfertTabulate for CMBfast"<<endl; 75 tfcmbfast.ReadCMBFast(fcmbfast); 76 tfcmbfast.SetInterpTyp(1); 77 if(tfcmbfast.NPoints()>0) cmbfastOK = true; 78 } 79 80 const int n = 6; 81 char *vname[n] = {"k","t","tnosc1","tnosc2","tnob","tcmbf"}; 47 82 NTuple nt(n,vname); 48 83 double xnt[n]; 84 for(int i=0;i<n;i++) xnt[i]=0.; 49 85 50 86 double lnk1 = log10(k1), lnk2=log10(k2), dlnk=(lnk2-lnk1)/npt; … … 56 92 xnt[3] = tfnosc2(k); 57 93 xnt[4] = tfnob(k); 94 if(cmbfastOK) xnt[5] = tfcmbfast(k); 58 95 nt.Fill(xnt); 59 96 } … … 73 110 set k log10(k) 74 111 75 n/plot nt.t%$k ! ! "nsta crossmarker3" 76 n/plot nt.tnob%$k ! ! "nsta red crossmarker3 same" 77 n/plot nt.tnosc1%$k ! ! "nsta blue circlemarker3 same" 78 n/plot nt.tnosc2%$k ! ! "nsta green trianglemarker3 same" 112 # Eisenstein 113 n/plot nt.t%$k ! ! "nsta connectpoints" 114 n/plot nt.tnob%$k ! ! "nsta red same connectpoints" 115 n/plot nt.tnosc2%$k ! ! "nsta blue same connectpoints" 116 n/plot nt.tnosc1%$k ! ! "nsta green same connectpoints" 79 117 80 n/plot nt.t/tnosc1%$k ! ! "nsta crossmarker3" 81 n/plot nt.t/tnosc2%$k ! ! "nsta crossmarker3 red same" 118 n/plot nt.t/tnob%$k tnob>0 ! "nsta red connectpoints" 119 n/plot nt.t/tnosc2%$k tnosc2>0 ! "nsta blue same connectpoints" 120 n/plot nt.t/tnosc1%$k tnosc1>0 ! "nsta green same connectpoints" 121 122 # CMBFast 123 n/plot nt.t%$k ! ! "nsta connectpoints" 124 n/plot nt.tcmbf%$k ! ! "nsta red same connectpoints" 125 126 n/plot nt.(tcmbf-t)%$k tcmbf>0. ! "nsta connectpoints" 127 n/plot nt.(tcmbf-t)/tcmbf%$k tcmbf>0. ! "nsta connectpoints" 82 128 */
Note:
See TracChangeset
for help on using the changeset viewer.