Changeset 3805 in Sophya for trunk/Cosmo/SimLSS/cmvtransf.cc


Ignore:
Timestamp:
Jul 24, 2010, 12:01:34 AM (15 years ago)
Author:
cmv
Message:

Refonte totale de la structure des classes InitialSpectrum, TransfertFunction, GrowthFactor, PkSpectrum et classes tabulate pour lecture des fichiers CAMB, cmv 24/07/2010

File:
1 edited

Legend:

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

    r3802 r3805  
    1717cout
    1818<<"cmvtransf [options]"<<endl
    19 <<"  -k k1,k2,npt : k range in Mpc^-1"<<endl
     19<<"  -k npt,k1,k2 : k range in Mpc^-1"<<endl
    2020<<"  -U h100,Om0,Ob0,tcmb : cosmology"<<endl
    21 <<"  -F filename : read also CMBFast file"<<endl
     21<<"  -F filename : read also CAMB file"<<endl
    2222<<endl;
    2323}
     
    2727 double k1 = 1e-6, k2 = 10.; int_4 npt = 100;
    2828 double h100 = 0.71, Om0 = 0.267804, Ob0 = 0.0444356, tcmb = T_CMB_Par;
    29  string fcmbfast = "";
     29 string fcmbfile = "";
    3030
    3131 char c;
     
    3939    break;
    4040  case 'F' :
    41     fcmbfast = optarg;
     41    fcmbfile = optarg;
    4242    break;
    4343  case 'h' :
     
    5252 cout<<"k1="<<k1<<"  k2="<<k2<<" npt="<<npt<<endl;
    5353 cout<<"h100="<<h100<<" Om0="<<Om0<<" Ob0="<<Ob0<<" Tcmb="<<tcmb<<endl;
    54  cout<<"fcmbfast="<<fcmbfast<<endl;
     54 cout<<"fcmbfile="<<fcmbfile<<endl;
    5555
    5656 cout<<"TransfertEisenstein with baryon"<<endl;
     
    6969 TransfertEisenstein tfnob(h100,Om0-Ob0,Ob0,tcmb,true);  // No baryons
    7070
    71  TransfertTabulate tfcmbfast;
    72  bool cmbfastOK = false;
    73  if(fcmbfast.size()>0) {
    74    cout<<endl<<"TransfertTabulate for CMBfast"<<endl;
    75    tfcmbfast.ReadCMBFast(fcmbfast,h100,Om0-Ob0,Ob0);
    76    tfcmbfast.SetInterpTyp(1);
    77    if(tfcmbfast.NPoints()>0) cmbfastOK = true;
     71 TransfertTabulate tf_cmbfile;
     72 bool cmbfileOK = false;
     73 if(fcmbfile.size()>0) {
     74   cout<<endl<<"TransfertTabulate for CAMB"<<endl;
     75   tf_cmbfile.ReadCAMB(fcmbfile,h100);
     76   tf_cmbfile.SetInterpTyp(1);
     77   if(tf_cmbfile.NPoints()>0) cmbfileOK = true;
    7878 }
    7979
     
    9292   xnt[3]  = tfnosc2(k);
    9393   xnt[4]  = tfnob(k);
    94    if(cmbfastOK) xnt[5]  = tfcmbfast(k);
     94   if(cmbfileOK) xnt[5]  = tf_cmbfile(k);
    9595   nt.Fill(xnt);
    9696 }
     
    107107openppf cmvtransf.ppf
    108108
    109 set k k
    110 set k log10(k)
     109# Eisenstein
     110n/plot nt.t%k t>0&&k>0 ! "nsta connectpoints logx logy"
     111n/plot nt.tnob%k tnob>0&&k>0 ! "nsta red same connectpoints logx logy"
     112n/plot nt.tnosc2%k tnosc2>0&&k>0 ! "nsta blue same connectpoints logx logy"
     113n/plot nt.tnosc1%k tnosc1>0&&k>0 ! "nsta green same connectpoints logx logy"
    111114
    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"
     115n/plot nt.t/tnob%k   tnob>0   ! "nsta red connectpoints"
     116n/plot nt.t/tnosc2%k tnosc2>0 ! "nsta blue same connectpoints"
     117n/plot nt.t/tnosc1%k tnosc1>0 ! "nsta green same connectpoints"
    117118
    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"
     119# CAMB
     120n/plot nt.t%k t>0&&k>0 ! "nsta connectpoints logx logy"
     121n/plot nt.tcmbf%k tcmbf>0&&k>0 ! "nsta red same connectpoints logx logy"
    121122
    122 # CMBFast
    123 n/plot nt.t%$k ! ! "nsta connectpoints"
    124 n/plot nt.tcmbf%$k ! ! "nsta red same connectpoints"
     123n/plot nt.(tcmbf-t)%k tcmbf>0. ! "nsta connectpoints"
     124n/plot nt.(tcmbf-t)/tcmbf%k tcmbf>0. ! "nsta connectpoints"
    125125
    126 n/plot nt.(tcmbf-t)%$k tcmbf>0. ! "nsta connectpoints"
    127 n/plot nt.(tcmbf-t)/tcmbf%$k tcmbf>0. ! "nsta connectpoints"
     126n/plot nt.t/tnosc2%k tnosc2>0&&t>0&&k>0 ! "nsta connectpoints logx logy"
     127n/plot nt.tcmbf/tnosc2%k tnosc2>0&&tcmbf>0&&k>0 ! "nsta connectpoints same red logx logy"
    128128*/
Note: See TracChangeset for help on using the changeset viewer.