Changeset 3805 in Sophya for trunk/Cosmo/SimLSS/cmvtstpk.cc
- Timestamp:
- Jul 24, 2010, 12:01:34 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvtstpk.cc
r3679 r3805 19 19 void usage(void); 20 20 void usage(void) { 21 cout<<"cmvtstpk [options] z_redshift"<<endl 22 <<" -H h100 -B Ob0 -M Om0 -L Ol0,w0"<<endl 23 <<" -k npt,lkmin,lkmax : les valeurs sont en log10"<<endl 24 <<" -s scale : on normalise le spectre avec scale"<<endl 25 <<" -w : write spectra on ASCII file"<<endl; 21 cout 22 <<"cmvtstpk [options] z_redshift"<<endl 23 <<" -H h100 -B Ob0 -M Om0 -L Ol0,w0"<<endl 24 <<" -k npt,lkmin,lkmax : les valeurs sont en log10"<<endl 25 <<" -s scale : on normalise le spectre avec scale"<<endl 26 <<" -w : write spectra on ASCII file"<<endl 27 <<" -F filename : read also CAMB file"<<endl; 26 28 } 27 29 … … 36 38 double scale = 2.54499e+07; // normalisation du spectre a z=0 selon SDSS 37 39 bool wrascii = false; 40 string fcmbfile = ""; 38 41 39 42 char c; 40 while((c = getopt(narg,arg,"hwk:s:H:M:B:L: ")) != -1) {43 while((c = getopt(narg,arg,"hwk:s:H:M:B:L:F:")) != -1) { 41 44 switch (c) { 42 45 case 'H' : … … 63 66 wrascii = true; 64 67 break; 68 case 'F' : 69 fcmbfile = optarg; 70 break; 65 71 case 'h' : 66 72 default : … … 78 84 cout<<"scale="<<scale<<endl; 79 85 cout<<"zval="<<zval<<endl; 80 81 //-------------------------- 82 InitialSpectrum pkini(ns,as); 86 cout<<"fcmbfile="<<fcmbfile<<endl; 87 88 //-------------------------- 89 InitialPowerLaw pkini(ns,as); 83 90 pkini.SetNorm(scale); 84 91 … … 89 96 TransfertEisenstein tfnob(h100,Om0,0.,T_CMB_Par,true); 90 97 91 Growth Factord1(Om0,Ol0);98 GrowthEisenstein d1(Om0,Ol0); 92 99 cout<<"GrowthFactor: "<<d1(zval)<<endl; 93 100 94 PkSpectrum0 pk0(pkini,tf); 95 PkSpectrum0 pk0nosc2(pkini,tfnosc2); 96 PkSpectrum0 pk0nosc1(pkini,tfnosc1); 97 PkSpectrum0 pk0nob(pkini,tfnob); 98 99 PkSpectrumZ pkz(pk0,d1,zval); 100 PkSpectrumZ pkznosc2(pk0nosc2,d1,zval); 101 PkSpectrumZ pkznosc1(pk0nosc1,d1,zval); 102 PkSpectrumZ pkznob(pk0nob,d1,zval); 101 PkSpecCalc pk0(pkini,tf,d1,0.); 102 PkSpecCalc pk0nosc2(pkini,tfnosc2,d1,0.); 103 PkSpecCalc pk0nosc1(pkini,tfnosc1,d1,0.); 104 PkSpecCalc pk0nob(pkini,tfnob,d1,0.); 105 106 PkSpecCalc pkz(pkini,tf,d1,zval); 107 PkSpecCalc pkznosc2(pkini,tfnosc2,d1,zval); 108 PkSpecCalc pkznosc1(pkini,tfnosc1,d1,zval); 109 PkSpecCalc pkznob(pkini,tfnob,d1,zval); 110 111 PkTabulate* pkcamb = NULL; 112 if(fcmbfile.size()>0) { 113 cout<<endl<<"PkTabulate for CAMB"<<endl; 114 pkcamb = new PkTabulate; 115 pkcamb->ReadCAMB(fcmbfile,h100,0.); 116 pkcamb->SetInterpTyp(1); 117 if(pkcamb->NPoints()==0) {delete pkcamb; pkcamb = NULL;} 118 } 103 119 104 120 //-------------------------- … … 118 134 119 135 //-------------------------- 120 const int n = 1 4;136 const int n = 15; 121 137 const char *vname[n] = { 122 138 "k","pkini", … … 124 140 "tfnosc2","pk0nosc2","pknosc2", 125 141 "tfnosc1","pk0nosc1","pknosc1", 126 "tfnob","pk0nob","pknob" 142 "tfnob","pk0nob","pknob","pktab" 127 143 }; 128 144 NTuple nt(n,vname); … … 145 161 xnt[12] = pk0nob(k); 146 162 xnt[13] = pkznob(k,zval); 163 if(pkcamb != NULL) xnt[14] = (*pkcamb)(k); else xnt[14] = 0; 147 164 nt.Fill(xnt); 148 165 } 166 167 if(pkcamb != NULL) {delete pkcamb; pkcamb = NULL;} 149 168 150 169 //-------------------------- … … 190 209 n/plot nt.log10(pkini)%log10(k) pkini>0.&&k>0. ! "nsta connectpoints" 191 210 192 #### Gestion des abscisses193 set xk log10(k)194 set xk k195 196 211 #### fct de transfert 197 212 zone 198 n/plot nt.tf% $xk ! ! "nsta connectpoints"199 n/plot nt.tfnosc2% $xk ! ! "nsta connectpoints same red"200 n/plot nt.tfnosc1% $xk ! ! "nsta connectpoints same blue"201 n/plot nt.tfnob% $xk ! ! "nsta connectpoints same green"202 203 n/plot nt.tf/tfnosc2% $xk ! ! "nsta connectpoints red"204 n/plot nt.tf/tfnosc1% $xk ! ! "nsta connectpoints same blue"205 n/plot nt.tf/tfnob% $xk ! ! "nsta connectpoints same green"213 n/plot nt.tf%k k>0&&tf>0 ! "nsta connectpoints logx logy" 214 n/plot nt.tfnosc2%k k>0&&tfnosc2>0 ! "nsta connectpoints same red logx logy" 215 n/plot nt.tfnosc1%k k>0&&tfnosc1>0 ! "nsta connectpoints same blue logx logy" 216 n/plot nt.tfnob%k k>0&&tfnob>0 ! "nsta connectpoints same green logx logy" 217 218 n/plot nt.tf/tfnosc2%k k>0&&tfnosc2>0 ! "nsta connectpoints red logx" 219 n/plot nt.tf/tfnosc1%k k>0&&tfnosc1>0 ! "nsta connectpoints same blue logx" 220 n/plot nt.tf/tfnob%k k>0&&tfnob>0 ! "nsta connectpoints same green logx" 206 221 addline -10 1 10 1 207 222 208 223 #### Spectre a z=0 209 224 zone 210 n/plot nt.pk0% $xk ! ! "nsta connectpoints"211 n/plot nt.pk0nosc2% $xk ! ! "nsta connectpoints same red"212 n/plot nt.pk0nosc1% $xk ! ! "nsta connectpoints same blue"213 n/plot nt.pk0nob% $xk ! ! "nsta connectpoints same green"225 n/plot nt.pk0%k k>0&&pk0>0 ! "nsta connectpoints logx logy" 226 n/plot nt.pk0nosc2%k k>0&&pk0nosc2>0 ! "nsta connectpoints same red logx logy" 227 n/plot nt.pk0nosc1%k k>0&&pk0nosc1>0 ! "nsta connectpoints same blue logx logy" 228 n/plot nt.pk0nob%k k>0&&pk0nob>0 ! "nsta connectpoints same green logx logy" 214 229 215 230 # Check 216 231 zone 2 2 217 n/plot nt.pk0/pkini-tf*tf% $xk pkini>0 ! "nsta crossmarker3"218 n/plot nt.pk0nosc2/pkini-tfnosc2*tfnosc2% $xk pkini>0 ! "nsta crossmarker3"219 n/plot nt.pk0nosc1/pkini-tfnosc1*tfnosc1% $xk pkini>0 ! "nsta crossmarker3"220 n/plot nt.pk0nob/pkini-tfnob*tfnob% $xk pkini>0 ! "nsta crossmarker3"232 n/plot nt.pk0/pkini-tf*tf%k k>0&&pkini>0 ! "nsta crossmarker3 logx" 233 n/plot nt.pk0nosc2/pkini-tfnosc2*tfnosc2%k k>0&&pkini>0 ! "nsta crossmarker3 logx" 234 n/plot nt.pk0nosc1/pkini-tfnosc1*tfnosc1%k k>0&&pkini>0 ! "nsta crossmarker3 logx" 235 n/plot nt.pk0nob/pkini-tfnob*tfnob%k k>0&&pkini>0 ! "nsta crossmarker3 logx" 221 236 222 237 #### Spectre a z 223 238 zone 224 n/plot nt.pk% $xk ! ! "nsta connectpoints"225 n/plot nt.pknosc2% $xk ! ! "nsta connectpoints same red"226 n/plot nt.pknosc1% $xk ! ! "nsta connectpoints same blue"227 n/plot nt.pknob% $xk ! ! "nsta connectpoints same green"228 229 n/plot nt.pk/pknosc2% $xk ! ! "nsta connectpoints red"230 n/plot nt.pk/pknosc1% $xk ! ! "nsta connectpoints same blue"231 n/plot nt.pk/pknob% $xk ! ! "nsta connectpoints same green"239 n/plot nt.pk%k k>0&&pk>0 ! "nsta connectpoints logx logy" 240 n/plot nt.pknosc2%k k>0&&pknosc2>0 ! "nsta connectpoints same red logx logy" 241 n/plot nt.pknosc1%k k>0&&pknosc1>0 ! "nsta connectpoints same blue logx logy" 242 n/plot nt.pknob%k k>0&&pknob>0 ! "nsta connectpoints same green logx logy" 243 244 n/plot nt.pk/pknosc2%k k>0&&pknosc2>0 ! "nsta connectpoints red logx" 245 n/plot nt.pk/pknosc1%k k>0&&pknosc1>0 ! "nsta connectpoints same blue logx" 246 n/plot nt.pk/pknob%k k>0&&pknob>0 ! "nsta connectpoints same green logx" 232 247 addline -10 1 10 1 233 248 234 249 #### Le spectre version Delta^2 235 250 set D2 k*k*k*pk/(2*M_PI*M_PI) 236 n/plot nt.$D2% $xk ! ! "nsta crossmarker3 connectpoints"251 n/plot nt.$D2%k k>0 ! "nsta crossmarker3 connectpoints logx" 237 252 238 253 #### Test des transferts dans Histo et TVector … … 248 263 disp halea "same red" 249 264 265 #### Le spectre tabule 266 n/plot nt.pk%k pk>0&&k>0 ! "nsta connectpoints logx logy" 267 n/plot nt.pktab%k pktab>0&&k>0 ! "nsta connectpoints same red logx logy" 268 269 n/plot nt.(pktab-pk)%k k>0&&pk>0 ! "nsta connectpoints" 270 n/plot nt.(pktab-pk)/pk%k k>0&&pk>0 ! "nsta connectpoints" 271 272 n/plot nt.pk/pknosc2%k k>0&&pknosc2>0 ! "nsta connectpoints logx" 273 n/plot nt.pktab/pknosc2%k k>0&&pknosc2>0 ! "nsta connectpoints same red logx" 274 250 275 */
Note:
See TracChangeset
for help on using the changeset viewer.