Changeset 3120 in Sophya for trunk/Cosmo/SimLSS/cmvtstpk.cc


Ignore:
Timestamp:
Dec 21, 2006, 4:45:09 PM (19 years ago)
Author:
cmv
Message:

Suite de la mise dans la base cvs cmv 21/12/2006

File:
1 edited

Legend:

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

    r3115 r3120  
    1919void usage(void);
    2020void usage(void) {
    21  cout<<"cmvtstpk -k npt,lkmin,lkmax -s scale zval"<<endl
     21 cout<<"cmvtstpk [options] z_redshift"<<endl
     22     <<" -H h100 -B Ob0 -M Om0 -L Ol0,w0"<<endl
    2223     <<" -k npt,lkmin,lkmax : les valeurs sont en log10"<<endl
    2324     <<" -s scale : on multiplie pkz par scale"<<endl;
     
    2627int main(int narg,char *arg[])
    2728{
    28  double ob0 = 0.0444356;
     29 double Ob0 = 0.0444356;
    2930 // -- WMAP
    30  double h100=0.71, om0=0.267804, or0=7.9e-05, ol0=0.73,w0=-1.;
     31 double h100=0.71, Om0=0.267804, Ol0=0.73,w0=-1.;
    3132 // -- ouvert matter only
    32  //double h100=0.71, om0=0.3, or0=0., ol0=0.,w0=-1.;
     33 //double h100=0.71, Om0=0.3, Ol0=0.,w0=-1.;
    3334 // -- plat matter only
    34  //double h100=0.71, om0=1., or0=0., ol0=0.,w0=-1.;
     35 //double h100=0.71, Om0=1., Ol0=0.,w0=-1.;
     36
    3537
    3638 double ns = 1., as = 1.;
    3739
    38  int npt = 1000;
    39  double lkmin = -4., lkmax=2.;
     40 int npt = 10000;
     41 double lkmin = -3., lkmax=2.;
    4042 double scale = 1.;
    4143
    4244 char c;
    43   while((c = getopt(narg,arg,"hk:s:")) != -1) {
     45  while((c = getopt(narg,arg,"hk:s:H:M:B:L:")) != -1) {
    4446  switch (c) {
     47  case 'H' :
     48    sscanf(optarg,"%lf",&h100);
     49    break;
     50  case 'M' :
     51    sscanf(optarg,"%lf",&Om0);
     52    break;
     53  case 'B' :
     54    sscanf(optarg,"%lf",&Ob0);
     55    break;
     56  case 'L' :
     57    sscanf(optarg,"%lf,%lf",&Ol0,&w0);
     58    break;
    4559  case 'k' :
    4660    sscanf(optarg,"%d,%lf,%lf",&npt,&lkmin,&lkmax);
     
    6276 if(optind<narg) zval = atof(arg[optind]);
    6377
     78 cout<<"h100="<<h100<<" Om0="<<Om0<<" Ob0="<<Ob0<<" Ol0="<<Ol0<<" w0="<<w0<<endl;
    6479 cout<<"lkmin="<<lkmin<<" lkmax="<<lkmax<<" npt="<<npt<<" dlk="<<dlk<<endl;
    6580 cout<<"scale="<<scale<<endl;
     
    6984 InitialSpectrum pkini(ns,as);
    7085
    71  TransfertEisenstein tf(h100,om0-ob0,ob0,T_CMB_Par,false);
     86 TransfertEisenstein tf(h100,Om0-Ob0,Ob0,T_CMB_Par,false);
    7287 cout<<"kpeak="<<tf.KPeak()<<endl;
    7388 TransfertEisenstein tfnosc2(tf); tfnosc2.SetNoOscEnv(2);
    7489 TransfertEisenstein tfnosc1(tf); tfnosc1.SetNoOscEnv(1);
    75  TransfertEisenstein tfnob(h100,om0,0.,T_CMB_Par,true);
    76 
    77  GrowthFactor d1(om0,ol0);
     90 TransfertEisenstein tfnob(h100,Om0,0.,T_CMB_Par,true);
     91
     92 GrowthFactor d1(Om0,Ol0);
    7893 cout<<"GrowthFactor: "<<d1(zval)<<endl;
    7994
     
    89104
    90105 //--------------------------
    91  Histo hd1(0.,1000.,10000); hd1.ReCenterBin();
     106 Histo hd1(0.,20.,10000); hd1.ReCenterBin();
    92107 FuncToHisto(d1,hd1,false);
    93108
     
    99114 FunRan talea(hpkz,true);
    100115 Histo halea(hpkz); halea.Zero();
    101  int nalea = 1000000;
     116 int nalea = 100000;
    102117 for(int i=0;i<nalea;i++) halea.Add(talea.Random());
    103118 halea *= hpkz.Sum()/halea.Sum();
     
    169184#### growth-factor
    170185zone
    171 n/plot hd1.log10(val)%log10(x) val>0.&&x>0. ! "nsta connectpoints"
     186n/plot hd1.val%x ! ! "nsta connectpoints"
    172187
    173188#### Spectre initial
    174189zone
    175 n/plot nt.log10(pkini)%log10(k) pkini>0. ! "nsta crossmarker3"
     190n/plot nt.log10(pkini)%log10(k) pkini>0. ! "nsta connectpoints"
     191
     192#### Gestion des abscisses
     193set xk log10(k)
     194set xk k
    176195
    177196#### fct de transfert
    178197zone
    179 n/plot nt.tf%log10(k) ! ! "nsta connectpoints"
    180 n/plot nt.tfnosc2%log10(k) ! ! "nsta connectpoints same red"
    181 n/plot nt.tfnosc1%log10(k) ! ! "nsta connectpoints same blue"
    182 n/plot nt.tfnob%log10(k) ! ! "nsta connectpoints same green"
    183 
    184 n/plot nt.tf/tfnosc2%log10(k) ! ! "nsta connectpoints red"
    185 n/plot nt.tf/tfnosc1%log10(k) ! ! "nsta connectpoints same blue"
    186 n/plot nt.tf/tfnob%log10(k) ! ! "nsta connectpoints same red"
     198n/plot nt.tf%$xk ! ! "nsta connectpoints"
     199n/plot nt.tfnosc2%$xk ! ! "nsta connectpoints same red"
     200n/plot nt.tfnosc1%$xk ! ! "nsta connectpoints same blue"
     201n/plot nt.tfnob%$xk ! ! "nsta connectpoints same green"
     202
     203n/plot nt.tf/tfnosc2%$xk ! ! "nsta connectpoints red"
     204n/plot nt.tf/tfnosc1%$xk ! ! "nsta connectpoints same blue"
     205n/plot nt.tf/tfnob%$xk ! ! "nsta connectpoints same green"
    187206addline -10 1 10 1
    188207
    189208#### Spectre a z=0
    190209zone
    191 n/plot nt.pk0%log10(k) ! ! "nsta connectpoints"
    192 n/plot nt.pk0nosc2%log10(k) ! ! "nsta connectpoints same red"
    193 n/plot nt.pk0nosc1%log10(k) ! ! "nsta connectpoints same blue"
    194 n/plot nt.pk0nob%log10(k) ! ! "nsta connectpoints same green"
     210n/plot nt.pk0%$xk ! ! "nsta connectpoints"
     211n/plot nt.pk0nosc2%$xk ! ! "nsta connectpoints same red"
     212n/plot nt.pk0nosc1%$xk ! ! "nsta connectpoints same blue"
     213n/plot nt.pk0nob%$xk ! ! "nsta connectpoints same green"
    195214
    196215# Check
    197216zone 2 2
    198 n/plot nt.pk0/pkini-tf*tf%log10(k) pkini>0 ! "nsta crossmarker3"
    199 n/plot nt.pk0nosc2/pkini-tfnosc2*tfnosc2%log10(k) pkini>0 ! "nsta crossmarker3"
    200 n/plot nt.pk0nosc1/pkini-tfnosc1*tfnosc1%log10(k) pkini>0 ! "nsta crossmarker3"
    201 n/plot nt.pk0nob/pkini-tfnob*tfnob%log10(k) pkini>0 ! "nsta crossmarker3"
     217n/plot nt.pk0/pkini-tf*tf%$xk pkini>0 ! "nsta crossmarker3"
     218n/plot nt.pk0nosc2/pkini-tfnosc2*tfnosc2%$xk pkini>0 ! "nsta crossmarker3"
     219n/plot nt.pk0nosc1/pkini-tfnosc1*tfnosc1%$xk pkini>0 ! "nsta crossmarker3"
     220n/plot nt.pk0nob/pkini-tfnob*tfnob%$xk pkini>0 ! "nsta crossmarker3"
    202221
    203222#### Spectre a z
    204223zone
    205 n/plot nt.pk%log10(k) ! ! "nsta connectpoints"
    206 n/plot nt.pknosc2%log10(k) ! ! "nsta connectpoints same red"
    207 n/plot nt.pknosc1%log10(k) ! ! "nsta connectpoints same blue"
    208 n/plot nt.pknob%log10(k) ! ! "nsta connectpoints same green"
    209 
    210 n/plot nt.pk/pknosc2%log10(k) ! ! "nsta connectpoints red"
    211 n/plot nt.pk/pknosc1%log10(k) ! ! "nsta connectpoints same blue"
    212 n/plot nt.pk/pknob%log10(k) ! ! "nsta connectpoints same green"
     224n/plot nt.pk%$xk ! ! "nsta connectpoints"
     225n/plot nt.pknosc2%$xk ! ! "nsta connectpoints same red"
     226n/plot nt.pknosc1%$xk ! ! "nsta connectpoints same blue"
     227n/plot nt.pknob%$xk ! ! "nsta connectpoints same green"
     228
     229n/plot nt.pk/pknosc2%$xk ! ! "nsta connectpoints red"
     230n/plot nt.pk/pknosc1%$xk ! ! "nsta connectpoints same blue"
     231n/plot nt.pk/pknob%$xk ! ! "nsta connectpoints same green"
    213232addline -10 1 10 1
    214233
    215234#### Le spectre version Delta^2
    216235set D2 k*k*k*pk/(2*M_PI*M_PI)
    217 n/plot nt.$D2%log10(k)  !  ! "nsta crossmarker3 connectpoints"
     236n/plot nt.$D2%$xk  !  ! "nsta crossmarker3 connectpoints"
    218237
    219238#### Test des transferts dans Histo et TVector
Note: See TracChangeset for help on using the changeset viewer.