Changeset 3768 in Sophya for trunk/Cosmo/SimLSS/cmvtgrowth.cc


Ignore:
Timestamp:
May 3, 2010, 4:08:34 PM (15 years ago)
Author:
cmv
Message:
  • refonte du code pour creer uniquement des conditions initiales
  • introduction du tirage des vitesse LOS pour les redshift-distortion

cmv 03/05/2010

File:
1 edited

Legend:

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

    r3572 r3768  
    1414
    1515void usage(void);
    16 void usage(void) {cout<<"cmvtgrowth z1,z2,dz [Omatter0,Lambda0]"<<endl;}
    17 
    18 void tstprint(CosmoCalc& univ,double z1,double z2,double dz);
    19 void tstspeed(CosmoCalc& univ,double z1,double z2,double dz);
    20 void tstntuple(CosmoCalc& univ,double z1,double z2,double dz);
     16void usage(void) {cout<<"cmvtgrowth z1,z2,nz [Omatter0,Lambda0]"<<endl;}
    2117
    2218int main(int narg,char *arg[])
    2319{
    2420
    25  double z1=0., z2=10., dz=1.;
    26  if(narg>1) sscanf(arg[1],"%lf,%lf,%lf",&z1,&z2,&dz);
    27  cout<<"z1="<<z1<<"  z2="<<z2<<"  dz="<<dz<<endl;
     21 double z1=0., z2=10.;
     22 int nz = 100;;
     23 if(narg>1) sscanf(arg[1],"%lf,%lf,%d",&z1,&z2,&nz);
     24 if(nz<=0) nz = 100;
     25 double dz = (z2-z1)/nz;
     26 cout<<"z1="<<z1<<"  z2="<<z2<<"  nz="<<nz<<"  dz="<<dz<<endl;
    2827
    2928 double om0=0.267804, ol0=0.73;
     
    3433 cout<<"D1(z=0) = "<<growth(0.)<<endl;
    3534
    36  const int n = 2;
    37  const char *vname[n] = {"z","d1"};
     35 const int n = 3;
     36 const char *vname[n] = {"z","d1","d1dz"};
    3837 NTuple nt(n,vname);
    3938 double xnt[n];
     
    4140   xnt[0]  = z;
    4241   xnt[1]  = growth(z);
     42   xnt[2]  = growth.DsDz(z,dz/2.);
    4343   nt.Fill(xnt);
    4444 }
     
    5959set cut z<5
    6060
     61# --- growth
    6162n/plot nt.d1%z $cut ! "nsta connectpoints"
    6263n/plot nt.1./(1.+z)%z $cut ! "nsta connectpoints red same"
     64
     65# --- growth'/growth
     66n/plot nt.d1dz/d1%z $cut ! "nsta connectpoints"
     67n/plot nt.-1./(1.+z)%z $cut ! "nsta connectpoints red same"
     68
     69# --- d(growth)/dz
     70zmin = 0.
     71zmax = 10.
     72set npt ${dv.size}
     73dd = ($zmax-$zmin)/(${npt}-1.)
     74exptovec dv nt d1
     75c++exec for(int i=1;i<dv.Size(); i++) dv(i-1) = dv(i)-dv(i-1);
     76
     77n/plot nt.-1./pow(1.+z,2.)%z $cut ! "nsta connectpoints red"
     78n/plot nt.d1dz%z $cut ! "nsta connectpoints same"
     79n/plot dv.val/${dd}%${zmin}+(n+1)*$dd ! ! "nsta plusmarker5 green same"
     80
    6381*/
Note: See TracChangeset for help on using the changeset viewer.